cheatset 1.4.0 → 1.4.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0963874193dcbdf97faaea916dc29529861c7bfb
4
- data.tar.gz: 7c3481e0821db0a00c13c67f8c83636bb999db12
2
+ SHA256:
3
+ metadata.gz: 7cdad91d3249670d887fc8d31610c34332eec34e4b3cc7b238caf17ad6a8c71a
4
+ data.tar.gz: f950f00db4a6205d1be2eceaac6cda4e70620bc69ac4d7ba5e6d0de4b4b78a20
5
5
  SHA512:
6
- metadata.gz: 899d97cc1734b4a08a906e66e91caee81bad26eeb5e279d9097ba064fb1edc5e57f88ea5756e4322f73934025e17e321970fa8e2616ae4990e5850f64a1bc316
7
- data.tar.gz: 836b7f0bc93683e1e875447047ab5813c1663a4d35e59087398191c8f8753108b04f9d1b31f8271e3d905c2f98dd3500fc3584bb46e426542f1ec73227163612
6
+ metadata.gz: 4685f391d19394979b8fe9bd321b02f524e935d654c6898940a0771ee56876407bce6d89aac7de2ca87feac477a47fafa04cda7b3e7f925a8c10405917d96996
7
+ data.tar.gz: c4f2979652d942646e2abc52a4431479e8dbe8489aa5d238979db25ef7301908ac6103db53e6388cece733cd2e47c9f09b83db2aaab178a8dfb0a774dbe83b9a
data/README.md CHANGED
@@ -8,15 +8,15 @@ language (Ruby DSL).
8
8
 
9
9
  ## Installation
10
10
 
11
- $ sudo gem install cheatset --no-ri --no-rdoc
11
+ $ sudo gem install cheatset
12
12
 
13
13
  Note: this requires the Xcode Command Line Tools to be installed. Install them using this:
14
14
 
15
15
  $ xcode-select --install
16
-
16
+
17
17
  ## Contributions
18
18
 
