MS Word Outline -> reStructuredText script?

J

Jim

Hi,

I'm using reStructuredText as a format for some group documentation,
and often my co-workers take notes during meetings in Word's outline
mode. Does anyone already have a python script that will convert from
Word (or the Open Office file format version of a word document) to
reStructured Text?

If not I've got a fun project ahead of me.

Thanks,
-Jim
 
G

Graham Fawcett

Jim said:
Hi,

I'm using reStructuredText as a format for some group documentation,
and often my co-workers take notes during meetings in Word's outline
mode. Does anyone already have a python script that will convert from
Word (or the Open Office file format version of a word document) to
reStructured Text?

I don't have a script; but if you have to roll your own, you might
consider having your colleagues save their Word documents in XML
format. Office 2003, and perhaps slightly earlier versions, do this.
Then you can "simply" parse the XML and transform it into anything you
like, including a reST document.

If you cannot convince them, then you could also have your script
automate Word, via win32com.client.Dispatch('Word.Application'), and do
the save-as-XML yourself before parsing the generated XML. At the end
of the day, I think this would be easier than, e.g., trying to use
win32com to traverse the document's object model.

Graham
 
F

Franz GEIGER

Jim said:
Hi,

I'm using reStructuredText as a format for some group documentation,
and often my co-workers take notes during meetings in Word's outline
mode. Does anyone already have a python script that will convert from
Word (or the Open Office file format version of a word document) to
reStructured Text?

Not a direct answer to your problem, but: Have a look at Leo! Leo is an
outstanding outliner, written in Python. I do all formatting with reST and
the convert it into LATEX and/or HTML. Everything's built in already,
either in Python or in Leo. Perhaps you can convert your co-workers using
Leo?
If not I've got a fun project ahead of me.

Thanks,
-Jim

HTH
Franz GEIGER
 
A

Aahz

David Mertz has an article that shows reSt -> DocBook, I just need to
do the opposite.

Note that this is tricky because reST has fewer features/capabilities
than DocBook. More to the point, reST simply isn't designed to be
machine-generated; there has been some discussion on the docutils
mailing lists about this, and I suggest you look in the archives.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,279
Latest member
LaRoseDermaBottle

Latest Threads

Top