zenweb 2.18.1 → 3.0.0.b1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. data.tar.gz.sig +0 -0
  2. data/.autotest +18 -0
  3. data/.gemtest +0 -0
  4. data/History.txt +6 -0
  5. data/Manifest.txt +52 -50
  6. data/README.txt +27 -22
  7. data/Rakefile +8 -9
  8. data/example-site/.isolate.rb +8 -0
  9. data/example-site/Rakefile +32 -0
  10. data/example-site/_config.yml +3 -0
  11. data/example-site/_includes/analytics.html.erb +11 -0
  12. data/example-site/_includes/header.html.erb +3 -0
  13. data/example-site/_includes/page_list_item.html +5 -0
  14. data/example-site/_includes/post_list_item.html +5 -0
  15. data/example-site/_layouts/post.erb +13 -0
  16. data/example-site/_layouts/project.erb +39 -0
  17. data/example-site/_layouts/site.erb +62 -0
  18. data/example-site/about/index.html.md +8 -0
  19. data/example-site/atom.xml.erb +43 -0
  20. data/example-site/blog/2012-01-02-page1.html.md +5 -0
  21. data/example-site/blog/2012-01-03-page2.html.md +5 -0
  22. data/example-site/blog/2012-01-04-page3.html.md +5 -0
  23. data/example-site/blog/_config.yml +1 -0
  24. data/example-site/blog/index.html.erb +19 -0
  25. data/example-site/config.ru +33 -0
  26. data/example-site/css/colors.css.less +71 -0
  27. data/example-site/css/styles.css +223 -0
  28. data/example-site/css/syntax.css +171 -0
  29. data/example-site/img/bg.png +0 -0
  30. data/example-site/index.html.erb +27 -0
  31. data/example-site/js/jquery.js +154 -0
  32. data/example-site/js/site.js +37 -0
  33. data/example-site/pages/index.html.erb +17 -0
  34. data/example-site/pages/nonblogpage.html.md +8 -0
  35. data/example-site/projects/index.html.erb +18 -0
  36. data/example-site/projects/zenweb.html.erb +9 -0
  37. data/example-site/sitemap.xml.erb +24 -0
  38. data/lib/zenweb.rb +12 -0
  39. data/lib/zenweb/config.rb +126 -0
  40. data/lib/zenweb/extensions.rb +51 -0
  41. data/lib/zenweb/page.rb +409 -0
  42. data/lib/zenweb/plugins/disqus.rb +18 -0
  43. data/lib/zenweb/plugins/erb.rb +43 -0
  44. data/lib/zenweb/plugins/google.rb +20 -0
  45. data/lib/zenweb/plugins/less.rb +10 -0
  46. data/lib/zenweb/plugins/markdown.rb +121 -0
  47. data/lib/zenweb/site.rb +237 -0
  48. data/lib/zenweb/tasks.rake +165 -0
  49. data/test/helper.rb +53 -0
  50. data/test/test_zenweb_config.rb +90 -0
  51. data/test/test_zenweb_extensions.rb +33 -0
  52. data/test/test_zenweb_page.rb +381 -0
  53. data/test/test_zenweb_plugins_disqus.rb +41 -0
  54. data/test/test_zenweb_plugins_erb.rb +60 -0
  55. data/test/test_zenweb_plugins_google.rb +38 -0
  56. data/test/test_zenweb_plugins_less.rb +33 -0
  57. data/test/test_zenweb_plugins_markdown.rb +227 -0
  58. data/test/test_zenweb_site.rb +294 -0
  59. metadata +230 -86
  60. metadata.gz.sig +0 -0
  61. data/bin/zenweb +0 -27
  62. data/bin/zenwebpage +0 -66
  63. data/bin/zenwebsite +0 -39
  64. data/design/REQUIREMENTS.txt +0 -52
  65. data/design/ZENWEB_2.txt +0 -69
  66. data/design/heirarchy.png +0 -0
  67. data/design/heirarchy.tgif +0 -311
  68. data/docs/Customizing +0 -76
  69. data/docs/FAQ +0 -12
  70. data/docs/Features +0 -128
  71. data/docs/Presentation +0 -88
  72. data/docs/QuickStart +0 -32
  73. data/docs/Renderers +0 -85
  74. data/docs/SiteMap +0 -13
  75. data/docs/YourOwnWebsite +0 -32
  76. data/docs/index +0 -14
  77. data/docs/metadata.txt +0 -10
  78. data/lib/ZenWeb.rb +0 -850
  79. data/lib/ZenWeb/CalendarRenderer.rb +0 -162
  80. data/lib/ZenWeb/CompactRenderer.rb +0 -45
  81. data/lib/ZenWeb/CompositeRenderer.rb +0 -63
  82. data/lib/ZenWeb/FileAttachmentRenderer.rb +0 -57
  83. data/lib/ZenWeb/FooterRenderer.rb +0 -38
  84. data/lib/ZenWeb/GenericRenderer.rb +0 -143
  85. data/lib/ZenWeb/HeaderRenderer.rb +0 -52
  86. data/lib/ZenWeb/HtmlRenderer.rb +0 -81
  87. data/lib/ZenWeb/HtmlTableRenderer.rb +0 -94
  88. data/lib/ZenWeb/HtmlTemplateRenderer.rb +0 -173
  89. data/lib/ZenWeb/MetadataRenderer.rb +0 -83
  90. data/lib/ZenWeb/RelativeRenderer.rb +0 -97
  91. data/lib/ZenWeb/RubyCodeRenderer.rb +0 -56
  92. data/lib/ZenWeb/SitemapRenderer.rb +0 -56
  93. data/lib/ZenWeb/StandardRenderer.rb +0 -40
  94. data/lib/ZenWeb/StupidRenderer.rb +0 -91
  95. data/lib/ZenWeb/SubpageRenderer.rb +0 -45
  96. data/lib/ZenWeb/TextToHtmlRenderer.rb +0 -219
  97. data/lib/ZenWeb/TocRenderer.rb +0 -60
  98. data/lib/ZenWeb/XXXRenderer.rb +0 -32
  99. data/test/SiteMap +0 -14
  100. data/test/Something +0 -4
  101. data/test/include.txt +0 -3
  102. data/test/index +0 -8
  103. data/test/metadata.txt +0 -10
  104. data/test/ryand/SiteMap +0 -10
  105. data/test/ryand/blah +0 -4
  106. data/test/ryand/blah-blah +0 -4
  107. data/test/ryand/index +0 -52
  108. data/test/ryand/metadata.txt +0 -2
  109. data/test/ryand/stuff/index +0 -4
  110. data/test/test_zenweb.rb +0 -1619
