@rst output to ODT and S5 options

Bug #743339 reported by Rob Keeney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
leo-editor
Fix Released
Medium
Edward K. Ream

Bug Description

Feature request:
Propose addition of ODT and S5 to output of @rst trees via rst3. The ODT would probably be easier as it could be detected automatically from file extension thus:
@rst SomeOOWriterFile.odt

The docutils processor for S5 also uses HTM so there might need to be an additional option for that, not sure.

Tags: docutils odt rst s5
Revision history for this message
Edward K. Ream (edreamleo) wrote : Re: [Bug 743339] [NEW] @rst output to ODT and S5 options

On Sat, Mar 26, 2011 at 5:01 PM, Rob Keeney <email address hidden> wrote:
> Public bug reported:
>
> Feature request:
> Propose addition of ODT and S5 to output of @rst trees via rst3. The ODT would probably be easier as it could be detected automatically from file extension thus:
> @rst SomeOOWriterFile.odt

Rev 3927 adds preliminary support for both @rst x.s5 and @rst.odt.
Note: you must have an odt writer for this to work:

http://www.rexx.com/~dkuhlman/odtwriter.html

The change was minimal: the code simply adds .s5 and .odt to the list
of extensions which get passed to docutils. The call_docutils rst3
option must be in effect.

I ran a minimal test that created a .s5 file, but that is all. Here
are the rst3 options I used:

@ @rst-options
call_docutils=True
code_mode=False
generate_rst=True
http_server_support = False
show_organizer_nodes=True
show_headlines=True
show_leo_directives=True
stylesheet_path=.
write_intermediate_file = True
verbose=True
@c

Please test yourself and report your experiences. Thanks.

Edward

Revision history for this message
Rob Keeney (largo84) wrote :

Sounds good, thanks. Unfortunately, I can't get Bazaar to work for me, so I may have to wait until next release. I'll report back if I can figure out how to use the latest trunk.

Revision history for this message
tbnorth (terry-n-brown) wrote : Re: [Bug 743339] Re: @rst output to ODT and S5 options

On Mon, 28 Mar 2011 14:52:21 -0000
Rob Keeney <email address hidden> wrote:

> Sounds good, thanks. Unfortunately, I can't get Bazaar to work for me,
> so I may have to wait until next release. I'll report back if I can
> figure out how to use the latest trunk.

There are nightly snapshots in .zip format at
http://www.greygreen.org/leo/

Cheers -Terry

Revision history for this message
Rob Keeney (largo84) wrote :

Thanks, Terry. I guess I'm just dense but I can't figure out how to make
those work either. Knowing from earlier posts from you these were available,
I checked this morning and downloaded the latest/greatest. However, as I
read the installation notes from the online
docs<http://webpages.charter.net/edreamleo/installing.html#installing-leo-with-bzr>,
it suggests I can run it from leo/core/leo.py. There is no such file. I also
tried other likely candidates with no success. I don't really know what
files I should move where from this unpacked zip archive. I don't want to
screw up an already existing installation.

Thanks for your help, and sorry this is such a bother. You guys do great
work and I wish I could contribute, but I'm not a programmer (at least not
in Python).

Rob............

On Mon, Mar 28, 2011 at 11:29 AM, tbnorth <email address hidden> wrote:

> On Mon, 28 Mar 2011 14:52:21 -0000
> Rob Keeney <email address hidden> wrote:
>
> > Sounds good, thanks. Unfortunately, I can't get Bazaar to work for me,
> > so I may have to wait until next release. I'll report back if I can
> > figure out how to use the latest trunk.
>
> There are nightly snapshots in .zip format at
> http://www.greygreen.org/leo/
>
> Cheers -Terry
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/743339
>
> Title:
> @rst output to ODT and S5 options
>
> Status in Leo: a programmer's editor and more:
> New
>
> Bug description:
> Feature request:
> Propose addition of ODT and S5 to output of @rst trees via rst3. The ODT
> would probably be easier as it could be detected automatically from file
> extension thus:
> @rst SomeOOWriterFile.odt
>
> The docutils processor for S5 also uses HTM so there might need to be
> an additional option for that, not sure.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/leo-editor/+bug/743339/+subscribe
>

