dasheets 0.0.1 → 0.0.2

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,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- NjJjMWNkOTYwMzU1N2Q5ZTZiMGYxYzE3NGVhMDk2OWM0NjNjOTAzNA==
5
- data.tar.gz: !binary |-
6
- NDliZTI5ODcwOGRmNjVlNjc5NjYyNGU3ODcyMTAzMWU2MDIzYTZlNA==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- OTM2YmFiMGI0MTczOWQzOTMxNWQzOGUxNDI1ZjAwZDdiMDZmMWU2ZDgzZTlk
10
- ZWFiNWFmMGNlNzgzZDA1NTk5YjZiZjkwOGJmMTI4ZTA4M2I1OTU4N2YwMzUy
11
- NTJhMTdjNzk2NWRmNjg3ZDA5MDU3MDE1NDI3MWRhOTIzNGQ2Y2M=
12
- data.tar.gz: !binary |-
13
- ZmNlOGY4Y2FjYjFlZGFiNDk5N2E2YWZmOGUxNzkzZDJmNGM5ZmZmZGZjN2Jh
14
- ZmYxNjcyYzAxNjdhMGJkYzNlYWU4Njc5MGRmZmQ3OTVlNzQ4NGQwNDYzODRj
15
- OGYyZGUyNDFjZTllOGVjZjcyYTM3YTg3ZGUyZDgwNmMwOTRmNjY=
2
+ SHA1:
3
+ metadata.gz: 62b108dde9128cfabd4d010435fde4a59112ed8a
4
+ data.tar.gz: c15937f60fe7ff9d2292969895ef551059b6c0f9
5
+ SHA512:
6
+ metadata.gz: be969821c53733a94677b70dc1584afaad22448ecbc803d14d5147c1d865f08a44825e166cfe54bf6deff56f975365019baf2eaee7b00e0c153ef06a48dbd472
7
+ data.tar.gz: 20d90d53c701d30dfcd18f28198ed55c41f2b41b52b38fecb65de9f906ee36d1ea348a444cecf495ca4bd67ab9bbd7c473d125ee36164f65ea22c324e2af71a0
data/TODO CHANGED
@@ -1,5 +1,5 @@
1
1
  TODO
2
2
  * Better documentation, more examples, ...
3
- * Render nice HTML
3
+ * Even nicer HTML ;-)
4
4
  * Icon
5
- * minidown
5
+ * http://badge.fury.io/for/rb/dasheets
data/dasheets.gemspec CHANGED
@@ -25,4 +25,5 @@ Gem::Specification.new do |spec|
25
25
  spec.add_dependency 'haml', '~> 4.0.3'
26
26
  spec.add_dependency 'sqlite3', '~> 1.3.8'
27
27
  spec.add_dependency 'plist', '~> 3.1.0'
28
+ spec.add_dependency 'minidown', '~> 1.0.0'
28
29
  end
@@ -17,5 +17,12 @@ class Dasheets::DSL::Cheatsheet
17
17
  @short_name = s if s
18
18
  @short_name
19
19
  end
20
+ def introduction(i = nil)
21
+ @introduction = Minidown.parse(i).to_html if i
22
+ @introduction
23
+ end
24
+ def notes(n = nil)
25
+ @notes = Minidown.parse(n).to_html if n
26
+ @notes
27
+ end
20
28
  end
21
-
@@ -1,9 +1,15 @@
1
+ require 'minidown'
2
+
3
+ # TODO: Refactor Minidown usage?
4
+
1
5
  class Dasheets::DSL::Entry
2
6
  def initialize(&block)
3
7
  instance_eval(&block)
4
8
  end
5
9
  def name(name = nil)
6
- @name = name if name
10
+ if name
11
+ @name = Minidown.parse(name).to_html
12
+ end
7
13
  @name
8
14
  end
9
15
  def command(c = nil)
@@ -11,7 +17,9 @@ class Dasheets::DSL::Entry
11
17
  @command
12
18
  end
13
19
  def notes(n = nil)
14
- @notes = n if n
20
+ if n
21
+ @notes = Minidown.parse(n).to_html
22
+ end
15
23
  @notes
16
24
  end
17
25
  end
