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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 69eee59e5e28ab0bd010959193bdbf88ae015d51
4
- data.tar.gz: 697696929f19a13ca2c2581614de79f6f4288abb
3
+ metadata.gz: dba8c789e24004d9a81401885954ab18f1ac8d12
4
+ data.tar.gz: 014c95b79e6c0376d34c3426bb32235fc92f5012
5
5
  SHA512:
6
- metadata.gz: 92128a90b0b06bfc0bfc879efcb8079367c42ee7c577227a120ac81ab298f9a22d3b352b66a3865e15b1348c46700a009de9c1f75e75d58af0acaec4817cc5e4
7
- data.tar.gz: 810d205ba2a6a4d09a5c23b8ce2a1c31a36df90e132b5db1343b8fb89fd6e5e7092e5a7a39ac36377f6f776f3c3a5798336889ba274e2fc1fcffe0922b94f34d
6
+ metadata.gz: 7a089d1926e44605cb5acdf4da22a0f5890b463d5bc671efbd5f90341b0f3461840a6d91c48f08125e3a45b0f6649de1d0b051a90bd74572db6fc80dffc62b5a
7
+ data.tar.gz: ba8bbd28860f571ff274d6d271377556690ab4b49b7582410f8f42e89888fb493454c7d88b61dee1ea949232ed898957434b1efb3819afbc4eb637d57f368d9d
@@ -45,11 +45,14 @@ class Cheatset::Creator
45
45
  plist_data = {
46
46
  'CFBundleIdentifier' => @cheatsheet.short_name,
47
47
  'CFBundleName' => @cheatsheet.title,
48
- 'DocSetPlatformFamily' => "cheatsheet",
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 = 'INSERT INTO searchIndex(name, type, path) VALUES (?, ?, ?)'
69
- db.execute(sql, entry.tags_stripped_name, 'Guide',
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
@@ -2,7 +2,7 @@ module Cheatset
2
2
  module DSL
3
3
  class Cheatsheet < Base
4
4
  attr_reader :categories
5
- define_attrs :title, :short_name, :source_url
5
+ define_attrs :title, :short_name, :source_url, :platform
6
6
  define_markdown_attrs :introduction, :notes
7
7
 
8
8
  def initialize(&block)
@@ -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= category.id
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}-#{index}"}
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|
@@ -1,3 +1,3 @@
1
1
  module Cheatset
2
- VERSION = '1.0.0'
2
+ VERSION = '1.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cheatset
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdan Popescu