data/docs/Customizing DELETED
@@ -1,76 +0,0 @@
1
- # 'title' = 'Customizing'
2
- # 'subtitle' = 'Tweaking your site'
3
- # "description" = "Describes how to really customize ZenWeb to your liking."
4
-
5
- ** Starting Questions
6
-
7
- This document will attempt to show you how renderers work and how to
8
- create your own to make a website render the way you want it to.
9
-
10
- The first step is to decide that you really need to write code to do
11
- what you want to do. There is a chance that the software already does
12
- what you want. Take a look at what #{TextToHTML} options exist for
13
- you. If it is a style issue, it might be addressed by a variable
14
- listed there.
15
-
16
- If however, this is a structural issue (eg, you don't like the navbars
17
- provided by HtmlTemplateRenderer) then you'll probably have to write
18
- some code. If you think that your extension is generally useful,
19
- please email #{support} and tell me about it. I might be willing to
20
- write it for you if I get the chance to extend the capabilities of the
21
- system. That way everyone wins. But, if this is something specific to
22
- your site, and not terribly reusable, read on...
23
-
24
- The second step, assuming you get this far, is to decide if your
25
- change requires an extension to an existing renderer (eg, modify the
26
- navbar supplied by HtmlTemplateRenderer), or if it requires an
27
- entirely new renderer (eg, something like XsltRenderer).
28
-
29
- ** Extending an Existing Renderer
30
-
31
- Lets say you hate the navbar supplied by
32
- HtmlTemplateRenderer. Customizing it is pretty easy and involves these
33
- steps:
34
-
35
- + Copy XXXRenderer to MyHtmlTemplateRenderer.
36
- + Globally replace "XXX" with "MyHtmlTemplate".
37
- + Change the require statement from 'ZenWeb/GenericRenderer' to 'ZenWeb/HtmlTemplateRenderer'.
38
- + Change the superclass from 'GenericRenderer' to 'HtmlTemplateRenderer'.
39
- + Instead of defining 'render', change it to 'navbar'.
40
- + Write the code to return the type of navbar you want.
41
- + Fill in remaining "YYY" sections (mostly doco) w/ appropriate verbage.
42
-
43
- ** Writing a New Renderer
44
-
45
- Lets say you want to write XsltRenderer, not that I have a clue about
46
- XSLT... Creating a new renderer is fairly easy:
47
-
48
-
49
- + Copy XXXRenderer to XsltRenderer.
50
- + Globally replace "XXX" with "Xslt".
51
- + Define render. In this example, it might be difficult, but some of the renderers are dirt simple and small... Check them out for examples and help.
52
- + Fill in remaining "YYY" sections (mostly doco) w/ appropriate verbage.
53
-
54
- ** Renderer Requirements
55
-
56
- A renderer is dirt simple. It simply needs to define the method
57
- render, which takes an array of input, and returns an array of
58
- output. Other than that, you are free to do whatever you want.
59
-
60
- ** GenericRenderer Utilities
61
-
62
- GenericRenderer has a few utility methods. First, GenericRenderer
63
- instantiates an instance variable called @result. You need not use it
64
- at all, but the utility methods do. GenericRenderer also provides the
65
- following methods:
66
-
67
- + push(obj) - appends obj to @result. If obj is an array, it recursively calls push on each item in obj. If it is not an array, it calls to_s on it and pushes onto @result.
68
- + unshift(obj) - like push, but prepends.
69
-
70
- ** Other Notes:
71
-
72
- Other things to remember:
73
-
74
- + @document is the instance of the ZenDocument that you are rendering. url and subpages are useful methods of this class.
75
- + @sitemap is the instance of the ZenSiteMap for this site. documents or doc_order might be useful to you.
76
- + @website is the instance of the ZenWebsite for this site. Not too much useful here, that I've used anyway... It's mainly a manager class...
data/docs/FAQ DELETED
@@ -1,12 +0,0 @@
1
- # 'title' = 'Frequently Asked Questions'
2
- # "description" = "FAQ for ZenWeb"
3
- # "keywords" = "ZenWeb, FAQ"
4
-
5
- ** Dump it quick, organize later
6
-
7
- %- Q: I don't want to use ZenWeb for a whole domain, just a small portion of the website, but it keeps making absolute URLs that don't work well for this design. How can I use ZenWeb?
8
- %= A: Add RelativeRenderer to your list of renderers in your top level metadata.txt file. If you used ZenWebsite.rb to create your website, the entry should be there, otherwise add "'renderers' = [ 'StandardRenderer', 'RelativeRenderer' ]".
9
-
10
- %- Q: XXX
11
- %= A: YYY
12
-
data/docs/Features DELETED
@@ -1,128 +0,0 @@
1
- # 'title' = 'Features'
2
- # 'subtitle' = 'Markup and Variables'
3
- # "description" = "Demonstrates the various text-to-HTML embellishments in ZenWeb."
4
-
5
- This document will attempt to show you how many of the html markup features work.
6
-
7
- ** Markup:
8
-
9
- The only Head 1 is the title.
10
-
11
- ** Head 2
12
-
13
- *** Head 3
14
-
15
- **** Head 4
16
-
17
- ***** Head 5
18
-
19
- ****** Head 6
20
-
21
- creates:
22
-
23
- ** Head 2
24
-
25
- *** Head 3
26
-
27
- **** Head 4
28
-
29
- ***** Head 5
30
-
31
- ****** Head 6
32
-
33
- + Lists (should have two items).
34
- + Continuted Lists.
35
-
36
- creates:
37
-
38
- + Lists (should have two items).
39
- + Continuted Lists.
40
-
41
- + Another List (should have a sub list).
42
- + With a sub-list
43
- + http\://www.ZenSpider.com/ and mailto\:support@ZenSpider.com.
44
- + A glossary entry to #{Your Own Website} and #{support} (see metadata.txt for a hint).
45
-
46
- creates:
47
-
48
- + Another List (should have a sub list).
49
- + With a sub-list
50
- + http://www.ZenSpider.com/ and mailto:support@ZenSpider.com.
51
- + A glossary entry to #{Your Own Website} and #{support} (see metadata.txt for a hint).
52
-
53
- Paragraphs can contain http://www.ZenSpider.com/ and mailto:support@ZenSpider.com and they will automatically be converted. Rules are automatically converted as well...
54
-
55
- creates:
56
-
57
- Paragraphs can contain http://www.ZenSpider.com/ and mailto:support@ZenSpider.com and they will automatically be converted. Rules are automatically converted as well...
58
-
59
- Likewise, two lines side by side
60
- are considered one paragraph.
61
-
62
- creates:
63
-
64
- Likewise, two lines side by side
65
- are considered one paragraph.
66
-
67
- More Paragraphs with \<I\>Embedded HTML\</I\>.
68
- Same as More Paragraphs.
69
-
70
- creates:
71
-
72
- More Paragraphs with <I>Embedded HTML</I>.
73
- Same as More Paragraphs.
74
-
75
- ---
76
-
77
- creates:
78
-
79
- ---
80
-
81
- ===
82
-
83
- creates:
84
-
85
- ===
86
-
87
- ** Metadata Variables:
88
-
89
- Metadata variables can be defined in the page itself, or in any
90
- metadata.txt file in the directory tree. Scoping is from top down, so
91
- the lowest definition wins.
92
-
93
- Here is a list of the variables in use by HtmlTemplateRenderer:
94
-
95
- %- author
96
- %= added as a META tag if it exists, I suggest NOT putting your email in here.
97
- %- banner
98
- %= graphic at the top of the page, usually a logo
99
- %- bgcolor
100
- %= defaults to not being defined
101
- %- copyright
102
- %= added as a META tag if it exists.
103
- %- description
104
- %= added as a META tag if it exists
105
- %- dtd
106
- %= Doctype declaration of the document. (default: 'DTD HTML 4.0 Transitional')
107
- %- email
108
- %= used in a mailto in metadata
109
- %- keywords
110
- %= added as a META tag for search engines.
111
- %- rating
112
- %= added as a meta tag for filter services (default: 'general')
113
- %- stylesheet
114
- %= CSS stylesheet URL.
115
- %- style
116
- %= CSS code applied directly to the page. style and stylesheet are not mutually exclusive.
117
- %- subtitle
118
- %= Subtitle of document.
119
- %- title
120
- %= Title of document. (default: 'Unknown Title')
121
- %- charset
122
- %= Character encoding for the page.
123
- %- force
124
- %= Set to true (no quotes necessary) to force page to render every time.
125
-
126
- Additionally, HeaderRenderer and FooterRenderer use entries called
127
- 'header' and 'footer' respectively.
128
-
data/docs/Presentation DELETED
@@ -1,88 +0,0 @@
1
- # "title" = "Presentation"
2
- # "subtitle" = "For Talks on ZenWeb"
3
- # "keywords" = "ZenWeb, Presentation"
4
-
5
- ** Philosophy:
6
-
7
- The primary focus of ZenWeb is to improve the signal-to-noise ratio so
8
- that you can get work done and published quickly and easily. This
9
- means when I want to make a new mostly empty webpage, I should be able
10
- to do so and have it out on the web in about 30 seconds. Putting
11
- actual content out there shouldn't be much harder than typing in your
12
- favorite text editor and saving.
13
-
14
- A secondary focus of ZenWeb is that everything revolves around the
15
- sitemap. The sitemap determines the structure of the entire website
16
- and is used to determine what pages to render.
17
-
18
- ** Class Heirarchy:
19
-
20
- [see heirarchy.png]
21
-
22
- The class hierarchy is as simple as possible, with only 5 top level
23
- classes and 10 concrete renderers.
24
-
25
- ** Basic Design:
26
-
27
- [see heirarchy.png]
28
-
29
- Simple run:
30
-
31
- Website#new
32
- ZenSitemap#new
33
- parse sitemap
34
- foreach page listed
35
- ZenDocument#new
36
- foreach document in sitemap
37
- parent = doc.parenturl
38
- parent.addSubpage(doc)
39
- Website#renderSite
40
- foreach document in sitemap
41
- doc.render
42
-
43
- ** Metadata scoping:
44
-
45
- A Metadata instance is essentially just a multi-directory file-based
46
- hash. Child directories can have additional metadata that can override
47
- parent directory entries. In addition, files in a website can also
48
- define their own metadata.
49
-
50
- Metadata is used for a number of purposes from defining simple urls to
51
- make the text cleaner, to defining what renderers get triggered for a
52
- given page or sub-directory.
53
-
54
- ** Renderers:
55
-
56
- Renderers are basic filters, much like unix pipes. Each one should do
57
- one simple task taking an array of strings and returning an array of
58
- strings. Supplied renderers include:
59
-
60
- + GenericRenderer
61
- + CompositeRenderer
62
- + StandardRenderer
63
- + SitemapRenderer
64
- + HtmlRenderer
65
- + HtmlTemplateRenderer
66
- + TextToHtmlRenderer
67
- + SubpageRenderer
68
- + MetadataRenderer
69
- + HeaderRenderer
70
- + FooterRenderer
71
- + RubyCodeRenderer
72
-
73
- Future renderers could be much more powerful and do things like render
74
- themes based on the user prefs, render PDF instead of HTML,
75
- or... whatever...
76
-
77
- ** Iterative Builds:
78
-
79
- Last but not least, with large websites it becomes increasingly
80
- important not to waste time rendering pages that don't change. ZenWeb
81
- has basic 'make' like functionality and will not render pages that
82
- don't need it.
83
-
84
- Right now it's an incredibly simple mechanism. It doesn't understand
85
- the relationships between pages. It currently only renders pages who's
86
- source pages have changed, but not pages that link that page. This
87
- isn't very important as it only really has impact if the title or
88
- subtitle changes.
data/docs/QuickStart DELETED
@@ -1,32 +0,0 @@
1
- # "title" = "Installation Quickstart"
2
- # "subtitle" = "Quick guide to setting up ZenWeb"
3
- # "keywords" = "ZenWeb, instructions, Quick Start"
4
-
5
- ** Requirements:
6
-
7
- + ruby 1.6.x, may work w/ previous versions.
8
- + Test::Unit ruby package installed. Get from #{raa}.
9
- + Minimal understanding of Ruby:
10
- + You are _expected_ to understand Ruby minimally to build a site (installation and basic use). It isn't hard to install on either UNIX or the macintosh, I've never used it on windoze but I've been told it is fairly easy there as well.
11
- + You are expected to understand Ruby programming only if you want to customize site/page layout. This includes, navigation, headers and footers, and general page layout. The basic setup will look like http://www.zenspider.com/ otherwise.
12
-
13
- ** Instructions:
14
-
15
- + Unpack the package. You've probably already done this.
16
- + Test your ruby installation. Run 'irb':
17
- + At the prompt type "1+1" and make sure it outputs "2".
18
- + That states that, yes, you installed ruby correctly.
19
- + Run 'make test'.
20
- + If all is well, you should have zero errors listed after running all of the tests.
21
- + If not, email #{support}. I respond quickly to problems.
22
- + Run 'make docs'.
23
- + A new directory docshtml should now exist.
24
- + View docshtml in your browser.
25
- + If you have apache you can quickly serve these pages (on unix):
26
- + Run 'make apache'
27
- + a private httpd will fire up running on port 8080.
28
- + Otherwise, open the file directly in your browser
29
- + Read all the pages, but start with #{Your Own Website}.
30
-
31
- Any questions, flames, requests, whatever should be sent to
32
- #{support}. Thank you.
data/docs/Renderers DELETED
@@ -1,85 +0,0 @@
1
- # 'title' = 'Renderers'
2
- # 'subtitle' = 'Standard Filters for ZenWeb'
3
-
4
- ** FooterRenderer
5
-
6
- FooterRenderer inserts the contents of the metadata variable 'footer'
7
- at the end of the document OR in front of a close-HTML tag, whichever
8
- comes first.
9
-
10
- ** HeaderRenderer
11
-
12
- HeaderRenderer inserts the contents of the metadata variable 'header'
13
- at the end of the document OR following an open-HTML tag.
14
-
15
- ** HtmlTableRenderer
16
-
17
- An add-on that converts blocks delimited with \<tabs\>\</tabs\> and separated with tabs into an html table. Example:
18
-
19
- \<tabs\>
20
- a b c
21
- d bigger table cell f
22
- \</tabs\>
23
-
24
- becomes:
25
-
26
- <tabs>
27
- a b c
28
- d bigger table cell f
29
- </tabs>
30
-
31
- ** HtmlTemplateRenderer
32
-
33
- Is responsible for the overall structure of a page. It has a standard
34
- HTML header and footer (ie, html, head, and body tags), as well as
35
- some extra structure to the page like presenting the title and
36
- subtitle as an H1 and creating a top and bottom navbar. There are a
37
- lot of metadata variables available for customizing this renderer, see
38
- <!--hack-->#{Features} for more details.
39
-
40
- ** MetadataRenderer
41
-
42
- Expands metadata variable references of the form #\{varname} into the
43
- value associated to varname.
44
-
45
- ** RelativeRenderer
46
-
47
- Converts HREF urls to relative urls. Nice if you are not renderering
48
- the entire site.
49
-
50
- ** RubyCodeRenderer
51
-
52
- Evaluates blocks that are preceded with "!" characters and shows the
53
- code and the result together. NOTE: this feature is really weak and
54
- will require an overhaul to irb (read: not my code) to work properly.
55
-
56
- ** SitemapRenderer
57
-
58
- Renders sitemaps into lists of links.
59
-
60
- ** StandardRenderer
61
-
62
- A composite of a bunch of renderers. Provides a fairly standard
63
- feature-set.
64
-
65
- ** SubpageRenderer
66
-
67
- Adds links to sub-pages (pages below the current page in the site-map
68
- heirarchy).
69
-
70
- ** TextToHtmlRenderer
71
-
72
- Does a bizillion conversions from plain text to HTML. See
73
- <!--hack-->#{TextToHTML} for a full description.
74
-
75
- ** TocRenderer
76
-
77
- Generates and inserts a table-of-contents at the beginning of the
78
- documents. It is generated from the plain-text header (eg "**")
79
- entries.
80
-
81
- ** Abstract Renderers
82
-
83
- There are three other renderers not listed here, CompositeRenderer,
84
- GenericRenderer, and HtmlRenderer. These are abstract classes and are
85
- only of interest to you if you are #{customizing} ZenWeb.
data/docs/SiteMap DELETED
@@ -1,13 +0,0 @@
1
- # 'description' = 'This is the demo sitemap.'
2
- # 'keywords' = 'map, website, ZenWeb'
3
- # 'renderers' = ['SitemapRenderer', 'StandardRenderer' ]
4
-
5
- /index.html
6
- /SiteMap.html
7
- /QuickStart.html
8
- /YourOwnWebsite.html
9
- /Features.html
10
- /Renderers.html
11
- /Customizing.html
12
- /Presentation.html
13
- /FAQ.html
data/docs/YourOwnWebsite DELETED
@@ -1,32 +0,0 @@
1
- # "title" = "Your Own Website"
2
- # "subtitle" = "How to use ZenWeb"
3
- # "description" = "Quick guide to converting an existing website or creating a new one."
4
- # "keywords" = "ZenWeb, instructions, website creation"
5
-
6
- ZenWeb is supposed to be rather easy to use. This documentation site
7
- is intended to be a demonstration that it is easy. If this takes me
8
- more than 10 minutes to do (including typing these pages), then I have
9
- failed my job.
10
-
11
- ** How to make a site from scratch:
12
-
13
- + Run the following commands:
14
- + <CODE>ZenWebsite.rb mysite</CODE>
15
- + <CODE>cd mysite</CODE>
16
- + <CODE>ZenWebsite.rb data/second</CODE>
17
- + Edit data/SiteMap and put "/second.html" where you'd like it
18
- + <CODE>make</CODE>
19
- + Edit as you see fit.
20
- + See the #{TextToHTML} page for markup hints and tips.
21
-
22
- ** How to add a page to your site:
23
-
24
- + Modify mysite/SiteMap and add the url to the page, including .html, excluding the domain of the url (ex: "/blah.html").
25
- + Run the following commands:
26
- + <CODE>ZenWebpage.rb data/blah.html</CODE>
27
- + <CODE>make</CODE>
28
-
29
- ** How to convert an old site:
30
-
31
- + Do the same as the new site instructions, except:
32
- + For each file, remove your HTML header and footer code.