cheatset 1.1.2 → 1.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/cheatset/creator.rb +7 -4
- data/lib/cheatset/templates/style.css +2 -1
- data/lib/cheatset/templates/style.scss +2 -1
- data/lib/cheatset/templates/template.haml +7 -6
- data/lib/cheatset/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6ff7c204890ac4b633dd4d8f6e572552ad729668
|
4
|
+
data.tar.gz: d528124246da08fec16b427f9b45be02ada11b9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab416caa56ba8d044075c7d70d8ef51a44245695aa10a47a49c6a4a04394a7b49795dcf11dbcba1370c222e4c999ff10eda3a7b6e9b13bb7d91ad4930a09a4fb
|
7
|
+
data.tar.gz: abf59ef9dde9210cb76c9723cd385e496cc65efa0a74094aa03465900fbdef884b4dc8e6608a4d24f65d1983c340be31c78f2cf898487fde06f41c61c51c1d94
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ Write a file (here `sample.cheatsheet`) containing your cheatsheet data, e.g.:
|
|
16
16
|
|
17
17
|
```ruby
|
18
18
|
cheatsheet do
|
19
|
-
title 'Sample
|
19
|
+
title 'Sample' # Will be displayed by Dash in the docset list
|
20
20
|
short_name 'sample' # Used for the filename of the docset
|
21
21
|
introduction 'My *awesome* cheatsheet' # Can contain markdown and multiple lines
|
22
22
|
|
@@ -26,7 +26,7 @@ cheatsheet do
|
|
26
26
|
|
27
27
|
entry do
|
28
28
|
command 'CMD-n' # Optional
|
29
|
-
command 'CMD-N' #
|
29
|
+
command 'CMD-N' # Multiple commands are supported
|
30
30
|
name 'Create window' # A short name, can contain markdown
|
31
31
|
notes 'Some notes' # Optional longer explanation, can contain markdown
|
32
32
|
end
|
data/lib/cheatset/creator.rb
CHANGED
@@ -3,6 +3,7 @@ require 'sqlite3'
|
|
3
3
|
require 'fileutils'
|
4
4
|
require 'haml'
|
5
5
|
require 'ostruct'
|
6
|
+
require 'uri'
|
6
7
|
|
7
8
|
class Cheatset::Creator
|
8
9
|
def initialize(cheatsheet)
|
@@ -67,7 +68,7 @@ class Cheatset::Creator
|
|
67
68
|
CREATE UNIQUE INDEX anchor ON searchIndex (name, type, path);
|
68
69
|
SQL
|
69
70
|
@cheatsheet.categories.each do |category|
|
70
|
-
category_strip = category.id.strip.gsub(/\//, '%
|
71
|
+
category_strip = URI.escape(category.id.strip).gsub(/\//, '%252F');
|
71
72
|
sql = 'INSERT INTO searchIndex(name, type, path) VALUES (?, ?, ?)'
|
72
73
|
db.execute(sql, category.id, 'Category',
|
73
74
|
"index.html\#//dash_ref/Category/#{category_strip}/1")
|
@@ -75,11 +76,13 @@ class Cheatset::Creator
|
|
75
76
|
if entry.command
|
76
77
|
entry.command.each do |command|
|
77
78
|
db.execute(sql, command.strip, 'Command',
|
78
|
-
"index.html\#//dash_ref_#{category_strip}/Entry/#{entry.tags_stripped_name.strip.gsub(/\//, '%
|
79
|
+
"index.html\#//dash_ref_#{category_strip}/Entry/#{URI.escape(entry.tags_stripped_name.strip).gsub(/\//, '%252F')}/0")
|
79
80
|
end
|
80
81
|
end
|
81
|
-
|
82
|
-
|
82
|
+
if entry.name
|
83
|
+
db.execute(sql, entry.tags_stripped_name.strip, 'Entry',
|
84
|
+
"index.html\#//dash_ref_#{category_strip}/Entry/#{URI.escape(entry.tags_stripped_name.strip).gsub(/\//, '%252F')}/0")
|
85
|
+
end
|
83
86
|
end
|
84
87
|
end
|
85
88
|
end
|
@@ -79,7 +79,8 @@ td.command {
|
|
79
79
|
width: 1%;
|
80
80
|
white-space: nowrap;
|
81
81
|
vertical-align: top;
|
82
|
-
padding: 8px 8px
|
82
|
+
padding: 8px 8px 4px 7px;
|
83
|
+
text-align: right; }
|
83
84
|
td.command code {
|
84
85
|
padding: .1em .6em;
|
85
86
|
box-shadow: 0 1px 0px rgba(0, 0, 0, 0.2), 0 0 0 2px white inset;
|
@@ -97,7 +97,8 @@ td.command {
|
|
97
97
|
width: 1%;
|
98
98
|
white-space: nowrap;
|
99
99
|
vertical-align: top;
|
100
|
-
padding: 8px 8px
|
100
|
+
padding: 8px 8px 4px 7px;
|
101
|
+
text-align:right;
|
101
102
|
code {
|
102
103
|
// Nice key styling:
|
103
104
|
// https://developers.google.com/chrome-developer-tools/docs/shortcuts
|
@@ -7,7 +7,8 @@
|
|
7
7
|
- categories.each do |category|
|
8
8
|
%link{href: "//dash_ref/Category/#{category.id.strip.gsub(/\//, '%2F')}/1"}
|
9
9
|
- category.entries.each_with_index do |entry, index|
|
10
|
-
|
10
|
+
- if entry.name
|
11
|
+
%link{href: "//dash_ref_#{category.id.strip.gsub(/\//, '%2F')}/Entry/#{entry.tags_stripped_name.strip.gsub(/\//, '%2F')}/0"}
|
11
12
|
%body
|
12
13
|
%header
|
13
14
|
%h1= title
|
@@ -21,13 +22,13 @@
|
|
21
22
|
= category.id
|
22
23
|
%table
|
23
24
|
- category.entries.each_with_index do |entry, index|
|
24
|
-
%tr{id: "//dash_ref_#{category.id.strip.gsub(/\//, '%2F')}/Entry/#{entry.tags_stripped_name.strip.gsub(/\//, '%2F')}/0"}
|
25
|
+
%tr{id: ("//dash_ref_#{category.id.strip.gsub(/\//, '%2F')}/Entry/#{entry.tags_stripped_name.strip.gsub(/\//, '%2F')}/0" if entry.name)}
|
25
26
|
- if entry.command
|
26
27
|
%td.command
|
27
28
|
- entry.command.each do |command|
|
28
29
|
%p
|
29
|
-
%code= command
|
30
|
-
%td.description
|
30
|
+
%code= CGI.escapeHTML(command)
|
31
|
+
%td.description{:colspan => ("2" unless entry.command)}
|
31
32
|
.name~ entry.name
|
32
33
|
.notes~ entry.notes
|
33
34
|
- if notes
|
@@ -36,6 +37,6 @@
|
|
36
37
|
~ notes
|
37
38
|
%footer
|
38
39
|
- if source_url
|
39
|
-
You can modify and improve this cheatsheet <a href="#{source_url}">here</a>.
|
40
|
+
You can modify and improve this cheatsheet <a onclick="window.dash.openExternal_(this.href); return false;" href="#{source_url}">here</a>.
|
40
41
|
- else
|
41
|
-
Generated with <a href='https://github.com/Kapeli/cheatset#readme'>cheatset</a>.
|
42
|
+
Generated with <a onclick="window.dash.openExternal_(this.href); return false;" href='https://github.com/Kapeli/cheatset#readme'>cheatset</a>.
|
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.1.
|
4
|
+
version: 1.1.3
|
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-02-
|
11
|
+
date: 2014-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|