Revision history for this message
tbnorth (terry-n-brown) wrote :

On Mon, 28 Mar 2011 15:48:30 -0000
Rob Keeney <email address hidden> wrote:

> docs<http://webpages.charter.net/edreamleo/installing.html#installing-leo-with-bzr>,
> it suggests I can run it from leo/core/leo.py. There is no such file. I also
> tried other likely candidates with no success.

Might be an out of date piece of documentation.

The file you run to launch Leo is launchLeo.py, which is in the top
level directory for the .zip files. I assume if you just click on it
it runs the Qt tabbed interface, you could run it from the command line
with something like

  <set directory to where ever you unzipped the .zip>
  c:\python27\pythone.exe launchLeo.py --gui=qt

Cheers -Terry

Revision history for this message
Rob Keeney (largo84) wrote :

That worked to launch Leo, thanks! If I want to use this branch instead of
my installed version, what files need to go where to replace the older
version?

Rob.................

On Mon, Mar 28, 2011 at 12:12 PM, tbnorth <email address hidden> wrote:

> On Mon, 28 Mar 2011 15:48:30 -0000
> Rob Keeney <email address hidden> wrote:
>
> > docs<
> http://webpages.charter.net/edreamleo/installing.html#installing-leo-with-bzr
> >,
> > it suggests I can run it from leo/core/leo.py. There is no such file. I
> also
> > tried other likely candidates with no success.
>
> Might be an out of date piece of documentation.
>
> The file you run to launch Leo is launchLeo.py, which is in the top
> level directory for the .zip files. I assume if you just click on it
> it runs the Qt tabbed interface, you could run it from the command line
> with something like
>
> <set directory to where ever you unzipped the .zip>
> c:\python27\pythone.exe launchLeo.py --gui=qt
>
> Cheers -Terry
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/743339
>
> Title:
> @rst output to ODT and S5 options
>
> Status in Leo: a programmer's editor and more:
> New
>
> Bug description:
> Feature request:
> Propose addition of ODT and S5 to output of @rst trees via rst3. The ODT
> would probably be easier as it could be detected automatically from file
> extension thus:
> @rst SomeOOWriterFile.odt
>
> The docutils processor for S5 also uses HTM so there might need to be
> an additional option for that, not sure.
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/leo-editor/+bug/743339/+subscribe
>

Revision history for this message
tbnorth (terry-n-brown) wrote :

On Mon, 28 Mar 2011 16:32:55 -0000
Rob Keeney <email address hidden> wrote:

> That worked to launch Leo, thanks! If I want to use this branch instead of
> my installed version, what files need to go where to replace the older
> version?

Depends on how the old version was installed, but as far as I know the
distutils setup.py script isn't really working, so it's probably not
practical to make the .zip file version your "system" version.

But you can always make a shortcut to the launchLeo.py file on the
desktop or where ever. Not sure what it would take to associate
the .zip version with .leo files, although it's probably possible. I
don't use Windows much.

Cheers -Terry

Revision history for this message
Ville M. Vainio (villemvainio) wrote :

On Mon, Mar 28, 2011 at 6:21 PM, tbnorth <email address hidden> wrote:

>> That worked to launch Leo, thanks! If I want to use this branch instead of
>> my installed version, what files need to go where to replace the older
>> version?
>
> Depends on how the old version was installed, but as far as I know the
> distutils setup.py script isn't really working, so it's probably not
> practical to make the .zip file version your "system" version.

setup.py is working fine for Linux package creation (deb / rpm). They
probably work for installation as well, but I wouldn't recommend it.