@@ -1,16 +1,10 @@
1
- /* wkhmtmltopdf needs true-type fonts */
2
- @font-face {
3
- font-family: 'Open Sans';
4
- font-style: normal;
5
- font-weight: 400;
6
- src: url(http://themes.googleusercontent.com/static/fonts/opensans/v6/cJZKeOuBrn4kERxqtaUH3aCWcynf_cDxXwCLxiixG1c.ttf) format('truetype');
7
- }
8
- @font-face {
9
- font-family: 'Droid Sans Mono';
10
- font-style: normal;
11
- font-weight: 400;
12
- src: url(http://themes.googleusercontent.com/static/fonts/droidsansmono/v4/ns-m2xQYezAtqh7ai59hJYW_AySPyikQrZReizgrnuw.ttf) format('truetype');
13
- }
1
+ /*
2
+ #050405
3
+ #041F38
4
+ #1C4E70
5
+ #40738F
6
+ #E8F0F8
7
+ */
14
8
 
15
9
  h1, h2, h3, p, blockquote {
16
10
  margin: 0;
@@ -18,20 +12,46 @@ h1, h2, h3, p, blockquote {
18
12
  }
19
13
  body {
20
14
  font-family: 'Open Sans', sans-serif;
21
- font-size: 10px;
22
- line-height: 13px;
23
- color: black;
24
- background-color: white;
25
- margin: 10px 13px;
15
+ font-size: 14px;
16
+ line-height: 1.5em;
17
+ color: #050405;
18
+ background-color: #E8F0F8;
19
+ margin: 0;
20
+ }
21
+
22
+ header {
23
+ color: #E8F0F8;
24
+ background-color: #041F38;
25
+ padding: 1em;
26
+ }
27
+ article {
28
+ margin: 1em;
29
+ }
30
+ footer {
31
+ margin: 1em;
32
+ background-color: #1C4E70;
33
+ color: #E8F0F8;
34
+ padding: .5em;
35
+ border-radius: .5em;
36
+ text-align: center;
26
37
  }
38
+ footer a {
39
+ color: #E8F0F8;
40
+ }
41
+
27
42
  table {
28
- margin: 10px 0 15px 0;
29
43
  border-collapse: collapse;
30
- font-size: 10px;
44
+ border: 2px solid #40738F;
45
+ border-radius: 10px;
46
+ margin-bottom: .1em;
47
+ width: 100%;
31
48
  }
49
+
32
50
  td, th {
33
- border: 1px solid #ddd;
34
- padding: 1px 10px;
51
+ padding: .1em .1em 2em .1em;
52
+ }
53
+ td.command {
54
+ min-width: 25%;
35
55
  }
36
56
 
37
57
  a {
@@ -41,34 +61,33 @@ p {
41
61
  margin-bottom: 9px;
42
62
  }
43
63
  h1, h2, h3 {
44
- color: #404040;
45
64
  line-height: 36px;
65
+ margin: 1em 0 .5em 0;
46
66
  }
47
67
  h1 {
48
- margin-bottom: 18px;
49
- font-size: 30px;
68
+ font-family: Lobster, sans-serif;
69
+ font-size: 48px;
50
70
  }
51
71
  h2 {
52
72
  font-size: 24px;
53
73
  }
54
74
  h3 {
55
- font-size: 18px;
75
+ font-size: 1.2em;
56
76
  }
57
77
 
58
78
  code, pre {
59
- font-family: 'Droid Sans Mono', monospace;
79
+ font-family: 'Droid Sans Mono', monospace;
60
80
  }
61
81
  code {
62
- background-color: #fee9cc;
63
- color: black;
64
- padding: 1px 3px;
65
- font-size: 10px;
66
- -webkit-border-radius: 3px;
67
- -moz-border-radius: 3px;
68
- border-radius: 3px;
69
- }
70
- table, pre {
71
- page-break-inside: avoid;
82
+ background-color: #40738F;
83
+ color: #E8F0F8;
84
+ padding: .1em .3em;
85
+ border-radius: .5em;
86
+ font-size: 1.5em;
72
87
  }
73
88
 
89
+ th {
90
+ color: #E8F0F8;
91
+ background-color: #40738F;
92
+ }
74
93
 
@@ -3,20 +3,31 @@
3
3
  %head
4
4
  %meta{charset: 'utf-8'}
5
5
  %title= title
6
+ %link{href: 'http://fonts.googleapis.com/css?family=Droid+Sans+Mono|Lobster|Open+Sans',
7
+ rel: 'stylesheet', type: 'text/css'}
6
8
  %link{rel: 'stylesheet', href: 'style.css'}
7
9
  %body
10
+ %header
11
+ %h1= title
8
12
 
9
- %h1= title
10
- - categories.each do |category|
11
- %h2= category.id
12
- %table
13
- %tr
14
- %th command
15
- %th name
16
- %th notes
17
- - category.entries.each_with_index do |entry, index|
18
- %tr{id: "#{category.id}-#{index}"}
19
- %td
20
- %code= entry.command
21
- %td= entry.name
22
- %td= entry.notes
13
+ %article
14
+ %p= introduction
15
+
16
+ - categories.each do |category|
17
+ %table
18
+ %tr
19
+ %th{colspan: 2}
20
+ %h2= category.id
21
+ - category.entries.each_with_index do |entry, index|
22
+ %tr{id: "#{category.id}-#{index}"}
23
+ %td.command
24
+ %code= entry.command
25
+ %td
26
+ %h3= entry.name
27
+ %div= entry.notes
28
+ - if notes
29
+ %h2 Notes
30
+ = notes
31
+ %footer
32
+ Generated with
33
+ %a{href: 'https://github.com/Nix-wie-weg/dasheets'} Dasheets
@@ -1,3 +1,3 @@
1
1
  module Dasheets
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/dasheets.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'dasheets/version'
2
+ require 'minidown'
2
3
 
3
4
  module Dasheets
4
5
  module DSL
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dasheets
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Dütsch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-27 00:00:00.000000000 Z
11
+ date: 2013-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -28,28 +28,28 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - '>='
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>='
38
+ - - '>='
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: thor
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - '>='
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - '>='
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
96
  version: 3.1.0
97
+ - !ruby/object:Gem::Dependency
98
+ name: minidown
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ~>
102
+ - !ruby/object:Gem::Version
103
+ version: 1.0.0
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ~>
109
+ - !ruby/object:Gem::Version
110
+ version: 1.0.0
97
111
  description: Generate cheatsheets for Dash
98
112
  email:
99
113
  - florian.duetsch@nix-wie-weg.de
@@ -131,17 +145,17 @@ require_paths:
131
145
  - lib
132
146
  required_ruby_version: !ruby/object:Gem::Requirement
133
147
  requirements:
134
- - - ! '>='
148
+ - - '>='
135
149
  - !ruby/object:Gem::Version
136
150
  version: '0'
137
151
  required_rubygems_version: !ruby/object:Gem::Requirement
138
152
  requirements:
139
- - - ! '>='
153
+ - - '>='
140
154
  - !ruby/object:Gem::Version
141
155
  version: '0'
142
156
  requirements: []
143
157
  rubyforge_project:
144
- rubygems_version: 2.0.7
158
+ rubygems_version: 2.0.6
145
159
  signing_key:
146
160
  specification_version: 4
147
161
  summary: Generate cheatsheets for Dash