cheatset 1.1.8 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7196a91aceb0b2fb4f904c875b1ded33c2a81e60
4
- data.tar.gz: 1ca4f3b6a886606ad16fea556a694404329e42fa
3
+ metadata.gz: 32d4692c040f0ce446aa8652cd3627453f4a7a8f
4
+ data.tar.gz: 91c7acd9dca1ed99c2465aceaa18bdcd2035e9c3
5
5
  SHA512:
6
- metadata.gz: edbc9153a8122ba4f4c04b98a54486db87448113c5d2ae787781fd61cbe875949322832e33fff3aef59ee82958ba9ced6db029d3e9e5ad3a59c752f32a18b452
7
- data.tar.gz: fc55e53c01d0d74c259989b376b1d0967cb99bb93ab5a0507846a643eaea6d93804e9b8d3b30bae15fd35d465d62e56cec81905bc155f4bb046fdc160ec006b9
6
+ metadata.gz: 372216808da3a7b9493891ef237ececf07fb8ea41f730aaf28ace4796f0857a053b17d7d96953f70684a60c45ac197787815b580b9837509757c416cdee28eee
7
+ data.tar.gz: 5671cf5c9ecd7c8e0cbf344394e3de5101b2aacd776714ac80b53cbdc96a195213860da6a7ad7a02f4a149666cf66beecc920f03dc9ffe74b0fad6dbc4024d4f
data/README.md CHANGED
@@ -31,13 +31,13 @@ cheatsheet do
31
31
  id 'Windows' # Must be unique and is used as title of the category
32
32
 
33
33
  entry do
34
- command 'CMD-n' # Optional
35
- command 'CMD-N' # Multiple commands are supported
36
- name 'Create window' # A short name, can contain Markdown or HTML
37
- notes 'Some notes' # Optional longer explanation, can contain Markdown or HTML
34
+ command 'CMD+N' # Optional
35
+ command 'CMD+SHIFT+N' # Multiple commands are supported
36
+ name 'Create window' # A short name, can contain Markdown or HTML
37
+ notes 'Some notes' # Optional longer explanation, can contain Markdown or HTML
38
38
  end
39
39
  entry do
40
- command 'CMD-w'
40
+ command 'CMD+W'
41
41
  name 'Close window'
42
42
  end
43
43
  end
@@ -58,17 +58,18 @@ cheatsheet do
58
58
  notes 'Some notes at the end of the cheat sheet'
59
59
  end