19
- If you make an useful cheat sheet, please [contribute it](https://github.com/Kapeli/cheatsheets#readme) to Dash.
19
+ If you make a useful cheat sheet, please [contribute it](https://github.com/Kapeli/cheatsheets#readme) to Dash.
20
20
 
21
21
  ## Usage
22
22
 
@@ -28,7 +28,7 @@ cheatsheet do
28
28
  docset_file_name 'Sample' # Used for the filename of the docset
29
29
  keyword 'sample' # Used as the initial search keyword (listed in Preferences > Docsets)
30
30
  # resources 'resources_dir' # An optional resources folder which can contain images or anything else
31
-
31
+
32
32
  introduction 'My *awesome* cheat sheet' # Optional, can contain Markdown or HTML
33
33
 
34
34
  # A cheat sheet must consist of categories
@@ -78,6 +78,15 @@ Syntax highlighting is supported (see Ruby code in the sample). For a list of su
78
78
  For more complete examples look at some of
79
79
  [the actual cheat sheets](https://github.com/Kapeli/cheatsheets/tree/master/cheatsheets).
80
80
 
81
+ If you do not use Ruby or lack a working Ruby toolchain and still want to generate cheatsheets.
82
+
83
+ You can use the `cheatset` Docker image.
84
+
85
+ $ docker pull jonasbn/cheatset:lastest
86
+ $ docker run --rm -it --volume $PWD:/tmp --name cheatset jonasbn/cheatset:latest generate samble.rb
87
+
88
+ For more details on the Docker image please visit the repositories on [DockerHub](https://hub.docker.com/repository/docker/jonasbn/cheatset) or [GitHub](https://github.com/jonasbn/docker-cheatset)
89
+
81
90
  ## Advanced Usage
82
91
 
83
92
  Apart from the attributes listed in the sample cheat sheet above, you can also use these:
@@ -3,7 +3,7 @@ require 'sqlite3'
3
3
  require 'fileutils'
4
4
  require 'haml'
5
5
  require 'ostruct'
6
- require 'uri'
6
+ require 'cgi'
7
7
  require 'pathname'
8
8
 
9
9
  class Cheatset::Creator
@@ -84,9 +84,9 @@ class Cheatset::Creator
84
84
  sql = 'INSERT INTO searchIndex(name, type, path) VALUES (?, ?, ?)'
85
85
  db.execute(sql, @cheatsheet.title, 'Category',
86
86
  "index.html")
87
-
87
+
88
88
  @cheatsheet.categories.each do |category|
89
- category_strip = URI.escape(category.id.strip).gsub(/\//, '%252F');
89
+ category_strip = CGI.escape(category.id.strip).gsub(/\//, '%252F');
90
90
  if @cheatsheet.title != category.id
91
91
  db.execute(sql, category.id, 'Category',
92
92
  "index.html\#//dash_ref/Category/#{category_strip}/1")
@@ -96,7 +96,7 @@ class Cheatset::Creator
96
96
  if entry.command && entry.command.length > 0
97
97
  first_command = entry.command.first
98
98
  end
99
- href = (entry.name || entry.index_name) ? "index.html\#//dash_ref_#{category_strip}/Entry/#{URI.escape((entry.index_name) ? entry.index_name.strip : entry.tags_stripped_name.strip).gsub(/\//, '%252F')}/0" : (first_command) ? "index.html\#//dash_ref_#{category_strip}/Command/#{URI.escape(first_command).gsub(/\//, '%252F')}/0" : ""
99
+ href = (entry.name || entry.index_name) ? "index.html\#//dash_ref_#{category_strip}/Entry/#{CGI.escape((entry.index_name) ? entry.index_name.strip : entry.tags_stripped_name.strip).gsub(/\//, '%252F')}/0" : (first_command) ? "index.html\#//dash_ref_#{category_strip}/Command/#{URI.escape(first_command).gsub(/\//, '%252F')}/0" : ""
100
100
  if entry.command
101
101
  entry.command.each do |command|
102
102
  if(!command.strip.empty? && !entry.not_in_main_index)
@@ -124,4 +124,4 @@ class Cheatset::Creator
124
124
  end
125
125
  end
126
126
  end
127
- end
127
+ end
@@ -2,7 +2,7 @@ module Cheatset
2
2
  module DSL
3
3
  class Entry < Base
4
4
  define_list_attrs :command, :td_command, :extra_index_name
5
- define_attrs :index_name, :not_in_main_index
5
+ define_attrs :index_name, :not_in_main_index, :html_notes
6
6
  define_markdown_attrs :name, :notes
7
7
  define_markdown_list_attrs :td_notes
8
8
  end
@@ -44,14 +44,14 @@ h1, h2, h3, p, blockquote {
44
44
  src: local("Open Sans Extrabold Italic"), local("OpenSans-ExtraboldItalic"), url(cheatset_resources/Open_Sans_Extrabold_Italic.woff) format("woff"); }
45
45
  body {
46
46
  font-family: 'Open Sans', sans-serif;
47
- font-size: 14px;
47
+ font-size: 16px;
48
48
  color: #000;
49
49
  background-color: #fff;
50
50
  margin: 0; }
51
51
 
52
52
  code, pre {
53
53
  font-family: Menlo, Consolas, "Liberation Mono", Courier, monospace;
54
- font-size: 13px; }
54
+ font-size: 15px; }
55
55
 
56
56
  code {
57
57
  margin: 0;
@@ -53,10 +53,11 @@
53
53
  %td.td_command
54
54
  - if !command.empty?
55
55
  %code= CGI.escapeHTML(command)
56
- - if entry.name || entry.notes
56
+ - if entry.name || entry.notes || entry.html_notes
57
57
  %td.description{:colspan => ("2" unless entry.command || entry.td_command || entry.td_notes)}
58
58
  .name~ entry.name
59
59
  .notes~ entry.notes
60
+ .notes~ entry.html_notes
60
61
  - if entry.td_notes
61
62
  - entry.td_notes.each do |notes|
62
63
  %td.td_notes
@@ -1,3 +1,3 @@
1
1
  module Cheatset
2
- VERSION = '1.4.0'
2
+ VERSION = '1.4.4'
3
3
  end
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.0
4
+ version: 1.4.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bogdan Popescu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-18 00:00:00.000000000 Z
11
+ date: 2021-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -204,8 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
204
204
  - !ruby/object:Gem::Version
205
205
  version: '0'
206
206
  requirements: []
207
- rubyforge_project:
208
- rubygems_version: 2.2.5
207
+ rubygems_version: 3.0.3.1
209
208
  signing_key:
210
209
  specification_version: 4
211
210
  summary: Generate cheat sheets for Dash