|
From: David G. <go...@us...> - 2002-08-24 01:33:04
|
Adam Chodorowski wrote: > I see that the HTML writer creates the following elements that are > then joined in that order: > > head_prefix > head > body_prefix > body_pre_docinfo > docinfo > body > body_suffix Didn't I tell you about that? Thought I did. I went to the trouble of separating ``body_pre_docinfo`` and ``docinfo`` out of ``body`` just for you! (See the "Optionally disable docinfo section" thread.) If you don't want the "docinfo", just concatenate everything in the list above *except* ``docinfo``. Use the ``io.NullOutput`` I/O class to avoid unnecessary output. You'll have to encode the text yourself. > I'm wondering exactly what head_prefix, head, body_prefix and > body_suffix actually contain... Just run the code and see. The parts listed above are just an arbitrary division of the HTML output for convenience. While processing the document for HTML output, we may need to insert <meta> tags inside <head>: put 'em in the ``head`` list. The "footer" element is actually located near the beginning of the document, so it gets prepended to ``body_suffix``, before most of ``body`` is finished. And so on. -- David Goodger <go...@us...> Open-source projects: - Python Docutils: http://docutils.sourceforge.net/ (includes reStructuredText: http://docutils.sf.net/rst.html) - The Go Tools Project: http://gotools.sourceforge.net/ |