60
60
  ```
61
+
62
+ To convert this file to a docset, call
63
+
64
+ $ cheatset generate sample.rb
65
+
61
66
  The following values may contain Markdown or HTML:
62
67
 
63
68
  * The `introduction` and the `notes` of the cheat sheet
64
69
  * The `name` and the `notes` of the entries
65
70
 
66
71
  For more complete examples look at some of
67
- [the actual cheat sheets](https://github.com/Kapeli/cheatsheets).
68
-
69
- To convert this file to a docset, call
70
-
71
- $ cheatset generate sample.rb
72
+ [the actual cheat sheets](https://github.com/Kapeli/cheatsheets/tree/master/cheatsheets).
72
73
 
73
74
  ## Thanks
74
75
 
data/cheatset.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |spec|
7
7
  spec.name = 'cheatset'
8
8
  spec.version = Cheatset::VERSION
9
9
  spec.authors = ['Bogdan Popescu']
10
- spec.description = 'Generate cheatsheets for Dash'
10
+ spec.description = 'Generate cheat sheets for Dash'
11
11
  spec.summary = spec.description
12
12
  spec.homepage = 'https://github.com/Kapeli/cheatset'
13
13
  spec.license = 'MIT'
@@ -74,8 +74,18 @@ class Cheatset::Creator
74
74
  category.entries.each_with_index do |entry, index|
75
75
  if entry.command
76
76
  entry.command.each do |command|
77
- db.execute(sql, command.strip, 'Command',
77
+ if(!command.strip.empty?)
78
+ db.execute(sql, command.strip, 'Command',
78
79
  "index.html\#//dash_ref_#{category_strip}/Entry/#{URI.escape(entry.tags_stripped_name.strip).gsub(/\//, '%252F')}/0")
80
+ end
81
+ end
82
+ end
83
+ if entry.td_command
84
+ entry.td_command.each do |command|
85
+ if(!command.strip.empty?)
86
+ db.execute(sql, command.strip, 'Command',
87
+ "index.html\#//dash_ref_#{category_strip}/Entry/#{URI.escape(entry.tags_stripped_name.strip).gsub(/\//, '%252F')}/0")
88
+ end
79
89
  end
80
90
  end
81
91
  if entry.name
@@ -2,7 +2,7 @@ module Cheatset
2
2
  module DSL
3
3
  class Cheatsheet < Base
4
4
  attr_reader :categories
5
- define_attrs :title, :docset_file_name, :keyword, :source_url, :platform
5
+ define_attrs :title, :docset_file_name, :keyword, :source_url, :platform, :style
6
6
  define_markdown_attrs :introduction, :notes
7
7
 
8
8
  def initialize(&block)
@@ -1,7 +1,7 @@
1
1
  module Cheatset
2
2
  module DSL
3
3
  class Entry < Base
4
- define_list_attrs :command
4
+ define_list_attrs :command, :td_command
5
5
  define_markdown_attrs :name, :notes
6
6
  end
7
7
  end
@@ -75,13 +75,13 @@ table {
75
75
  td {
76
76
  padding: 13px 2px 0px 8px; }
77
77
 
78
- td.command {
78
+ td.command, td.td_command {
79
79
  width: 1%;
80
80
  white-space: nowrap;
81
81
  vertical-align: top;
82
82
  padding: 9px 8px 4px 7px;
83
83
  text-align: right; }
84
- td.command code {
84
+ td.command code, td.td_command code {
85
85
  padding: .1em 0.2em;
86
86
  box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2), 0 0 0 2px white inset;
87
87
  border-radius: 3px;
@@ -89,6 +89,10 @@ td.command {
89
89
  background-color: #efefef;
90
90
  color: #333; }
91
91
 
92
+ td.td_command {
93
+ text-align: center;
94
+ border-right: 1px solid #666666; }
95
+
92
96
  td.description .name {
93
97
  font-size: 1.2em; }
94
98
 
@@ -111,6 +111,12 @@ td.command {
111
111
  }
112
112
  }
113
113
 
114
+ td.td_command {
115
+ @extend td.command;
116
+ text-align:center;
117
+ border-right: 1px solid $dark_gray;
118
+ }
119
+
114
120
  td.description {
115
121
  .name {
116
122
  font-size: 1.2em;
@@ -4,6 +4,8 @@
4
4
  %meta{charset: 'utf-8'}
5
5
  %title= title
6
6
  %link{rel: 'stylesheet', href: 'style.css'}
7
+ - if style
8
+ %style{type: 'text/css'}= style
7
9
  - categories.each do |category|
8
10
  %link{href: "//dash_ref/Category/#{category.id.strip.gsub(/\//, '%2F')}/1"}
9
11
  - category.hasEntry(false)
@@ -35,7 +37,12 @@
35
37
  - entry.command.each do |command|
36
38
  %p
37
39
  %code= CGI.escapeHTML(command)
38
- %td.description{:colspan => ("2" unless entry.command)}
40
+ - if entry.td_command
41
+ - entry.td_command.each do |command|
42
+ %td.td_command
43
+ - if !command.empty?
44
+ %code= CGI.escapeHTML(command)
45
+ %td.description{:colspan => ("2" unless entry.command || entry.td_command)}
39
46
  .name~ entry.name
40
47
  .notes~ entry.notes
41
48
  - if notes
@@ -1,3 +1,3 @@
1
1
  module Cheatset
2
- VERSION = '1.1.8'
2
+ VERSION = '1.2.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheatset
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.8
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdan Popescu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-04 00:00:00.000000000 Z
11
+ date: 2014-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -150,7 +150,7 @@ dependencies:
150
150
  - - '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
- description: Generate cheatsheets for Dash
153
+ description: Generate cheat sheets for Dash
154
154
  email:
155
155
  executables:
156
156
  - cheatset
@@ -201,6 +201,6 @@ rubyforge_project:
201
201
  rubygems_version: 2.2.2
202
202
  signing_key:
203
203
  specification_version: 4
204
- summary: Generate cheatsheets for Dash
204
+ summary: Generate cheat sheets for Dash
205
205
  test_files: []
206
206
  has_rdoc: