[coyotos-dev] Doc Conversion -- content model?
Jonathan S. Shapiro
shap at eros-os.com
Sat Sep 1 23:02:54 EDT 2007
After a conversation with JWA (Jonathan Adams), and some further
thought, we *may* have a resolution here.
Conceptually, we can divide documents into two categories:
+ "Reference" documents that have official versions and need to be
under some form of SCM.
+ "Community" documents that probably do not need SCM.
About an hour ago it dawned on me that there is a devious but
straightforward way to pass pre-existing documents through Drupal
**provided** they are frozen.
Drupal has an experimental content processing model for XML content
based on XSLT (specifically libxslt). All of our source-controlled
documentation originates that way. It is a relatively small matter to do
a new variant of the OSDoc transformers to generate Drupal-compatible
HTML -- or just to post-process the current HTML output.
This reduces the problem to: how do we get the document into Drupal from
the SCM system. [I am assuming here that the xmlcontent chain is set up
to process from the content stored within Drupal.
The answer is embarassingly simple. First, note that xslt has an
opendocument() operation. The XML file stored within Drupal need only
supply the name of the document. libxslt can fetch the actual content.
This brings me to Mercurial, which happily allowed me to fetch:
http://dev.eros-os.com/hg/coyotos/raw-file/70740d838127/src/doc/web/docs/build/mkimage.xml
[sorry for any line breaks]. If we want a version that tracks ongoing
development, we can replace that yucky hex string with the word
"tip" (we would probably need to turn off caching in that case).
Note this is a URL that can be passed to libxslt via OpenDocument().
The only catch is that for the tip version we will probably need to
disable document caching or set a relatively short cache timeout (short
timeout is probably sufficient).
I know that opendocument() is present in libxslt. I haven't tried to
actually us it in Drupal yet.
shap
More information about the coyotos-dev
mailing list