Just pointing this out to prevent the misconception that there is
something to fix about setup.py.

Revision history for this message
Rob Keeney (largo84) wrote :

I have the rst2odt.py that comes w/ docutils. It's in the scripts folder. The link above I think is not for the most current version. http://docutils.sourceforge.net/docs/user/odt.html is the documentation for the ODT writer that is included in current distributions of docutils (which I have).

rst3 still processes to htm and tex just fine (as always) but not to odt (see attached error log).

Revision history for this message
Edward K. Ream (edreamleo) wrote :

On Mon, Mar 28, 2011 at 1:04 PM, Rob Keeney <email address hidden> wrote:

> rst3 still processes to htm and tex just fine (as always)  but not to
> odt (see attached error log).

Right. You have to install the odt writer separately. See:

http://docutils.sourceforge.net/docs/user/odt.html

and

http://www.rexx.com/~dkuhlman/odtwriter.html#where-to-get-it

Edward

Revision history for this message
Rob Keeney (largo84) wrote :

Tried that, it wouldn't build or install using the instructions there. That's why I was hoping rst3 would call the writer I already have installed that comes w/ docutils (as it does for tex and htm).

Revision history for this message
Rob Keeney (largo84) wrote :

I was also trying to understand the Leo code at work here. I looked in core\leorst.py but didn't see anything promising. It references itself as a plugin. In which leo***.py file would I find the code that calls the proper docutils writer based on the extension?

Revision history for this message
Rob Keeney (largo84) wrote :

To verify my suspicions, I emailed the author of the rst2odt.py writer and he verified that the information on his web page is no longer current, quoting:
Rob -

Now that the odf-odt writer is in the docutils distribution,
whenever I make a change to it, I update it in the Docutils
subversion repository. And, I have not been keeping that version at
my Web site up-to-date.

So, you are best off downloading Docutils from the Subversion
repository, and installing that.

If using Subversion is a problem, use the latest snapshot of
Docutils.

You can find out about downloading Docutils here:

   http://docutils.sourceforge.net/

Look under "Download".

In the Docutils distribution, odf-odt writer is under:

   docutils/docutils/docutils/writers/odf_odt/

Sorry for the inconvenience. I'll go update my Web page on odf-odt
writer so that it will say something like the above.

If you have more questions, please let me know. And, thanks
for letting me know about the out-of-date Web page of mine.

- Dave
~~~~~~~~~~~~~~~~~~~~Then a follow-up email from Dave:

Rob -

One more note (in addition to my previous email).

The document that you really should be reading
(about odf-odt writer) is this one:

   http://www.rexx.com/~dkuhlman/odt.html

It's the same as the one in the Docutils distribution.

Hope this helps.
~~~~~~~~~~~~~~~~~~~~~~~~~~~

I have the most current version of docutils installed. Still no go.

Revision history for this message
Rob Keeney (largo84) wrote :

More info from Dave:
~~~~~~~~~~~~~~~~~~
Here is what works on my machine::

   from docutils.writers import odf_odt

docutils/writers/odf_odt is actually a package, that is a directory
containing a __init__.py file.

So, try using "odf_odt". Perhaps there should be a
an entry in that _writer_aliases dictionary that
associates "odt" with "odf_odt", but I don't know
about that.

And, from your previous message:

> 5839 2009-01-07 19:09:28Z

Mine is newer. I'm attaching my versions of
odf_odt/__init__.py and odf_odt/styles.odt, in
case it's awkward for you to retrieve them via
Subversion (svn).

Hope this helps. What you are doing sounds
interesting. Let me know if/when you have more
questions.

Revision history for this message
Edward K. Ream (edreamleo) wrote :

I am going to mark this bug as fixed. Please reopen if you have specific questions.

Changed in leo-editor:
importance: Undecided → Medium
status: New → Fix Released
assignee: nobody → Edward K. Ream (edreamleo)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.