473,406 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

MS Word Outline -> reStructuredText script?

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
4 3501
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Pat Sheen | last post by:
I'm a novice at designing web pages so I'm not sure how complicated this is. I'd like a page that helps me take notes for research. It would have something like two frames. One with a word...
20
by: Chris Bradbury | last post by:
Hi, I'm posting in this forum for the first time so if I break any conventions or protocols I'm sorry. I've attached this style: *:focus { outline: none } to a page but it doesn't remove...
4
by: Mark Jerde | last post by:
Sorry about the cross post. I'm not finding anything in google or google groups. I have a client who likes Visio-style drawings, similar to hierarchical org charts. But we're early in the...
6
by: Altramagnus | last post by:
I have n number of circles. Some of them might overlap. I need to draw the outline of all circles but not those overlap areas. Initially, I am try to use a Region, because a Region object has a...
5
by: Charles Law | last post by:
I have a document in the following style 1 Introduction 2 Next Heading 2.1 Sub-section Some text ... 2.2 Another Sub-section 2.2.1 Getting deeper 3 Another Major Heading...
0
by: Maileen | last post by:
Hi, I try to add/modify some style in Word 2002 and 2003 using VB, but I have such error : System.runtime.interopServces.COMException(0x800A1735) : Given Items does not exist. at...
6
by: orit | last post by:
I have a word document that contains a table. The table has 2 columns and hundreds of rows. I want to number the items in the table in the following way: In the first column, each cell will contain...
14
klarae99
by: klarae99 | last post by:
I am wondering if access 2003 has the ability to open a linked Word Document, without that document being related directly to a table (I do not need to merge data with the document). I am...
0
by: said76 | last post by:
Hi, I have a question in regards to Word VBA. In word document, there is bullet and numbering feature where you can customise the numbering. My question is whether there is a way that i can get...
209
by: arnuld | last post by:
I searched the c.l.c archives provided by Google as Google Groups with "word input" as the key words and did not come up with anything good. C++ has std::string for taking a word as input from...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.