public
Rubygem
Description: A lightweight and flexible website management system.
Homepage: http://webby.rubyforge.org/
Clone URL: git://github.com/TwP/webby.git
creation of the outline filter
TwP (author)
Sat Feb 02 16:24:10 -0800 2008
commit  8154dcc2ea07cf3cedb79e9821323498721b851a
tree    dede22c185774524fc045fe39040c433668e1c15
parent  a8ac10c5003675d352fbd9b8e230d4898f0d7f4c
...
2
3
4
 
5
6
7
...
2
3
4
5
6
7
8
0
@@ -2,6 +2,7 @@
0
 
0
 * 2 minor enhancements
0
   - Created a URI base path rewriter filter
0
+ - Create an outline filter for generating table of contents
0
   - Pages can be created as files or as directories
0
 * 3 bug fixes
0
   - Fixed a bug in the graphviz filter where the wrong map ID was
...
67
68
69
 
70
71
72
...
87
88
89
 
90
91
92
...
67
68
69
70
71
72
73
...
88
89
90
91
92
93
94
0
@@ -67,6 +67,7 @@ lib/webby/filters/erb.rb
0
 lib/webby/filters/graphviz.rb
0
 lib/webby/filters/haml.rb
0
 lib/webby/filters/markdown.rb
0
+lib/webby/filters/outline.rb
0
 lib/webby/filters/sass.rb
0
 lib/webby/filters/textile.rb
0
 lib/webby/filters/tidy.rb
0
@@ -87,6 +88,7 @@ tasks/annotations.rake
0
 tasks/doc.rake
0
 tasks/gem.rake
0
 tasks/manifest.rake
0
+tasks/post_load.rake
0
 tasks/rubyforge.rake
0
 tasks/setup.rb
0
 tasks/spec.rake
...
34
35
36
 
37
38
...
34
35
36
37
38
39
0
@@ -34,5 +34,6 @@ depend_on 'heel'
0
 depend_on 'hpricot'
0
 depend_on 'logging', '0.6.1'
0
 depend_on 'rspec'
0
+depend_on 'RedCloth'
0
 
0
 # EOF
...
114
115
116
117
118
119
120
121
 
 
 
 
122
 
 
 
123
124
125
126
127
128
 
129
130
131
...
114
115
116
 
 
117
 
 
118
119
120
121
122
123
124
125
126
127
128
129
130
 
131
132
133
134
0
@@ -114,18 +114,21 @@ div.toc
0
   :margin-bottom 16px
0
   :background-color = !highlight
0
   :border = 1px solid !border
0
- ul
0
- :margin-bottom 0
0
   ol
0
- :margin-bottom 0
0
- h4
0
+ :margin-bottom 0.5em
0
+ ol
0
+ :margin-bottom 0
0
+ p.title
0
     :margin-bottom 0.25em
0
+ :font-weight bold
0
+ :font-size 1.2em
0
+ :text-align center
0
 
0
 ul
0
   ul
0
     :margin-bottom 0
0
 
0
-span.num
0
+span.heading-num
0
   :margin-right 10px
0
 
0
 p.fn
...
6
7
8
 
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
 
38
 
39
40
41
 
42
43
 
44
45
46
47
48
49
50
 
51
52
53
...
68
69
70
71
 
72
73
 
74
75
76
...
82
83
84
85
 
86
87
88
...
119
120
121
122
 
123
124
125
...
145
146
147
148
 
149
150
151
152
 
153
154
155
...
187
188
189
190
 
191
192
193
194
195
196
 
197
198
199
...
219
220
221
222
 
223
224
225
...
241
242
243
244
 
245
246
247
...
261
262
263
264
 
265
266
267
...
283
284
285
286
 
287
288
289
...
323
324
325
326
 
327
328
329
...
359
360
361
362
 
363
364
365
...
386
387
388
389
 
390
391
392
...
410
411
412
413
 
414
...
6
7
8
9
10
 
 
 
 
 
 
11
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
14
15
16
17
 
