[NTG-context] ConTexT conversion to html/rtf/odt

Aditya Mahajan adityam at umich.edu
Sat Nov 6 22:00:38 CET 2010

On Sat, 6 Nov 2010, Manfred Lotz wrote:

> I'm in a situation where I have to do some documentation which should
> be available in html and rtf/odt (would be nice to have).

There is an experimental feature of converting ConTeXt to XML. You can 
then process XML using standard XML tools to get HTML.

> I do not need any fancy stuff, just simple things: ordered,
> unordered lists, verbatim, tables etc.

> \starttext
> \section{Some section}
> \startitemize[1]
>    \item bla bla
> \stopitemize
> \stoptext

Run "context filename". This will create a filename.export file in your 
current directory that looks like this:

<?xml version='1.0' standalone='yes' ?>

<!-- input filename   : back              -->
<!-- processing date  : Sat Nov  6 16:55:02 2010 -->
<!-- context version  : 2010.10.14 13:14  -->
<!-- exporter version : 0.10              -->

<document language='en' file='back' date='Sat Nov  6 16:55:02 2010' 
context='2010.10.14 13:14' version='0.10'>
   <section detail='section'>
     <sectiontitle>Some section</sectiontitle>
       <itemgroup detail='itemize' symbol='1'>
           <itemcontent>bla bla</itemcontent>

> work for ConTeXt and then I would like to know what other alternatives
> I have. Also regarding rtf or/and odt.

Since you do not need any fancy features, a simpler option is to use 
markdown as your starting format and use pandoc to convert it to context, 
html, and odt. However, creating even slightly complicated tables in 
markdown is a pain, unless your editor supports an ascii table mode.


More information about the ntg-context mailing list