hanna-nouveau 0.3.0 → 0.4.0
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/Gemfile +1 -0
- data/README.rdoc +14 -0
- data/VERSION +1 -1
- data/lib/hanna-nouveau.rb +39 -0
- data/lib/hanna-nouveau/template_files/styles.sass +13 -1
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5ced1825c89f3942fad828e81c77faf431779eb
|
4
|
+
data.tar.gz: 699b6b1f76859328db25deefc220714d00aca96b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1a6d6a77b822e044d6840bf2d21334617d77a2a3e17bc88e16f87f8168bbb15f104dbf34a194097dd6a0fe673bfd32126c265be81ec54b4919abd4e70d8fa2c
|
7
|
+
data.tar.gz: f832b5ab9f42e516627b5fdb6e8008a8732fc234a0891431a9cd445ef937bdfaefef6732b205a746d47590ae26d3e0cfb99d9b0c6c576cfdfb732212c0957756
|
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -79,3 +79,17 @@ library}[http://github.com/rdbi/rdbi/tree/master/Rakefile]:
|
|
79
79
|
rdoc.rdoc_files.include('README*')
|
80
80
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
81
81
|
end
|
82
|
+
|
83
|
+
== Modifications to RDoc
|
84
|
+
|
85
|
+
Hanna makes some small modifications to RDoc to generate more
|
86
|
+
friendly documentation. First, a real parser is used for all
|
87
|
+
verbatim sections, and any verbatim section that is valid ruby
|
88
|
+
code will be highlighted. This is different than the RDoc
|
89
|
+
default, which is to use a simple regexp with both false
|
90
|
+
positives and false negatives.
|
91
|
+
|
92
|
+
Second, label lists are marked using a table instead of a
|
93
|
+
description list, since it is very difficult to get visually
|
94
|
+
appealing styling for description lists without cutting
|
95
|
+
corners (like using fixed widths).
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.4.0
|
data/lib/hanna-nouveau.rb
CHANGED
@@ -16,6 +16,45 @@ require 'haml'
|
|
16
16
|
require 'sass'
|
17
17
|
require 'rdoc/rdoc'
|
18
18
|
require 'rdoc/generator'
|
19
|
+
require 'parser/current'
|
20
|
+
|
21
|
+
class RDoc::Markup::ToHtml
|
22
|
+
LIST_TYPE_TO_HTML[:LABEL] = ['<table class="rdoc-list label-list"><tbody>', '</tbody></table>']
|
23
|
+
LIST_TYPE_TO_HTML[:NOTE] = ['<table class="rdoc-list note-list"><tbody>', '</tbody></table>']
|
24
|
+
|
25
|
+
def list_item_start(list_item, list_type)
|
26
|
+
case list_type
|
27
|
+
when :BULLET, :LALPHA, :NUMBER, :UALPHA then
|
28
|
+
"<li>"
|
29
|
+
when :LABEL, :NOTE then
|
30
|
+
"<tr><td class='label'>#{Array(list_item.label).map{|label| to_html(label)}.join("<br />")}</td><td>"
|
31
|
+
else
|
32
|
+
raise RDoc::Error, "Invalid list type: #{list_type.inspect}"
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def list_end_for(list_type)
|
37
|
+
case list_type
|
38
|
+
when :BULLET, :LALPHA, :NUMBER, :UALPHA then
|
39
|
+
"</li>"
|
40
|
+
when :LABEL, :NOTE then
|
41
|
+
"</td></tr>"
|
42
|
+
else
|
43
|
+
raise RDoc::Error, "Invalid list type: #{list_type.inspect}"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def parseable? text
|
48
|
+
parser = Parser::CurrentRuby.new
|
49
|
+
parser.diagnostics.consumer = lambda{|d|}
|
50
|
+
buffer = Parser::Source::Buffer.new('(string)')
|
51
|
+
buffer.source = text
|
52
|
+
parser.parse(buffer)
|
53
|
+
true
|
54
|
+
rescue
|
55
|
+
false
|
56
|
+
end
|
57
|
+
end
|
19
58
|
|
20
59
|
class RDoc::Generator::Hanna
|
21
60
|
STYLE = 'styles.sass'
|
@@ -258,6 +258,18 @@ div.header
|
|
258
258
|
list-style: decimal
|
259
259
|
li
|
260
260
|
white-space: normal
|
261
|
+
table.rdoc-list
|
262
|
+
border-collapse: collapse
|
263
|
+
border-spacing: 0
|
264
|
+
tr
|
265
|
+
background-color: white
|
266
|
+
&:nth-child(2n)
|
267
|
+
background-color: #f8f8f8
|
268
|
+
td.label
|
269
|
+
font-weight: bold
|
270
|
+
td
|
271
|
+
border: 1px solid #ddd
|
272
|
+
padding: 6px 13px
|
261
273
|
|
262
274
|
#method-list
|
263
275
|
position: absolute
|
@@ -318,7 +330,7 @@ div.header
|
|
318
330
|
color: #eeeeee
|
319
331
|
background: $light_link
|
320
332
|
|
321
|
-
#content .method .source pre
|
333
|
+
#content .method .source pre, #content pre.ruby, #methods .method .description pre.ruby
|
322
334
|
background: #262626
|
323
335
|
color: #ffdead
|
324
336
|
margin: 1em
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hanna-nouveau
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Evans
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2014-
|
14
|
+
date: 2014-08-19 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: haml
|
@@ -41,6 +41,20 @@ dependencies:
|
|
41
41
|
- - "~>"
|
42
42
|
- !ruby/object:Gem::Version
|
43
43
|
version: '4.0'
|
44
|
+
- !ruby/object:Gem::Dependency
|
45
|
+
name: parser
|
46
|
+
requirement: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - "~>"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '2.0'
|
51
|
+
type: :runtime
|
52
|
+
prerelease: false
|
53
|
+
version_requirements: !ruby/object:Gem::Requirement
|
54
|
+
requirements:
|
55
|
+
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '2.0'
|
44
58
|
description: ''
|
45
59
|
email: code@jeremyevans.net
|
46
60
|
executables: []
|