cheatset 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cheatset/creator.rb +11 -5
- data/lib/cheatset/dsl/cheatsheet.rb +1 -1
- data/lib/cheatset/templates/template.haml +7 -2
- data/lib/cheatset/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dba8c789e24004d9a81401885954ab18f1ac8d12
|
4
|
+
data.tar.gz: 014c95b79e6c0376d34c3426bb32235fc92f5012
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a089d1926e44605cb5acdf4da22a0f5890b463d5bc671efbd5f90341b0f3461840a6d91c48f08125e3a45b0f6649de1d0b051a90bd74572db6fc80dffc62b5a
|
7
|
+
data.tar.gz: ba8bbd28860f571ff274d6d271377556690ab4b49b7582410f8f42e89888fb493454c7d88b61dee1ea949232ed898957434b1efb3819afbc4eb637d57f368d9d
|
data/lib/cheatset/creator.rb
CHANGED
@@ -45,11 +45,14 @@ class Cheatset::Creator
|
|
45
45
|
plist_data = {
|
46
46
|
'CFBundleIdentifier' => @cheatsheet.short_name,
|
47
47
|
'CFBundleName' => @cheatsheet.title,
|
48
|
-
'DocSetPlatformFamily' =>
|
48
|
+
'DocSetPlatformFamily' => @cheatsheet.short_name,
|
49
49
|
'DashDocSetFamily' => 'cheatsheet',
|
50
50
|
'isDashDocset' => true,
|
51
51
|
'dashIndexFilePath' => 'index.html'
|
52
52
|
}
|
53
|
+
if @cheatsheet.platform
|
54
|
+
plist_data['DocSetDashPluginKeyword'] = @cheatsheet.platform
|
55
|
+
end
|
53
56
|
File.open("#{@path}Info.plist", 'w') do |file|
|
54
57
|
file.write(Plist::Emit.dump(plist_data))
|
55
58
|
end
|
@@ -64,11 +67,14 @@ class Cheatset::Creator
|
|
64
67
|
CREATE UNIQUE INDEX anchor ON searchIndex (name, type, path);
|
65
68
|
SQL
|
66
69
|
@cheatsheet.categories.each do |category|
|
70
|
+
category_strip = category.id.strip.gsub(/\//, '%2F');
|
71
|
+
sql = 'INSERT INTO searchIndex(name, type, path) VALUES (?, ?, ?)'
|
72
|
+
db.execute(sql, category.id, 'Category',
|
73
|
+
"index.html\#//dash_ref/Category/#{category_strip}/1")
|
67
74
|
category.entries.each_with_index do |entry, index|
|
68
|
-
sql
|
69
|
-
|
70
|
-
"index.html\##{category.id}-#{index}")
|
75
|
+
db.execute(sql, entry.tags_stripped_name.strip, 'Entry',
|
76
|
+
"index.html\#//dash_ref_#{category_strip}/Entry/#{entry.tags_stripped_name.strip.gsub(/\//, '%2F')}/0")
|
71
77
|
end
|
72
78
|
end
|
73
79
|
end
|
74
|
-
end
|
80
|
+
end
|
@@ -4,6 +4,10 @@
|
|
4
4
|
%meta{charset: 'utf-8'}
|
5
5
|
%title= title
|
6
6
|
%link{rel: 'stylesheet', href: 'style.css'}
|
7
|
+
- categories.each do |category|
|
8
|
+
%link{href: "//dash_ref/Category/#{category.id.strip.gsub(/\//, '%2F')}/1"}
|
9
|
+
- category.entries.each_with_index do |entry, index|
|
10
|
+
%link{href: "//dash_ref_#{category.id.strip.gsub(/\//, '%2F')}/Entry/#{entry.tags_stripped_name.strip.gsub(/\//, '%2F')}/0"}
|
7
11
|
%body
|
8
12
|
%header
|
9
13
|
%h1= title
|
@@ -13,10 +17,11 @@
|
|
13
17
|
|
14
18
|
- categories.each do |category|
|
15
19
|
%section.category
|
16
|
-
%h2
|
20
|
+
%h2{id:"//dash_ref/Category/#{category.id.strip.gsub(/\//, '%2F')}/1"}
|
21
|
+
= category.id
|
17
22
|
%table
|
18
23
|
- category.entries.each_with_index do |entry, index|
|
19
|
-
%tr{id: "#{category.id}
|
24
|
+
%tr{id: "//dash_ref_#{category.id.strip.gsub(/\//, '%2F')}/Entry/#{entry.tags_stripped_name.strip.gsub(/\//, '%2F')}/0"}
|
20
25
|
- if entry.command
|
21
26
|
%td.command
|
22
27
|
- entry.command.each do |command|
|
data/lib/cheatset/version.rb
CHANGED