By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,235 Members | 1,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,235 IT Pros & Developers. It's quick & easy.

MS Word Outline -> reStructuredText script?

P: n/a
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

Oct 14 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Jim wrote:
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

Oct 14 '05 #2

P: n/a
Jim
I'll look into that. I also found that Open Office can read the .doc
file and then saveAs a DocBook xml file. I think DocUtils can parse
and write both DocBook and reStructured text, but It'll take me some
time to experiment with it.

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

http://www-128.ibm.com/developerwork...s24/?ca=dnt-45

-Jim

Oct 14 '05 #3

P: n/a
Jim wrote:
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

Oct 15 '05 #4

P: n/a
In article <11**********************@g49g2000cwa.googlegroups .com>,
Jim <mr*****@gmail.com> wrote:

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.
--
Aahz (aa**@pythoncraft.com) <*> http://www.pythoncraft.com/

"If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur." --Red Adair
Oct 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.