On Fri, Mar 27, 2009 at 9:22 PM, Largo84 <[email protected]> wrote:

>
> I use Leo to help me with multi-output document creation using the
> rst3 plugin to create TEX and HTM files. I also would like an output
> to be something a word processor understands, like RTF or ODT.
>
> I see there is a ODT Writer in docutils:
>
> http://docutils.sourceforge.net/docs/user/odt.html
>
> How can this be incorporated into the the rst3 plugin?
>
> Is there anything for RTF?


Something related came up during the sprint.  Rev 1693 of the trunk now
contains an example, with instructions, of how to create .rtf, .pdf and .odt
files.  Creating odt files is the easiest; creating the other types requires
more tools.

Here is a copy of the docs in LeoDocs.leo, in the top-level node, "Test of
odt/rtf/pdf files":

QQQ
To generate .odt or .rtf or .pdf files, you create an intermediate file and
ignore the the "official" output file, in this case test.html. The
intermediate
file contains the rST text corresponding to the @rst tree.

To tell the rst3 plugin to generate an intermediate file, do::

    write_intermediate_file = True

After you create the intermediate file, in this case, test.html.txt,
You can create an odt file as follows::

    python rst2odt.py test.html.txt test.odt

Note that rst3odt.py is in the tools directory of the DocUtils distribution.

To generate .rtf, you can use PanDoc to convert test.html.txt to RTF.

To generate .pdf files, you would first convert test.html.txt to LaTeX::

    python rst2newlatex.py test.html.txt test.tex

You can then use one of the LaTeX to .pdf converters to create the final
.pdf
file. See
http://docutils.sourceforge.net/docs/user/latex.html#pdf-generation
for details.
QQQ

I have only verified that the conversion to .odt files works.  However, this
verifies the essential step, namely that the rst3 plugin can create files
containing valid rST markup.

Perhaps the @rst3 plugin should treat the .rst extension as a special case.
The plugin would simply write the rST markup to the indicated file,
regardless of the write_intermediate_file setting.  This would be more
intuitive and simpler in most cases, but it might cause problems when the
.rst file already exists.

Edward

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to