Permalink
Browse files

Move meta to var. [admin]

  • Loading branch information...
trans committed Nov 12, 2011
1 parent 2cb882a commit 09879fd7a4b65df8f264fc8dde8e2822becf873f
View
@@ -4,9 +4,7 @@ doc
log
man/man1/*.1
man/man1/*.1.html
-pages
pkg
tmp
-site
+web
work/sandbox
-QED.rdoc
View
4 .ruby
@@ -1,6 +1,6 @@
---
source:
-- meta
+- var
authors:
- name: Thomas Sawyer
email: transfire@gmail.com
@@ -45,4 +45,4 @@ description: ! "XOXO is a Ruby XOXO parser and generator. It provides a Ruby API
a simple, open outline\nformat written in standard XHTML and suitable for embedding
in\n(X)HTML, Atom, RSS, and arbitrary XML."
organization: rubyworks
-date: '2011-10-26'
+date: '2011-11-11'
View
@@ -8,23 +8,25 @@ gem:
active: true
github:
- folder: pages
+ gh_pages: web
qed:
- files: qed/
+ files: qed
qedoc:
- files: qed/
+ files: qed
title: XOXO Demonstrandum
output: QED.rdoc
dnote:
- output: log/NOTES.rdoc
+ title: Source Notes
+ output: log/notes.html
vclog:
output:
- - log/Chages.rdoc
- - log/History.rdoc
+ - log/change.html
+ - log/history.html
+
#rubyforge:
# service : Forge
View
@@ -0,0 +1,97 @@
+= to_xoxo
+
+Any object can be serialized as an XOXO document easily with the #to_xoxo
+method.
+
+== String
+
+ "This is an example".to_xoxo
+
+serializes to:
+
+ <ol class="xoxo">
+ <li>This is an example</li>
+ </ol>
+
+== Array
+
+ ["one", "two", "three"].to_xoxo
+
+serializes to:
+
+ <ol class="xoxo">
+ <li>one</li>
+ <li>two</li>
+ <li>three</li>
+ </ol>
+
+== Hash
+
+ {"one"=>1, "two"=>2, "three"=>3}.to_xoxo
+
+With some implementations of Ruby Hash order is not preserved. So,
+
+ @_.assert.include?('<ol class="xoxo">')
+ @_.assert.include?('<dt>one</dt><dd>1</dd>')
+ @_.assert.include?('<dt>two</dt><dd>2</dd>')
+ @_.assert.include?('<dt>three</dt><dd>3</dd>')
+
+It would otherwise look like this:
+
+ <ol class="xoxo">
+ <li>
+ <dl>
+ <dt>a</dt><dd>1</dd>
+ <dt>b</dt><dd>2</dd>
+ <dt>c</dt><dd>3</dd>
+ </dl>
+ </li>
+ </ol>
+
+== Struct
+
+ c = Struct.new(:a, :b, :c)
+ s = c.new(1,2,3)
+
+ s.to_xoxo
+
+With some implementations of Ruby Stuct order is not preserved. So,
+
+ @_.assert.include?('<ol class="xoxo">')
+ @_.assert.include?('<dt>a</dt><dd>1</dd>')
+ @_.assert.include?('<dt>b</dt><dd>2</dd>')
+ @_.assert.include?('<dt>c</dt><dd>3</dd>')
+
+It would otherwise look like this:
+
+ <ol class="xoxo">
+ <li>
+ <dl>
+ <dt>a</dt><dd>1</dd>
+ <dt>b</dt><dd>2</dd>
+ <dt>c</dt><dd>3</dd>
+ </dl>
+ </li>
+ </ol>
+
+== Object
+
+ class C
+ def initialize(a,b,c)
+ @a, @b, @c = a, b, c
+ end
+ end
+
+ c = C.new(1,2,3)
+
+ c.to_xoxo
+
+Instance attributes are not stored in order. So
+
+ @_.assert.include?('<ol class="xoxo">')
+ @_.assert.include?('<dt>a</dt><dd>1</dd>')
+ @_.assert.include?('<dt>b</dt><dd>2</dd>')
+ @_.assert.include?('<dt>c</dt><dd>3</dd>')
+
+
+
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
File renamed without changes.
File renamed without changes.

0 comments on commit 09879fd

Please sign in to comment.