18
19
 
20
21
22
23
24
25
26
 
27
28
29
30
...
45
46
47
 
48
49
 
50
51
52
53
...
59
60
61
 
62
63
64
65
...
96
97
98
 
99
100
101
102
...
122
123
124
 
125
126
127
128
 
129
130
131
132
...
164
165
166
 
167
168
169
170
171
172
 
173
174
175
176
...
196
197
198
 
199
200
201
202
...
218
219
220
 
221
222
223
224
...
238
239
240
 
241
242
243
244
...
260
261
262
 
263
264
265
266
...
300
301
302
 
303
304
305
306
...
336
337
338
 
339
340
341
342
...
363
364
365
 
366
367
368
369
...
387
388
389
 
390
391
0
@@ -6,48 +6,25 @@ filter:
0
   - graphviz
0
   - coderay
0
   - textile
0
+ - outline
0
 ---
0
-<notextile><script type="text/javascript">
0
- $(function(){
0
- $('div.toc').corner("br tl round 22px");
0
- });
0
-</script></notextile>
0
-
0
 <div class="toc push-1">
0
 
0
-h4(#toc). Table of Contents
0
-
0
-# "Getting Started":#gettingstarted
0
-## "Installation":#installation
0
-## "New Website":#newwebsite
0
-# "Working With Resources":#workingwithresources
0
-## "Pages":#pages
0
-### "Page Attributes":#pageattributes
0
-### "Page Filters":#pagefilters
0
-## "Layouts":#layouts
0
-# "Filters":#filters
0
-## "ERB":#erbfilter
0
-## "Textile":#textile
0
-## "Markdown":#markdown
0
-## "HAML & SASS":#hamlsass
0
-## "CodeRay":#coderay
0
-## "Graphviz":#graphviz
0
-## "BasePath":#basepath
0
-## "Tidy":#tidy
0
-# "Using Rake":#usingrake
0
+p(title). Table of Contents
0
 
0
+<toc />
0
 </div>
0
 
0
-h2(#gettingstarted){clear:none}. Getting Started
0
+h2{clear:none}. Getting Started
0
 
0
-h3(#requirements){clear:none}. Requirements
0
+h3{clear:none}. Requirements
0
 
0
 Webby is an application written using the Ruby programming language. To install and run Webby you will need the following applications on your system:
0
 
0
 * "Ruby":http://ruby-lang.org
0
 * "RubyGems":http://rubygems.org/read/chapter/3
0
 
0
-h3(#installation){clear:none}. Installation
0
+h3{clear:none}. Installation
0
 
0
 Webby is an application written using the Ruby programming language. You will need to install a Ruby interpreter on your computer. Download and installation instructions can be found on the "Ruby":http://ruby-lang.org website. For the Windows platform, the one-click installer is recommended. Webby is not compatible with the Ruby 1.9.0 release; please use the Ruby 1.8.6 release.
0
 
0
@@ -68,9 +45,9 @@ sudo gem install -y haml
0
 sudo gem install -y coderay
0
 </pre>
0
 
0
-h3(#newwebsite). New Website
0
+h3. New Website
0
 
0
-h2(#workingwithresources). %(num)2% Working With Resources
0
+h2. Working With Resources
0
 
0
 A resource is any file that is found in the _content_ or _layouts_ folders. Resources are either copied to the output folder or they are processed through the Webby filter engine to generate an output file. Resources fall into one of three types:
0
 
0
@@ -82,7 +59,7 @@ Files are the simplest resource to handle. They are copied, unchanged, from the
0
 
0
 Files will only be found in the _content_ folder. The _layouts_ folder is reserved solely for layouts.
0
 
0
-h3(#pages). %(num)2.1% Pages
0
+h3(#pages). Pages
0
 
0
 Pages are found in the _content_ folder along with regular files. Pages contain *meta-data* at the top of the file; this is what differentiates a page from a regular file. The meta-data is a section of "YAML":http://www.yaml.org/spec/1.1/ formatted text that describes various properties and attributes of the page. These attributes are used by Webby to determine how the page will be processed by the filter engine.
0
 
0
@@ -119,7 +96,7 @@ You can see that the value of the @title@ attribute was substituted for the ERB
0
 
0
 The last attribute in the meta-data section is the @filter@ attribute. The value for this attribute is a list of filters that will be applied to the page contents. The filters will be applied in the order they are specified. For the example page this would be the ERB filter followed by the Textile filter.
0
 
0
-h4(#pageattributes). %(num)2.1.1% Page Attributes
0
+h4. Page Attributes
0
 
0
 Attribute identifiers cannot contain spaces; they must be separated from their values by a colon. Other than that, you are free to define as many attributes as you like. Aside from defining values that can be rendered into a page, attributes are also used to find other pages in the site. Finding and linking to other pages is discussed in the "ERB Filter":#erbfilter section.
0
 
0
@@ -145,11 +122,11 @@ The following attributes are defined for each page in the content folder. These
0
 * *url* -- A URL suitable for creating a link to the page
0
 * *render* -- Returns the contents of the page as rendered by the Webby filter engine
0
 
0
-h4(#pagefilters). %(num)2.1.2% Page Filters
0
+h4. Page Filters
0
 
0
 Filters operate on the content of a page by transforming the text of the content section according to the rules of the individual filter. Some filters transform simplified markup into true HTML syntax; examples of these are the Textile filter and the Markdown filter. Other filters create images from text in the page (Graphviz filter) or apply syntax highlighting to the text (CodeRay filter). All the filters are discussed in detail in the "Filters":#filters section of this document.
0
 
0
-h3(#layouts). %(num)2.2% Layouts
0
+h3. Layouts
0
 
0
 Layouts provide the basic framework for a page -- the header, the footer, the navigation. They provide a consistent look and feel across all pages in the website. Individual pages contain just the content for that particular page.
0
 
0
@@ -187,13 +164,13 @@ The example above shows a very simple layout. The content for the current page b
0
 
0
 Along with the @@content@ variable, all the attributes of the current page being rendered are also accessible in the layout. The page title is inserted into the HTML title tags. But again, any page attribute can be accessed within the layout via the @@page@ variable.
0
 
0
-h2(#filters). %(num)3% Filters
0
+h2(#filters). Filters
0
 
0
 Filters are used in Webby to transform the text of pages and layouts. The filters applied to a page are defined in the meta-data of the page. The filters are used to transform different parts of the page contents resulting in HTML syntax, images, highlighted code, etc. Filters apply equally to pages and to layouts -- that is, pages and layouts are treated in the same manner by filters.
0
 
0
 This section will look at the various filters provided by Webby, what those filters do, and how they should be used. Enjoy!
0
 
0
-h3(#erbfilter). %(num)3.1% ERB
0
+h3(#erbfilter). ERB
0
 
0
 "ERB":http://ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html provides an easy to use but powerful templating system for Ruby. Using ERB, Ruby code can be added to any plain text document for the purposes of generating document information details and/or flow control. Much of the functionality Webby has to offer is made available through the erb filter. ERB does not place any limitations on the content of the page, so it is recommended to use the erb filter with another filter that simplifies the HTML markup -- Textile is my favorite, but Markdown and HAML support are provided in Webby, as well. Chose the markup language that suits your style.
0
 
0
@@ -219,7 +196,7 @@ p(column span-2). *Require*:
0
 
0
 p(column span-13). none
0
 
0
-h3(#textile). %(num)3.2% Textile
0
+h3. Textile
0
 
0
 "Textile":http://en.wikipedia.org/wiki/Textile_%28markup_language%29 is a lightweight markup language originally developed by Dean Allen and billed as a "humane Web text generator". The textile filter converts Textile formatted text into valid, well-formed XHTML.
0
 
0
@@ -241,7 +218,7 @@ p(column span-13). The @RedCloth@ gem must be installed on your system in order
0
 
0
 fn1(fn){clear:both}. Please don't ask. Why is very smart, he wrote the Ruby code that handles Textile markup, and the code is very solid. Enjoy the benefits of his work.
0
 
0
-h3(#markdown). %(num)3.3% Markdown
0
+h3. Markdown
0
 
0
 "Markdown":http://daringfireball.net/projects/markdown/ is a lightweight markup language created by John Gruber. It allows you to write using an easy-to-read, easy-to-write plain text format. From the Markdown web page:
0
 
0
@@ -261,7 +238,7 @@ p(column span-2). *Require*:
0
 
0
 p(column span-13). The @BlueCloth@ gem must be installed on your system in order to use the markdown filter.
0
 
0
-h3(#hamlsass). %(num)3.4% HAML & SASS
0
+h3. HAML & SASS
0
 
0
 "HAML":http://haml.hamptoncatlin.com/ is a markup language created by Hampton Catlin that's used to cleanly and simply describe the XHTML of any web document without the use of inline code. SASS is the equivalent for CSS documents. From the HAML website:
0
 
0
@@ -283,7 +260,7 @@ p(column span-2). *Require*:
0
 
0
 p(column span-13). The @haml@ gem must be installed on your system in order to use the haml filter or the sass filter.
0
 
0
-h3(#coderay). %(num)3.5% CodeRay
0
+h3. CodeRay
0
 
0
 "CodeRay":http://coderay.rubychan.de/ is a Ruby library that provides syntax highlighting for various types of source code. The coderay filter takes a portion of the page contents and runs it through the CodeRay syntax highlighter, and pretty, colored XHTML is inserted into the page. The end result is that you can embed code into a page, and the coderay filter will convert that code into valid XHTML.
0
 
0
@@ -323,7 +300,7 @@ p(column span-2). *Require*:
0
 
0
 p(column span-13). The @coderay@ gem must be installed on your system in order to use the coderay filter. Be sure to include the coderay stylesheet in your layout.
0
 
0
-h3(#graphviz). %(num)3.6% Graphviz
0
+h3. Graphviz
0
 
0
 "Graphviz":http://www.graphviz.org/ is open source graph visualization software. Graph visualization is a way of representing structural information as diagrams of abstract graphs and networks. The Graphviz layout programs take descriptions of graphs in a simple text language, and make diagrams in several useful formats. The graphviz filter allows you to embed Graphviz scripts into a page and generate an image in the page.
0
 
0
@@ -359,7 +336,7 @@ p(column span-2). *Require*:
0
 
0
 p(column span-13). The Graphviz application must be installed on your system, and the Graphviz executables must be available on the path.
0
 
0
-h3(#basepath). %(num)3.7% BasePath
0
+h3. BasePath
0
 
0
 The basepath filter is used to rewrite the base path location for all URLs in a page. This is useful for the times when the publish location of the website is no at the root of the web server -- @http://your.website.com/path/to/your/site@ for example. This allows pages and resources (images, javascript, stylesheets, etc.) to be referenced from the root of the Webby web server for easy development, but the paths of these resources can easily be changed by the basepath filter when the website is being deployed.
0
 
0
@@ -386,7 +363,7 @@ p(column span-2). *Require*:
0
 
0
 p(column span-13). none
0
 
0
-h3(#tidy). %(num)3.8% Tidy
0
+h3. Tidy
0
 
0
 "Tidy":http://www.w3.org/People/Raggett/tidy/ is a useful application for cleaning up and detecting errors in XHTML text. The tidy filter will run your XHTML code through the tidy program and report any errors in the build log. From the HTML Tidy website:
0
 
0
@@ -410,5 +387,5 @@ p(column span-2). *Require*:
0
 
0
 p(column span-13). The HTML Tidy application must be installed on your system, and the @tidy@ executable must be available on the path.
0
 
0
-h2(#usingrake). Using Rake
0
+h2. Using Rake
0
 

Comments

    No one has commented yet.