cheatset 1.1.3 → 1.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +17 -17
- data/lib/cheatset/creator.rb +3 -3
- data/lib/cheatset/dsl/cheatsheet.rb +1 -1
- 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: c6ecd818ba745c3c04ff097182d2f9e8f3419331
|
4
|
+
data.tar.gz: 0f418a6f8aad8fa20188e8d6e79571eeb37f7637
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4e38c2a1dd9f5a7d9038aad480450710a9a02fb4c1f4dde5aa97037276da334a26cd354710d2d251bb6952e7ff67fd5aced2071a336c61de0fef5967c6036169
|
7
|
+
data.tar.gz: 8157dd1d6610a50995675eb07fcc4660acff1b47f7acf08cea7a64584180c92cbd42651b9e0e3a100513b7460e9d85e88d0c8f4b6aa32c720486416408b84c6e
|
data/README.md
CHANGED
@@ -2,25 +2,31 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/cheatset.png)](http://badge.fury.io/rb/cheatset)
|
4
4
|
|
5
|
-
Generate your own
|
6
|
-
Use this simple command line tool and write your
|
5
|
+
Generate your own cheat sheets as docsets for [Dash](http://kapeli.com/dash)!
|
6
|
+
Use this simple command line tool and write your cheat sheets in an easy
|
7
7
|
language (Ruby DSL).
|
8
8
|
|
9
9
|
## Installation
|
10
10
|
|
11
11
|
$ gem install cheatset
|
12
12
|
|
13
|
+
## Contributing
|
14
|
+
|
15
|
+
If you make an useful cheat sheet, please [contribute it](https://github.com/Kapeli/cheatsheets#readme) to Dash.
|
16
|
+
|
13
17
|
## Usage
|
14
18
|
|
15
|
-
Write a file (here `sample.
|
19
|
+
Write a file (here `sample.rb`) containing your cheat sheet data, e.g.:
|
16
20
|
|
17
21
|
```ruby
|
18
22
|
cheatsheet do
|
19
|
-
title 'Sample'
|
20
|
-
|
21
|
-
|
23
|
+
title 'Sample' # Will be displayed by Dash in the docset list
|
24
|
+
docset_file_name 'Sample' # Used for the filename of the docset
|
25
|
+
keyword 'sample' # Used as the initial search keyword (listed in Preferences > Docsets)
|
26
|
+
|
27
|
+
introduction 'My *awesome* cheat sheet' # Optional, can contain markdown and multiple lines
|
22
28
|
|
23
|
-
# A
|
29
|
+
# A cheat sheet must consist of categories
|
24
30
|
category do
|
25
31
|
id 'Windows' # Must be unique and is used as title of the category
|
26
32
|
|
@@ -49,26 +55,20 @@ cheatsheet do
|
|
49
55
|
end
|
50
56
|
end
|
51
57
|
|
52
|
-
notes 'Some notes at the end of the
|
58
|
+
notes 'Some notes at the end of the cheat sheet'
|
53
59
|
end
|
54
60
|
```
|
55
61
|
The following values may contain markdown formatted text:
|
56
62
|
|
57
|
-
* The `introduction` and the `notes` of the
|
63
|
+
* The `introduction` and the `notes` of the cheat sheet
|
58
64
|
* The `name` and the `notes` of the entries
|
59
65
|
|
60
66
|
For more complete examples look at some of
|
61
|
-
[the actual
|
67
|
+
[the actual cheat sheets](https://github.com/Kapeli/cheatsheets).
|
62
68
|
|
63
69
|
To convert this file to a docset, call
|
64
70
|
|
65
|
-
$ cheatset generate sample.
|
66
|
-
|
67
|
-
|
68
|
-
## Contributing
|
69
|
-
|
70
|
-
Yes, please! Open issues and pull requests on the
|
71
|
-
[GitHub page](https://github.com/Kapeli/cheatset).
|
71
|
+
$ cheatset generate sample.rb
|
72
72
|
|
73
73
|
## Thanks
|
74
74
|
|
data/lib/cheatset/creator.rb
CHANGED
@@ -8,7 +8,7 @@ require 'uri'
|
|
8
8
|
class Cheatset::Creator
|
9
9
|
def initialize(cheatsheet)
|
10
10
|
@cheatsheet = cheatsheet
|
11
|
-
@docset_path = "#{@cheatsheet.
|
11
|
+
@docset_path = "#{@cheatsheet.docset_file_name}.docset"
|
12
12
|
@path = "#{@docset_path}/Contents/"
|
13
13
|
end
|
14
14
|
|
@@ -44,9 +44,9 @@ class Cheatset::Creator
|
|
44
44
|
|
45
45
|
def generate_plist_file
|
46
46
|
plist_data = {
|
47
|
-
'CFBundleIdentifier' => @cheatsheet.
|
47
|
+
'CFBundleIdentifier' => @cheatsheet.keyword,
|
48
48
|
'CFBundleName' => @cheatsheet.title,
|
49
|
-
'DocSetPlatformFamily' => @cheatsheet.
|
49
|
+
'DocSetPlatformFamily' => @cheatsheet.keyword,
|
50
50
|
'DashDocSetFamily' => 'cheatsheet',
|
51
51
|
'isDashDocset' => true,
|
52
52
|
'dashIndexFilePath' => 'index.html'
|
@@ -2,7 +2,7 @@ module Cheatset
|
|
2
2
|
module DSL
|
3
3
|
class Cheatsheet < Base
|
4
4
|
attr_reader :categories
|
5
|
-
define_attrs :title, :
|
5
|
+
define_attrs :title, :docset_file_name, :keyword, :source_url, :platform
|
6
6
|
define_markdown_attrs :introduction, :notes
|
7
7
|
|
8
8
|
def initialize(&block)
|
data/lib/cheatset/version.rb
CHANGED