George M. 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 a block of text.
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 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)