cheatset 1.4.2 → 1.4.6
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 +4 -4
- data/README.md +2 -1
- data/bin/cheatset +0 -0
- data/lib/cheatset/creator.rb +5 -5
- data/lib/cheatset/dsl/entry.rb +1 -1
- data/lib/cheatset/templates/style.css +7 -0
- data/lib/cheatset/templates/style.scss +10 -2
- data/lib/cheatset/templates/template.haml +2 -1
- data/lib/cheatset/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0003ce02c53148dbf92dd296e86f17088f943eaf06fc0a2e5c465355cd8b346
|
4
|
+
data.tar.gz: d9670d8da75d5b655a5c9e6092729b15088190d0c4013bd10c53cbd7f65a8a39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eccced4fa8f4f199dc27062bf1393320269fe5b97b3a72353b07f96328c0258ee5ac2cd3522fd4c861330371d572eaf11c83321b4ac9aad7efe1c6e490981925
|
7
|
+
data.tar.gz: 60e7d5e8ba188a36b89a02215efba736c62fe540ecff311840a11194d738345f2d42fba62bae9c255f6d762d09414ecd7ff7440a5257343b6dca9c9d784cda1f
|
data/README.md
CHANGED
@@ -94,7 +94,8 @@ Apart from the attributes listed in the sample cheat sheet above, you can also u
|
|
94
94
|
* `style` (under `cheatsheet`) - define any CSS style you want. See example [here](https://github.com/Kapeli/cheatsheets/blob/f9e40e30b6fde9063b7a0fb5de8fb203851b17df/cheatsheets/CSS_Named_Colors.rb#L7-L12)
|
95
95
|
* `html_class` (under `category`) - define a HTML class to be added to a category. This can be used to define custom styling for each category
|
96
96
|
* `td_command` (under `entry`) - just like `command`, but multiple ones are added in a separate column (as opposed to a separate row)
|
97
|
-
* `td_notes` (under `entry`) - just like `notes
|
97
|
+
* `td_notes` (under `entry`) - just like `notes` but can be repeated multiple times, each becoming a separate column
|
98
|
+
* `html_notes` (under `entry`) - just like `notes`, but doesn't support Markdown
|
98
99
|
* `index_name` (under `entry`) - this is not displayed in the cheat sheet at all. You can use it to define a separate index name (i.e what gets added to Dash's search index and is searchable in Dash). In other words, if this entry is not present, the value in `name` is used.
|
99
100
|
|
100
101
|
## Thanks
|
data/bin/cheatset
CHANGED
File without changes
|
data/lib/cheatset/creator.rb
CHANGED
@@ -3,7 +3,7 @@ require 'sqlite3'
|
|
3
3
|
require 'fileutils'
|
4
4
|
require 'haml'
|
5
5
|
require 'ostruct'
|
6
|
-
require '
|
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 =
|
89
|
+
category_strip = CGI.escape(category.id.strip).gsub(/\//, '%252F').gsub(/\+/, '%20');
|
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/#{
|
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').gsub(/\+/, '%20')}/0" : (first_command) ? "index.html\#//dash_ref_#{category_strip}/Command/#{URI.escape(first_command).gsub(/\//, '%252F').gsub(/\+/, '%20')}/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
|
data/lib/cheatset/dsl/entry.rb
CHANGED
@@ -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
|
@@ -69,7 +69,7 @@ code, pre {
|
|
69
69
|
font-size:13px;
|
70
70
|
}
|
71
71
|
|
72
|
-
code {
|
72
|
+
code {
|
73
73
|
margin:0;
|
74
74
|
border:1px solid #ddd;
|
75
75
|
background-color:#f8f8f8;
|
@@ -119,6 +119,14 @@ section.notes {
|
|
119
119
|
article {
|
120
120
|
margin: 2em 1em;
|
121
121
|
}
|
122
|
+
|
123
|
+
@media print {
|
124
|
+
section.category {
|
125
|
+
page-break-inside: avoid;
|
126
|
+
break-inside: avoid;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
122
130
|
section.category {
|
123
131
|
border: 2px solid $dark_gray;
|
124
132
|
border-radius: 6px 6px;
|
@@ -145,7 +153,7 @@ td {
|
|
145
153
|
}
|
146
154
|
th {
|
147
155
|
border-left:1px solid $lighter_gray;
|
148
|
-
}
|
156
|
+
}
|
149
157
|
tr {
|
150
158
|
border-bottom:1px dotted $lighter_gray;
|
151
159
|
}
|
@@ -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
|
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.4.
|
4
|
+
version: 1.4.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bogdan Popescu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '0'
|
206
206
|
requirements: []
|
207
|
-
rubygems_version: 3.0.1
|
207
|
+
rubygems_version: 3.0.3.1
|
208
208
|
signing_key:
|
209
209
|
specification_version: 4
|
210
210
|
summary: Generate cheat sheets for Dash
|