webby 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- # $Id: file_spec.rb 1 2007-08-18 21:39:50Z tim_pease $
1
+ # $Id: file_spec.rb 46 2007-11-27 03:31:29Z tim_pease $
2
2
 
3
3
  require 'spec/spec_helper.rb'
4
4
  require 'fileutils'
@@ -95,7 +95,6 @@ describe Webby::File do
95
95
  fd.readline.should == LINES.first; fd.seek 0
96
96
  fd.readlines.should == LINES; fd.seek 0
97
97
  fd.readpartial(11).should == 'Lorem ipsum'; fd.seek 0
98
- fd.sysread(11).should == 'Lorem ipsum'; fd.seek 0
99
98
 
100
99
  ensure
101
100
  fd.close
data/website/Rakefile CHANGED
@@ -10,4 +10,6 @@ task :deploy => [:build, 'deploy:rsync']
10
10
  SITE.host = 'tim_pease@rubyforge.org'
11
11
  SITE.remote_dir = '/var/www/gforge-projects/webby/'
12
12
 
13
+ task :autobuild => :growl
14
+
13
15
  # EOF
@@ -0,0 +1,111 @@
1
+ .CodeRay {
2
+ padding: 0.5em;
3
+ margin-bottom: 1.3em;
4
+ background-color: #eee;
5
+ border: 1px solid #aaa;
6
+ font: 1.1em Monaco, 'Courier New', 'Terminal', monospace;
7
+ color: #100;
8
+ }
9
+ .CodeRay pre {
10
+ padding: 0px;
11
+ margin: 0px;
12
+ overflow: auto;
13
+ background-color: transparent;
14
+ border: none;
15
+ }
16
+
17
+ div.CodeRay { }
18
+
19
+ span.CodeRay { white-space: pre; border: 0px; padding: 2px }
20
+
21
+ table.CodeRay { border-collapse: collapse; width: 100%; padding: 2px }
22
+ table.CodeRay td { padding: 2px 4px; vertical-align: top }
23
+
24
+ .CodeRay .line_numbers, .CodeRay .no {
25
+ background-color: #def;
26
+ color: gray;
27
+ text-align: right;
28
+ }
29
+ .CodeRay .line_numbers tt { font-weight: bold }
30
+ .CodeRay .no { padding: 0px 4px }
31
+
32
+ ol.CodeRay { font-size: 10pt }
33
+ ol.CodeRay li { white-space: pre }
34
+
35
+ .CodeRay .debug { color:white ! important; background:blue ! important; }
36
+
37
+ .CodeRay .af { color:#00C }
38
+ .CodeRay .an { color:#007 }
39
+ .CodeRay .av { color:#700 }
40
+ .CodeRay .aw { color:#C00 }
41
+ .CodeRay .bi { color:#509; font-weight:bold }
42
+ .CodeRay .c { color:#666; }
43
+
44
+ .CodeRay .ch { color:#04D }
45
+ .CodeRay .ch .k { color:#04D }
46
+ .CodeRay .ch .dl { color:#039 }
47
+
48
+ .CodeRay .cl { color:#B06; font-weight:bold }
49
+ .CodeRay .co { color:#036; font-weight:bold }
50
+ .CodeRay .cr { color:#0A0 }
51
+ .CodeRay .cv { color:#369 }
52
+ .CodeRay .df { color:#099; font-weight:bold }
53
+ .CodeRay .di { color:#088; font-weight:bold }
54
+ .CodeRay .dl { color:black }
55
+ .CodeRay .do { color:#970 }
56
+ .CodeRay .ds { color:#D42; font-weight:bold }
57
+ .CodeRay .e { color:#666; font-weight:bold }
58
+ .CodeRay .en { color:#800; font-weight:bold }
59
+ .CodeRay .er { color:#F00; background-color:#FAA }
60
+ .CodeRay .ex { color:#F00; font-weight:bold }
61
+ .CodeRay .fl { color:#60E; font-weight:bold }
62
+ .CodeRay .fu { color:#06B; font-weight:bold }
63
+ .CodeRay .gv { color:#d70; font-weight:bold }
64
+ .CodeRay .hx { color:#058; font-weight:bold }
65
+ .CodeRay .i { color:#00D; font-weight:bold }
66
+ .CodeRay .ic { color:#B44; font-weight:bold }
67
+
68
+ .CodeRay .il { background: #eee }
69
+ .CodeRay .il .il { background: #ddd }
70
+ .CodeRay .il .il .il { background: #ccc }
71
+ .CodeRay .il .idl { font-weight: bold; color: #888 }
72
+
73
+ .CodeRay .in { color:#B2B; font-weight:bold }
74
+ .CodeRay .iv { color:#33B }
75
+ .CodeRay .la { color:#970; font-weight:bold }
76
+ .CodeRay .lv { color:#963 }
77
+ .CodeRay .oc { color:#40E; font-weight:bold }
78
+ .CodeRay .of { color:#000; font-weight:bold }
79
+ .CodeRay .op { }
80
+ .CodeRay .pc { color:#038; font-weight:bold }
81
+ .CodeRay .pd { color:#369; font-weight:bold }
82
+ .CodeRay .pp { color:#579 }
83
+ .CodeRay .pt { color:#339; font-weight:bold }
84
+ .CodeRay .r { color:#080; font-weight:bold }
85
+
86
+ .CodeRay .rx { background-color:#fff0ff }
87
+ .CodeRay .rx .k { color:#808 }
88
+ .CodeRay .rx .dl { color:#404 }
89
+ .CodeRay .rx .mod { color:#C2C }
90
+ .CodeRay .rx .fu { color:#404; font-weight: bold }
91
+
92
+ .CodeRay .s { background-color:#fff0f0 }
93
+ .CodeRay .s .s { background-color:#ffe0e0 }
94
+ .CodeRay .s .s .s { background-color:#ffd0d0 }
95
+ .CodeRay .s .k { color:#D20 }
96
+ .CodeRay .s .dl { color:#710 }
97
+
98
+ .CodeRay .sh { background-color:#f0fff0 }
99
+ .CodeRay .sh .k { color:#2B2 }
100
+ .CodeRay .sh .dl { color:#161 }
101
+
102
+ .CodeRay .sy { color:#A60 }
103
+ .CodeRay .sy .k { color:#A60 }
104
+ .CodeRay .sy .dl { color:#630 }
105
+
106
+ .CodeRay .ta { color:#070 }
107
+ .CodeRay .tf { color:#070; font-weight:bold }
108
+ .CodeRay .ts { color:#D70; font-weight:bold }
109
+ .CodeRay .ty { color:#339; font-weight:bold }
110
+ .CodeRay .v { color:#036 }
111
+ .CodeRay .xt { color:#444 }
@@ -1,33 +1,129 @@
1
+ ---
2
+ extension: css
3
+ filter: sass
4
+ layout: nil # no layout
5
+ sass_options:
6
+ :style: :expanded
7
+ ---
8
+ !text = #000
9
+ !border = #DDD
10
+ !header = #333
11
+ !link = #125AA7
12
+ !link_hover = #000
13
+ !blockquote = #666
14
+ !code = #000
15
+ !box_bg = #F8F8F8
16
+ !highlight = #B2CCFF
17
+ !quiet = #666
18
+ !alt = #666
1
19
 
2
- body { margin: 1.0em 0 }
20
+ body
21
+ :margin 1.5em 0
22
+ :color = !text
23
+ :font-family Verdana, sans-serif
3
24
 
4
- #header hr { margin-bottom: 0.5em; height: 0.3em; }
25
+ // Headings
26
+ // ------------------------------------------------------------------------
27
+ h1,h2,h3,h4,h5,h6
28
+ :color = !header
29
+ :font-family Georgia, serif
5
30
 
6
- #navigation { text-align: center; margin-left: 0; font-size: 1.5em; list-style-type: none; }
7
- #navigation li { display:inline; padding-right: 0.5em; }
8
- #navigation li a { padding-right: 0.5em; }
31
+ // Text Elements
32
+ // ------------------------------------------------------------------------
33
+ a
34
+ :color = !link
35
+ &:hover
36
+ :color = !link_hover
37
+ blockquote
38
+ :color = !blockquote
9
39
 
40
+ pre
41
+ :background = !box_bg
42
+ :border none
43
+ :border-left = 7px solid !border
10
44
 
11
- #footer hr { margin-bottom: 0.5em }
12
- #footer p { text-align: right }
45
+ hr
46
+ :background = !highlight
47
+ :color = !highlight
13
48
 
14
- pre.code {
15
- padding: 0.5em;
16
- margin-bottom: 1.3em;
17
- color: #100;
18
- background-color: #eee;
19
- border: 1px solid #aaa;
20
- font: 1.1em Monaco, monospace;
21
- overflow: auto;
22
- }
49
+ // Tables
50
+ // ------------------------------------------------------------------------
51
+ table
52
+ :border-top = 1px solid !border
53
+ :border-left = 1px solid !border
54
+ th,td
55
+ :border-bottom = 1px solid !border
56
+ :border-right = 1px solid !border
23
57
 
24
- div.toc {
25
- float: right;
26
- padding: 1.5em;
27
- margin-left: 1.5em;
28
- margin-bottom: 1.5em;
29
- background-color: #b2ccff;
30
- border: 1px solid #aaa;
31
- }
58
+ // Default Classes
59
+ // ------------------------------------------------------------------------
60
+ p.quiet
61
+ :color = !quiet
62
+ .alt
63
+ :color = !alt
32
64
 
33
- div.toc ul { margin-bottom: 0; }
65
+ // My Site Stylings
66
+ // ------------------------------------------------------------------------
67
+ #header
68
+ :margin-bottom 1.7em
69
+ h1
70
+ :margin-bottom 0
71
+ :padding-bottom 0.2em
72
+ hr
73
+ :height 0.3em
74
+ :margin-bottom 0.5em
75
+
76
+ #navigation
77
+ :text-align center
78
+ :margin-left 0
79
+ :font-size 1.5em
80
+ :list-style-type none
81
+ li
82
+ :display inline
83
+ :padding-right 0.5em
84
+ a
85
+ :margin-right 0.5em
86
+ :padding 0 0.2em
87
+ :text-decoration none
88
+ &:hover
89
+ :background-color = !highlight
90
+
91
+ #footer
92
+ hr
93
+ :margin-bottom 0.5em
94
+ p
95
+ :text-align right
96
+
97
+ pre.code
98
+ :padding 0.5em
99
+ :margin-bottom 1.3em
100
+ :color = !code
101
+ :font 1.1em 'Courier New', 'Terminal', monospace
102
+ :overflow auto
103
+
104
+ .CodeRay
105
+ :border none
106
+ :border-left = 7px solid !border
107
+ :background = !box_bg
108
+ :color = !code
109
+ pre
110
+ :font 1.0em 'Courier New', 'Terminal', monospace
111
+
112
+ div.toc
113
+ :float right
114
+ :padding 1.5em
115
+ :margin-left 1.5em
116
+ :margin-bottom 1.5em
117
+ :background-color = !highlight
118
+ :border = 1px solid !border
119
+ ul
120
+ :margin-bottom 0
121
+
122
+ span.caps
123
+ :font-weight normal
124
+
125
+ strong
126
+ span.caps
127
+ :font-weight bold
128
+
129
+ // EOF
@@ -5,4 +5,10 @@ filter: textile
5
5
  ---
6
6
  h2. Download
7
7
 
8
- You can read more about textile "here":http://whytheluckystiff.net/ruby/redcloth/
8
+ Webby is available as a ruby gem. You need to have "RubyGems":http://www.rubygems.org/ installed in order to use it.
9
+
10
+ <pre class="code">
11
+ sudo gem install webby
12
+ </pre>
13
+
14
+ * "Files":http://rubyforge.org/frs/?group_id=4283
@@ -5,7 +5,7 @@ filter: textile
5
5
  ---
6
6
  *Webby* is a super fantastic little website management system. It would be called a _content management system_ if it were a bigger kid. But, it's just a runt with a special knack for transforming text. And that's really all it does - manages the legwork of turning text into something else, an *ASCII Alchemist* if you will.
7
7
 
8
- Webby works by combining the contents of a *page* with a *layout* to produce HTML. The layout contains everthing common to all the pages - HTML headers, navigation menu, footer, etc. - and the page contains just the information for that page. You can use your favorite markup language to write your pages; Webby supports quite a few.
8
+ Webby works by combining the contents of a *page* with a *layout* to produce HTML. The layout contains everything common to all the pages - HTML headers, navigation menu, footer, etc. - and the page contains just the information for that page. You can use your favorite markup language to write your pages; Webby supports quite a few.
9
9
 
10
10
  Install Webby and try it out!
11
11
 
@@ -13,7 +13,7 @@ Install Webby and try it out!
13
13
  gem install webby
14
14
  </pre>
15
15
 
16
- h3. Features
16
+ h2. Features
17
17
 
18
18
  * choose your templating language: *eRuby*, *Textile*, *Markdown*, *HAML*
19
19
  * support for "CodeRay":http://coderay.rubychan.de/ syntax highlighting
@@ -22,18 +22,16 @@ h3. Features
22
22
  * happy "rake":http://docs.rubyrake.org/ tasks for deploying your website to a server
23
23
  * build new pages from templates for quicker blog posts and news items
24
24
 
25
- h3. But Wait! There's More!
25
+ h2. But Wait! There's More!
26
26
 
27
- Webby has a great _autobuild_ feature that continously generates HTML whenever the *pages* or *layouts* change. The HTML is served up via "heel":http://copiousfreetime.rubyforge.org/heel/, a static file webserver based on mongrel. Whenever you change a page, you can immediately see those changes without having to run any commands.
27
+ Webby has a great _autobuild_ feature that continuously generates HTML whenever the *pages* or *layouts* change. The HTML is served up via "heel":http://copiousfreetime.rubyforge.org/heel/, a static file webserver based on mongrel. Whenever you change a page, you can immediately see those changes without having to run any commands.
28
28
 
29
29
  <pre class="code">
30
30
  $ rake autobuild
31
31
  heel --root output --daemonize
32
- -- starting autobuild (Ctrl-C to stop)
33
- - started at 10:21:26
34
- creating output/index.html
35
- - started at 10:22:57
36
- creating output/index.html
32
+ [10:21:26] INFO: starting autobuild (Ctrl-C to stop)
33
+ [10:21:26] INFO: creating output/index.html
34
+ [10:22:57] INFO: creating output/index.html
37
35
  </pre>
38
36
 
39
37
  Webby is not limited to producing HTML. By no means! Do you ever get tired of repeating the same color code *#D3C4A2* in your CSS files? Webby can help. Need some customized JavaScript for your website. Webby can help. Anytime you find yourself repeating the same bit of text over and over, then you should be using Webby.
@@ -8,3 +8,26 @@ filter:
8
8
  h2. To-Do
9
9
 
10
10
  The Webby user's manual goes here.
11
+
12
+ <notextile>
13
+ <coderay lang="ruby">
14
+ def method( blah )
15
+ blah.upcase
16
+ end
17
+ </coderay>
18
+ </notextile>
19
+
20
+ directory structure
21
+ * content
22
+ * output
23
+ * layouts
24
+ * templates
25
+ * lib
26
+ * tasks
27
+
28
+ resources
29
+
30
+ renderer
31
+
32
+ pages database
33
+
@@ -0,0 +1,6 @@
1
+ User-agent: *
2
+ Disallow: /softwaremap/ # This is an infinite virtual URL space
3
+ Disallow: /statcvs/ # This is an infinite virtual URL space
4
+ Disallow: /usage/ # This is an infinite virtual URL space
5
+ Disallow: /wiki/ # This is an infinite virtual URL space
6
+
@@ -11,7 +11,7 @@ h4. Table of Contents
11
11
 
12
12
  </div>
13
13
 
14
- h3(#toc_cr){clear:none}. CodeRay
14
+ h2(#toc_cr){clear:none}. CodeRay
15
15
 
16
16
  To include "CodeRay":http://coderay.rubychan.de/ syntax highlighting support in a page you need to have the @coderay@ gem installed, and you need to include the CodeRay stylesheet in your layout. The following example shows a page that uses CodeRay syntax highlighting combined with Textile markup.
17
17
 
@@ -25,7 +25,7 @@ filter:
25
25
  - coderay
26
26
  - textile
27
27
  ---
28
- h3. <%= h(@page.title) %>
28
+ h2. <%= h(@page.title) %>
29
29
 
30
30
  This is the @render_page@ function from the Webby static website generation
31
31
  system. It is used to render a page by applying the specified filters in
@@ -3,13 +3,13 @@ title: Tutorial
3
3
  created_at: Tue Aug 21 17:02:40 -0600 2007
4
4
  filter: textile
5
5
  ---
6
- h3. Require
6
+ h2. Require
7
7
 
8
8
  Webby has a family of friends that help it get it's job done. The command-line is where Webby lives and works. You should be comfortable with your terminal if you're going to get serious with Webby. Webby is built on top of "Ruby":http://www.ruby-lang.org/, and many of the templates use Ruby in one way or another. Learning a little bit about Ruby will make Webby far less intimidating.
9
9
 
10
10
  This tutorial requires *Ruby* to be installed as well as *Webby* and the "*RedCloth*":http://whytheluckystiff.net/ruby/redcloth/ templating engine. RedCloth provides support for the Textile markup language.
11
11
 
12
- h3. Create a Site
12
+ h2. Create a Site
13
13
 
14
14
  You need a catchy name for your website to survive in this Web 2.0 world. Webby is distinctly Web 1.0 (or maybe Web 0.5) so we'll use the name *my_site*.
15
15
 
@@ -29,7 +29,7 @@ tasks/
29
29
  templates/
30
30
  </pre>
31
31
 
32
- h3. Build Your Site
32
+ h2. Build Your Site
33
33
 
34
34
  What? Didn't we just do that?
35
35
 
@@ -43,7 +43,7 @@ Again, you will see lots of output scrolling across the screen. This is the rake
43
43
 
44
44
  Point your web browser to *my_site/output/index.html* to see what your new website looks like.
45
45
 
46
- h3. Making Changes
46
+ h2. Making Changes
47
47
 
48
48
  Of course _Lorem Ipsum_ is some great content, but if everyone posted their site in such a state the web would be a monochromatic smurf blue. Let's change that into something more creative, more us. Open the *content/index.rhtml* file in your favorite editor.
49
49
 
@@ -61,7 +61,7 @@ vestibulum libero. Aenean vitae justo. Nam eget tellus. Etiam convallis, est
61
61
  eu lobortis mattis, lectus tellus tempus felis, a ultricies erat ipsum at
62
62
  metus.
63
63
 
64
- h3. Litora Sociis
64
+ h2. Litora Sociis
65
65
  ...
66
66
  </pre>
67
67
 
@@ -85,7 +85,7 @@ Play around with making changes, running rake, and seeing your changes show up i
85
85
 
86
86
  bq. *TIP* You can simplify this whole process - modify content, rake, view in browser - by running @rake autobuild@ on the command line. This starts a build loop that compiles the content of your website as files change. All you need to do now is - modify content, view in browser.
87
87
 
88
- h3. Creating a Page
88
+ h2. Creating a Page
89
89
 
90
90
  Let's tell the world all about your new website. We'll create a new _about_ page that describes what this website is all about, who you are, and the answer to life, the universe, and everything.
91
91
 
@@ -95,7 +95,7 @@ rake create:page about
95
95
 
96
96
  The output from the command tells you that a new file has been created - @content/about.txt@. You can now edit this page, give it a title "About", and somewhere in there include _42_.
97
97
 
98
- h3. Change the Layout
98
+ h2. Change the Layout
99
99
 
100
100
  The next step is to change how the page looks. In fact, we want to change the appearance of all the pages in our website. This is easily by done by changing the website layout file in the _layouts_ folder. Open the *layouts/default.rhtml* file in your favorite editor.
101
101
 
@@ -123,7 +123,7 @@ We can see in the HTML header data that the page title will be set to the value
123
123
 
124
124
  Let's change the layout by removing the sidebar from every page. Find the sidebar div @<div class="column span-3 last">@. Delete that div, run rake to build the webiste again, and take a look at the site in your browser. You'll notice that both pages have been updated since both depend upon the default layout.
125
125
 
126
- h3. What Now?
126
+ h2. What Now?
127
127
 
128
128
  Let your creativity run wild!
129
129