<pre> in exported HTML?
Adam Wuellner
adam.wuellner at gmail.com
Mon Mar 14 09:29:29 PST 2005
On Mon, 14 Mar 2005 01:35:17 -0500, Mitchell L Model
<MLMLists at comcast.net> wrote:
> How can I get a <pre>...</pre> included when exporting to HTML,
> DHTML, or Word (HTML)? I need to include chunks of computer code in
> my document. I can format these in OO3 using <option>-<tab> and
> <option>-<return>, but the white space disappears on export.
> If, as I fear, there is no way to do this, the only thing I can think
> of doing is ending every line with some strange character that I
> otherwise wouldn't use, preceding every tab with a different strange
> character, and put a third and fourth strange character at the
> beginning of end of every <pre>. Then after the HTML is generated do
> a global search-and-replace in a text editor or Unix command-line
> tool to replace each of the characters with <pre>, </pre>, newline,
> or tab, as appropriate. Pretty awful, but I can automate the
> process, I guess.
If you cherish the idea of mucking around in the application package,
you'll find the xsl stylesheets that OO uses to transform the XML into
HTML. You might be able to modify it to get your OO code style to get
wrapped in <pre></pre> tags on export.
The xsl's can be found here:
/Applications/OmniOutliner
Professional.app/Contents/PlugIns/HTMLExport.ooxsl/Contents/Resources/column-formatters.xsl
/Applications/OmniOutliner
Professional.app/Contents/PlugIns/HTMLExport.ooxsl/Contents/Resources/export.xsl
/Applications/OmniOutliner
Professional.app/Contents/PlugIns/HTMLExport.ooxsl/Contents/Resources/style-formatters.xsl
(Dynamic HTML Export has an analogous structure at PlugIns)
If you go this route, of course back up the originals in case
something goes wrong. I've never tried it, so no telling if it'll
even work, but I can't see why it wouldn't.
I would very much like to see some facility for user XSL stylesheets
for custom exports in a future version of OO.
More information about the OmniOutliner-Users
mailing list