Sha256: 69655779b45a30628dead26d1a7a66a6ea82dd8ea89b6c03dc1158c440bc4c28

Contents?: true

Size: 1.14 KB

Versions: 1

Compression:

Stored size: 1.14 KB

Contents

% cols = 4
% chords = []
% chords += keytable.tagged(:normal).map{|key| keyboard.find{|chord| 
%   key === chord and chord[0][1].empty?}
%}
% chords += keytable.find_all{|key| key.has_mod?("Shift")}.map{|key| keyboard.find{|chord|
%   key === chord and (chord[0][1] == ["RSft"] or chord[0][1] == ["LSft"])}
%}
% chords += keytable.tagged(:special).map{|key| keyboard.find{|chord| 
%   key === chord and chord[0][1].empty?}
%}
% chords += keyboard.find_all{|chord| !chord.single?}
% chords.compact!
%
% columns = []
% chords.map! do |chord| 
%  rendered= [ chord.render_action, chord.render_keys]
%  if rendered[0] =~ /^[a-z]$/
%    rendered[0].upcase!
%  end
%  rendered
%end

% chords.each_slice((chords.length / cols.to_f).ceil){|col| columns << col}
% act_widths = columns.map{|col| col.map{|line| line[0].length}.max}
% key_widths = columns.map{|col| col.map{|line| line[1].length}.max}
% columns[0].zip(*columns[1..-1]).each_with_index do |row, index|
%   row.zip(act_widths, key_widths).each do |chord, aw, kw|
%     unless chord.nil?
<%= chord[0].rjust(aw) %>: <%= chord[1].ljust(kw + 2)%>
%     end
%   end

% end

%mouse.each do |chord|
<%= chord.render %> 
%end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
twiddler-utils-0.0.3 templates/cheatsheet.erb