hoe-manualgen 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/Rakefile +6 -4
- data/data/hoe-manualgen/lib/api-filter.rb +1 -1
- data/data/hoe-manualgen/lib/editorial-filter.rb +1 -1
- data/data/hoe-manualgen/lib/examples-filter.rb +1 -1
- data/data/hoe-manualgen/lib/links-filter.rb +1 -1
- data/data/hoe-manualgen/resources/css/manual.css.erb +21 -12
- data/lib/hoe/manualgen.rb +48 -47
- metadata +51 -38
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/Rakefile
CHANGED
@@ -23,12 +23,13 @@ hoespec = Hoe.spec 'hoe-manualgen' do
|
|
23
23
|
self.developer 'Michael Granger', 'ged@FaerieMUD.org'
|
24
24
|
|
25
25
|
self.extra_deps.push *{
|
26
|
-
'
|
27
|
-
'
|
26
|
+
'hoe' => "~> #{Hoe::VERSION[/^\d+\.\d+/]}",
|
27
|
+
'RedCloth' => '~> 4.2',
|
28
|
+
'rcodetools' => '~> 0.8',
|
28
29
|
}
|
29
30
|
self.extra_dev_deps.push *{
|
30
|
-
'rspec' => '~> 2.4
|
31
|
-
'tidy-ext' => '~> 0.1
|
31
|
+
'rspec' => '~> 2.4',
|
32
|
+
'tidy-ext' => '~> 0.1',
|
32
33
|
}
|
33
34
|
|
34
35
|
self.spec_extras[:licenses] = ["BSD"]
|
@@ -38,6 +39,7 @@ hoespec = Hoe.spec 'hoe-manualgen' do
|
|
38
39
|
|
39
40
|
self.hg_sign_tags = true if self.respond_to?( :hg_sign_tags= )
|
40
41
|
|
42
|
+
self.extra_rdoc_files += Dir.glob( 'data/hoe-manualgen/lib/*.rb' )
|
41
43
|
self.rdoc_locations << "deveiate:/usr/local/www/public/code/#{remote_rdoc_dir}"
|
42
44
|
end
|
43
45
|
|
@@ -16,7 +16,7 @@
|
|
16
16
|
### <?api Class::Name ?>
|
17
17
|
### <?api "click here":Class::Name ?>
|
18
18
|
###
|
19
|
-
class Hoe::ManualGen::APIFilter < Hoe::ManualGen::
|
19
|
+
class Hoe::ManualGen::APIFilter < Hoe::ManualGen::PageFilter
|
20
20
|
|
21
21
|
# PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
|
22
22
|
ApiPI = %r{
|
@@ -17,7 +17,7 @@
|
|
17
17
|
### <?ed "This is an editor's note." ?>
|
18
18
|
### <?ed verify:"this content needs checking or verification" ?>
|
19
19
|
###
|
20
|
-
class Hoe::ManualGen::EditorialFilter < Hoe::ManualGen::
|
20
|
+
class Hoe::ManualGen::EditorialFilter < Hoe::ManualGen::PageFilter
|
21
21
|
|
22
22
|
# PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
|
23
23
|
LinkPI = %r{
|
@@ -32,7 +32,7 @@
|
|
32
32
|
### any errors to the output.
|
33
33
|
### caption::
|
34
34
|
### A small blurb to put below the pulled-out example in the HTML.
|
35
|
-
class Hoe::ManualGen::ExamplesFilter < Hoe::ManualGen::
|
35
|
+
class Hoe::ManualGen::ExamplesFilter < Hoe::ManualGen::PageFilter
|
36
36
|
|
37
37
|
DEFAULTS = {
|
38
38
|
:language => :ruby,
|
@@ -31,7 +31,7 @@
|
|
31
31
|
### The second form links to a page by its path relative to the base manual source directory.
|
32
32
|
### Again, the link text defaults to the page title, or can be overriden via a prepended string,
|
33
33
|
### and you can link into a page with an appended ID.
|
34
|
-
class Hoe::ManualGen::LinksFilter < Hoe::ManualGen::
|
34
|
+
class Hoe::ManualGen::LinksFilter < Hoe::ManualGen::PageFilter
|
35
35
|
|
36
36
|
# PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
|
37
37
|
LinkPI = %r{
|
@@ -69,14 +69,22 @@ h1 {
|
|
69
69
|
}
|
70
70
|
|
71
71
|
h2 {
|
72
|
+
margin-top: 1em;
|
72
73
|
font-size: 2em;
|
73
74
|
font-weight: bold;
|
74
75
|
}
|
75
76
|
|
76
77
|
h3 {
|
78
|
+
margin-top: 1em;
|
77
79
|
font-size: 1.5em;
|
80
|
+
font-weight: bold;
|
81
|
+
}
|
82
|
+
h4 {
|
83
|
+
margin-top: 1em;
|
84
|
+
font-size: 1.25em;
|
78
85
|
}
|
79
86
|
|
87
|
+
|
80
88
|
p {
|
81
89
|
margin: 0;
|
82
90
|
}
|
@@ -86,30 +94,26 @@ p + ol {
|
|
86
94
|
margin-top: 1em;
|
87
95
|
}
|
88
96
|
|
89
|
-
p + h2,
|
90
|
-
p + h3 {
|
91
|
-
margin-top: 1em;
|
92
|
-
}
|
93
|
-
|
94
97
|
li {
|
95
98
|
list-style: disc;
|
96
99
|
margin: 0.5em 1.2em
|
97
100
|
}
|
98
101
|
|
102
|
+
pre {
|
103
|
+
margin: 1em 0;
|
104
|
+
}
|
99
105
|
code, pre {
|
106
|
+
background-color: rgba(179,179,179,0.4);
|
100
107
|
font-family: Inconsolata, monospace;
|
101
108
|
}
|
102
109
|
|
103
|
-
code {
|
104
|
-
background-color: rgba(179,179,179,0.4);
|
105
|
-
}
|
106
110
|
|
107
111
|
dl {
|
108
112
|
margin: 0.5em 0;
|
109
|
-
padding: 0
|
113
|
+
padding: 0;
|
110
114
|
}
|
111
115
|
dt {
|
112
|
-
padding: 0 0.
|
116
|
+
padding: 0 0.75em;
|
113
117
|
border-top-left-radius: 0.5em;
|
114
118
|
border-top-right-radius: 0.5em;
|
115
119
|
background: -webkit-gradient(radial,
|
@@ -124,7 +128,7 @@ dt {
|
|
124
128
|
#cecece);
|
125
129
|
}
|
126
130
|
dd {
|
127
|
-
padding: 0 0.
|
131
|
+
padding: 0 0.75em;
|
128
132
|
border-bottom-left-radius: 0.5em;
|
129
133
|
border-bottom-right-radius: 0.5em;
|
130
134
|
margin-left: 0;
|
@@ -230,6 +234,11 @@ aside#sidebar nav {
|
|
230
234
|
section#content {
|
231
235
|
padding: 0;
|
232
236
|
}
|
237
|
+
section#content > h2 {
|
238
|
+
margin-top: 0;
|
239
|
+
}
|
240
|
+
section#content h4 {
|
241
|
+
}
|
233
242
|
|
234
243
|
#page > footer {
|
235
244
|
color: #444;
|
@@ -461,7 +470,7 @@ div.callout.caution-callout {
|
|
461
470
|
|
462
471
|
.syntaxhighlighter {
|
463
472
|
width: 100%;
|
464
|
-
margin: 1em 0
|
473
|
+
margin: 1em 0 0 0;
|
465
474
|
position: relative;
|
466
475
|
overflow: auto;
|
467
476
|
font-size: 1em;
|
data/lib/hoe/manualgen.rb
CHANGED
@@ -31,10 +31,10 @@ module Hoe::ManualGen
|
|
31
31
|
include FileUtils::DryRun if Rake.application.options.dryrun
|
32
32
|
|
33
33
|
# Library version constant
|
34
|
-
VERSION = '0.0
|
34
|
+
VERSION = '0.1.0'
|
35
35
|
|
36
36
|
# Version-control revision constant
|
37
|
-
REVISION = %q$Revision:
|
37
|
+
REVISION = %q$Revision: 0d6137980766 $
|
38
38
|
|
39
39
|
# Configuration defaults
|
40
40
|
DEFAULT_BASE_DIR = Pathname( 'manual' )
|
@@ -63,47 +63,9 @@ module Hoe::ManualGen
|
|
63
63
|
### Manual page-generation class
|
64
64
|
class Page
|
65
65
|
|
66
|
-
### An abstract filter class for manual content transformation.
|
67
|
-
class Filter
|
68
|
-
include Singleton
|
69
|
-
|
70
|
-
# A list of inheriting classes, keyed by normalized name
|
71
|
-
@derivatives = {}
|
72
|
-
class << self; attr_reader :derivatives; end
|
73
|
-
|
74
|
-
### Inheritance callback -- keep track of all inheriting classes for
|
75
|
-
### later.
|
76
|
-
def self::inherited( subclass )
|
77
|
-
key = subclass.name.
|
78
|
-
sub( /^.*::/, '' ).
|
79
|
-
gsub( /[^[:alpha:]]+/, '_' ).
|
80
|
-
downcase.
|
81
|
-
sub( /filter$/, '' )
|
82
|
-
|
83
|
-
self.derivatives[ key ] = subclass
|
84
|
-
self.derivatives[ key.to_sym ] = subclass
|
85
|
-
|
86
|
-
super
|
87
|
-
end
|
88
|
-
|
89
|
-
|
90
|
-
### Export any static resources required by this filter to the given +output_dir+.
|
91
|
-
def export_resources( output_dir )
|
92
|
-
# No-op by default
|
93
|
-
end
|
94
|
-
|
95
|
-
|
96
|
-
### Process the +page+'s source with the filter and return the altered content.
|
97
|
-
def process( source, page, metadata )
|
98
|
-
raise NotImplementedError,
|
99
|
-
"%s does not implement the #process method" % [ self.class.name ]
|
100
|
-
end
|
101
|
-
end # class Filter
|
102
|
-
|
103
|
-
|
104
66
|
### The default page configuration if none is specified.
|
105
67
|
DEFAULT_CONFIG = {
|
106
|
-
'filters' => [ 'erb', '
|
68
|
+
'filters' => [ 'erb', 'textile' ],
|
107
69
|
'layout' => 'default.erb',
|
108
70
|
'cleanup' => false,
|
109
71
|
}.freeze
|
@@ -260,8 +222,8 @@ module Hoe::ManualGen
|
|
260
222
|
def load_filters( filterlist )
|
261
223
|
filterlist.flatten.collect do |key|
|
262
224
|
raise ArgumentError, "filter '#{key}' could not be loaded" unless
|
263
|
-
|
264
|
-
|
225
|
+
Hoe::ManualGen::PageFilter.derivatives.key?( key )
|
226
|
+
Hoe::ManualGen::PageFilter.derivatives[ key ].instance
|
265
227
|
end
|
266
228
|
end
|
267
229
|
|
@@ -499,8 +461,47 @@ module Hoe::ManualGen
|
|
499
461
|
end
|
500
462
|
|
501
463
|
|
464
|
+
### An abstract filter class for manual content transformation.
|
465
|
+
class PageFilter
|
466
|
+
include Singleton
|
467
|
+
|
468
|
+
# A list of inheriting classes, keyed by normalized name
|
469
|
+
@derivatives = {}
|
470
|
+
class << self; attr_reader :derivatives; end
|
471
|
+
|
472
|
+
### Inheritance callback -- keep track of all inheriting classes for
|
473
|
+
### later.
|
474
|
+
def self::inherited( subclass )
|
475
|
+
key = subclass.name.
|
476
|
+
sub( /^.*::/, '' ).
|
477
|
+
gsub( /[^[:alpha:]]+/, '_' ).
|
478
|
+
downcase.
|
479
|
+
sub( /filter$/, '' )
|
480
|
+
|
481
|
+
self.derivatives[ key ] = subclass
|
482
|
+
self.derivatives[ key.to_sym ] = subclass
|
483
|
+
|
484
|
+
super
|
485
|
+
end
|
486
|
+
|
487
|
+
|
488
|
+
### Export any static resources required by this filter to the given +output_dir+.
|
489
|
+
def export_resources( output_dir )
|
490
|
+
# No-op by default
|
491
|
+
end
|
492
|
+
|
493
|
+
|
494
|
+
### Process the +page+'s source with the filter and return the altered content.
|
495
|
+
def process( source, page, metadata )
|
496
|
+
raise NotImplementedError,
|
497
|
+
"%s does not implement the #process method" % [ self.class.name ]
|
498
|
+
end
|
499
|
+
|
500
|
+
end # class Hoe::ManualGen::PageFilter
|
501
|
+
|
502
|
+
|
502
503
|
### A Textile filter for the manual generation tasklib.
|
503
|
-
class TextileFilter <
|
504
|
+
class TextileFilter < Hoe::ManualGen::PageFilter
|
504
505
|
|
505
506
|
### Load RedCloth when the filter is first created
|
506
507
|
def initialize( *args )
|
@@ -518,11 +519,11 @@ module Hoe::ManualGen
|
|
518
519
|
return formatter.to_html
|
519
520
|
end
|
520
521
|
|
521
|
-
end
|
522
|
+
end # class Hoe::ManualGen::TextileFilter
|
522
523
|
|
523
524
|
|
524
525
|
### An ERB filter.
|
525
|
-
class ErbFilter <
|
526
|
+
class ErbFilter < Hoe::ManualGen::PageFilter
|
526
527
|
|
527
528
|
### Process the given +source+ as ERB and return the resulting HTML
|
528
529
|
### fragment.
|
@@ -532,7 +533,7 @@ module Hoe::ManualGen
|
|
532
533
|
return template.result( binding() )
|
533
534
|
end
|
534
535
|
|
535
|
-
end
|
536
|
+
end # class Hoe::ManualGen::ErbFilter
|
536
537
|
|
537
538
|
|
538
539
|
attr_accessor :manual_template_dir,
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hoe-manualgen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
- 0
|
9
8
|
- 1
|
10
|
-
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Granger
|
@@ -35,29 +35,43 @@ cert_chain:
|
|
35
35
|
cmlhXe46pZNJgWKbxZah85jIjx95hR8vOI+NAM5iH9kOqK13DrxacTKPhqj5PjwF
|
36
36
|
-----END CERTIFICATE-----
|
37
37
|
|
38
|
-
date: 2011-
|
38
|
+
date: 2011-03-16 00:00:00 -07:00
|
39
39
|
default_executable:
|
40
40
|
dependencies:
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: hoe
|
43
43
|
prerelease: false
|
44
44
|
requirement: &id001 !ruby/object:Gem::Requirement
|
45
45
|
none: false
|
46
46
|
requirements:
|
47
47
|
- - ~>
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
hash:
|
49
|
+
hash: 17
|
50
50
|
segments:
|
51
|
-
- 4
|
52
51
|
- 2
|
53
|
-
-
|
54
|
-
version:
|
52
|
+
- 9
|
53
|
+
version: "2.9"
|
55
54
|
type: :runtime
|
56
55
|
version_requirements: *id001
|
57
56
|
- !ruby/object:Gem::Dependency
|
58
|
-
name:
|
57
|
+
name: RedCloth
|
59
58
|
prerelease: false
|
60
59
|
requirement: &id002 !ruby/object:Gem::Requirement
|
60
|
+
none: false
|
61
|
+
requirements:
|
62
|
+
- - ~>
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
hash: 31
|
65
|
+
segments:
|
66
|
+
- 4
|
67
|
+
- 2
|
68
|
+
version: "4.2"
|
69
|
+
type: :runtime
|
70
|
+
version_requirements: *id002
|
71
|
+
- !ruby/object:Gem::Dependency
|
72
|
+
name: rcodetools
|
73
|
+
prerelease: false
|
74
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
61
75
|
none: false
|
62
76
|
requirements:
|
63
77
|
- - ~>
|
@@ -66,75 +80,71 @@ dependencies:
|
|
66
80
|
segments:
|
67
81
|
- 0
|
68
82
|
- 8
|
69
|
-
|
70
|
-
- 0
|
71
|
-
version: 0.8.5.0
|
83
|
+
version: "0.8"
|
72
84
|
type: :runtime
|
73
|
-
version_requirements: *
|
85
|
+
version_requirements: *id003
|
74
86
|
- !ruby/object:Gem::Dependency
|
75
87
|
name: hoe-mercurial
|
76
88
|
prerelease: false
|
77
|
-
requirement: &
|
89
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
78
90
|
none: false
|
79
91
|
requirements:
|
80
92
|
- - ~>
|
81
93
|
- !ruby/object:Gem::Version
|
82
|
-
hash:
|
94
|
+
hash: 29
|
83
95
|
segments:
|
84
96
|
- 1
|
85
97
|
- 2
|
86
|
-
-
|
87
|
-
version: 1.2.
|
98
|
+
- 1
|
99
|
+
version: 1.2.1
|
88
100
|
type: :development
|
89
|
-
version_requirements: *
|
101
|
+
version_requirements: *id004
|
90
102
|
- !ruby/object:Gem::Dependency
|
91
103
|
name: tidy-ext
|
92
104
|
prerelease: false
|
93
|
-
requirement: &
|
105
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
94
106
|
none: false
|
95
107
|
requirements:
|
96
108
|
- - ~>
|
97
109
|
- !ruby/object:Gem::Version
|
98
|
-
hash:
|
110
|
+
hash: 9
|
99
111
|
segments:
|
100
112
|
- 0
|
101
113
|
- 1
|
102
|
-
|
103
|
-
version: 0.1.10
|
114
|
+
version: "0.1"
|
104
115
|
type: :development
|
105
|
-
version_requirements: *
|
116
|
+
version_requirements: *id005
|
106
117
|
- !ruby/object:Gem::Dependency
|
107
118
|
name: rspec
|
108
119
|
prerelease: false
|
109
|
-
requirement: &
|
120
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
110
121
|
none: false
|
111
122
|
requirements:
|
112
123
|
- - ~>
|
113
124
|
- !ruby/object:Gem::Version
|
114
|
-
hash:
|
125
|
+
hash: 11
|
115
126
|
segments:
|
116
127
|
- 2
|
117
128
|
- 4
|
118
|
-
|
119
|
-
version: 2.4.0
|
129
|
+
version: "2.4"
|
120
130
|
type: :development
|
121
|
-
version_requirements: *
|
131
|
+
version_requirements: *id006
|
122
132
|
- !ruby/object:Gem::Dependency
|
123
133
|
name: hoe
|
124
134
|
prerelease: false
|
125
|
-
requirement: &
|
135
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
126
136
|
none: false
|
127
137
|
requirements:
|
128
138
|
- - ">="
|
129
139
|
- !ruby/object:Gem::Version
|
130
|
-
hash:
|
140
|
+
hash: 41
|
131
141
|
segments:
|
132
142
|
- 2
|
133
|
-
-
|
134
|
-
-
|
135
|
-
version: 2.
|
143
|
+
- 9
|
144
|
+
- 1
|
145
|
+
version: 2.9.1
|
136
146
|
type: :development
|
137
|
-
version_requirements: *
|
147
|
+
version_requirements: *id007
|
138
148
|
description: |-
|
139
149
|
A manual-generation plugin for Hoe.
|
140
150
|
|
@@ -148,8 +158,11 @@ executables: []
|
|
148
158
|
|
149
159
|
extensions: []
|
150
160
|
|
151
|
-
extra_rdoc_files:
|
152
|
-
|
161
|
+
extra_rdoc_files:
|
162
|
+
- data/hoe-manualgen/lib/api-filter.rb
|
163
|
+
- data/hoe-manualgen/lib/editorial-filter.rb
|
164
|
+
- data/hoe-manualgen/lib/examples-filter.rb
|
165
|
+
- data/hoe-manualgen/lib/links-filter.rb
|
153
166
|
files:
|
154
167
|
- .autotest
|
155
168
|
- History.md
|
@@ -222,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
222
235
|
requirements: []
|
223
236
|
|
224
237
|
rubyforge_project: hoe-manualgen
|
225
|
-
rubygems_version: 1.
|
238
|
+
rubygems_version: 1.6.2
|
226
239
|
signing_key:
|
227
240
|
specification_version: 3
|
228
241
|
summary: A manual-generation plugin for Hoe
|
metadata.gz.sig
CHANGED
Binary file
|