[Nitro] Tutorial PDF

Arne Brasseur arne at arnebrasseur.net
Fri Nov 30 03:59:39 EST 2007


George Moschovitis schreef:
> can you post the docbook source file as well?

No problem, here it is.

I was gonna keep the custom markup stuff for myself until it's a little 
more polished but here it is in true release early style. I'll be out of 
town till somewhere next week so whoever wants can have a look at it in 
the meanwhile. Think of it as a proof of concept.

Installing the marky gem should give you the marky command which takes 
an xml file as arguments which can contain processing instructions like

  <?marky-include href="01_intro.mky" root="sect1" ?>

  <?marky-parse root="sect1"
title:: Example marky text

A block of text is converted to <para>a block of text</para>.

note::
Open and closing tags look like this. If there's just a single line 
inside put it after the opening tag and omit the closing tag. Tags can 
be nested.
end-note::

?>

The basic idea is to convert blocks of text following and followed by a 
double new-line to paragraphs. Text inside paragraphs will be scanned 
for certain "wingnuts" (e.g. _underscores_ or ^these thingies^) which 
are shorthands for certain tags. This is not implemented yet.

The current implementation uses Rexml to build the structure and then 
dump to xml which has the effect that any XML in the document gets 
converted to entities. This obviously has to change because we want to 
be able to simply use XML inline. So either text needs to explicitly be 
parsed by rexml or we just do our conversions without rexml leaving 
intact what is there. The downside is that either way ampersands and 
less-than signs need to be written as entities.

Also in that case a handy shortcut for <programlisting><![CDATA[ ... 
]]></programlisting> would be... euh, handy.

Ok that's a bit of a dump of my current thought processes and I could 
have had a little more sleep but anyway, as always, enjoy!


Oh yeah to use it, make sure you have xsltproc, put the xml, mky, xsl 
and css files in a directory and try this
  
   marky tutorial.xml | xsltproc nitro-article-html-chunks.xsl -

If that went well you should have a bunch of html files, so try "firefox 
-new-tab index.html" and marvel at the beauty ;)

If you want the pdf you should get apache-fop. Similar procedure

  marky tutorial.xml | xsltproc nitro-article-fo.xsl - > fop.xml

and then

  fop fop.xml tutorial.pdf

The xsl files import stylesheets from docbook-xsl, and the html one sets 
a parameter to use the supplied css file. The idea is to build on these 
to create a customized look for the nitro docs.

The nitro_todolist.xml is the docbook as is generated by marky.

As I said, Enjoy!

(ab)


-- 
Arne Brasseur
http://www.arnebrasseur.net
http://www.zhongwiki.com
http://www.bankske.org
arne at arnebrasseur.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: nitro_todolist.xml
Type: text/xml
Size: 13863 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0002.xml 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 01_intro.mky
Url: http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0008.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 02_getting_and_installing.mky
Url: http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0009.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 03_hello_world.mky
Url: http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0010.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 04_a_real_app.mky
Url: http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0011.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 05_the_models.mky
Url: http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0012.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 06_views.mky
Url: http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0013.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 07_controller.mky
Url: http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0014.pl 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 08_getting_interactive.mky
Url: http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0015.pl 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tutorial.xml
Type: text/xml
Size: 1326 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0003.xml 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: marky-0.1.2.gem
Type: application/octet-stream
Size: 6656 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0001.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: marky-0.1.2.tgz
Type: application/x-gtar
Size: 3448 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0001.gtar 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nitro_article.css
Type: text/css
Size: 167 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0001.css 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nitro-article-fo.xsl
Type: application/xml
Size: 324 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0002.wsdl 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nitro-article-html-chunks.xsl
Type: application/xml
Size: 395 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/nitro-general/attachments/20071130/7f7e3fe4/attachment-0003.wsdl 


More information about the Nitro-general mailing list