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 +4 -4
- data/README.md +11 -10
- data/cheatset.gemspec +1 -1
- data/lib/cheatset/creator.rb +11 -1
- data/lib/cheatset/dsl/cheatsheet.rb +1 -1
- data/lib/cheatset/dsl/entry.rb +1 -1
- data/lib/cheatset/templates/style.css +6 -2
- data/lib/cheatset/templates/style.scss +6 -0
- data/lib/cheatset/templates/template.haml +8 -1
- data/lib/cheatset/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32d4692c040f0ce446aa8652cd3627453f4a7a8f
|
4
|
+
data.tar.gz: 91c7acd9dca1ed99c2465aceaa18bdcd2035e9c3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
35
|
-
command 'CMD
|
36
|
-
name 'Create window'
|
37
|
-
notes 'Some notes'
|
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
|
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
|
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'
|
data/lib/cheatset/creator.rb
CHANGED
@@ -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
|
-
|
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)
|
data/lib/cheatset/dsl/entry.rb
CHANGED
@@ -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
|
|
@@ -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
|
-
|
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
|
data/lib/cheatset/version.rb
CHANGED
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.
|
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-
|
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
|
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
|
204
|
+
summary: Generate cheat sheets for Dash
|
205
205
|
test_files: []
|
206
206
|
has_rdoc:
|