Jean,

Somebody should try to save you enough time to be our new Co-lead :-) and here is my try. Have a look, and let me know if you like any of it, or have other ideas. (If not, sorry for wasting your time, instead.)

(Please excuse any mania, here. I have finally written a case-toggling macro. /Morgen die Welt!/)

Jean Hollis Weber wrote:
T. J. Frazier wrote:
Could you take a minute and describe the process you're using? ...

Short answer:
With the .ODT file open in OOo, go to File > Export and choose "Mediawiki" under File Format, then click Export. This produces a file (with extension .txt) that has wiki markup in it. Basically, that's it.

Then copy and paste the result into the wiki page, add the necessary template links at top and bottom of each page for navigation and copyright info, save the page, and lastly manually upload any pictures.

Longer answer:
Of course there's at least one "gotcha" -- which I probably should write a wee bit about in the Writer Guide and perhaps a longer how-to for the wiki.

Depending on the layout complexity of the ODT file (and proper use of Headings), and how any figures have been inserted and captioned, the resulting .txt file may need little cleanup or it may need quite a lot. The user guide files we've been producing need cleanup, but most of it is fairly easily done with search-and-replace. (An example of cleanup is changing the "Tips" and "Notes" from the tables used for their layout in our chapters into the style used for the Docs wiki.)-

Cleaning up the Tips, Notes, and Cautions (TNC) by hand looks pretty messy to me, though I suppose you could just search for that "prettytable" line, extend the selection with Shift-click or Shift-arrow, and type an AutoText short-cut for whichever type this is. (I presume that the extra pipe at the end is harmless.)

I am reasonably sure I can automate this, so that one macro call will fix all of these in the open doc (the wikified .txt doc), if you like. (This is a fairly minor effort. If all goes well, I might have it done in a day. But they rarely do all go well, so maybe a week or more.)

- The one thing that appears to have to be done manually is inserting filenames for any pictures.

Sorry, on this part I am no help at all.


BTW, I get the pictures by unzipping the .ODT and extracting the Pictures folder, but if I had the pix already in separate files (eg screen captures), I could skip that step.

Also BTW, I break up the user guide chapters into several pages, so I have to also create a wiki TOC for each chapter as well as a TOC for each book. I don't know of any way to automate this, though there may be one.

Filling out the navigation links and creating the TOCs is really all one task, which I may be able to automate to a great extent.

The exact details would depend on exactly how you work (there are distinct advantages to having a private toolsmith! :-) ). I am assuming that at some point you have just done a Save As, with the new file name the same as the wiki page. At that point, with the page name created, a macro call could gather it into a list (essentially, a flat database) which the macro would build. (You would have done nothing about the navigation at all.)

When the entire guide is ready, you could open the list file, edit as you see fit (or do nothing at all), and make one macro call. The call would:
* build all the TOC templates.
* find and modify all the referenced files by adding the nav template call, all fields properly filled out.
* supply the {{DISPLAYTITLE|}} template call, if you haven't put one in.

(This all depends on a lot of things working the way the documentation says they do, or my being able to figure out how they really work. The code itself is the least part. DHYB, but there are a lot of Guides...)

This is just one of many procedures I should write up, and perhaps then someone else would show me a better or faster way to do some of it. :-)

--Jean

The one thing I really need to know is *exactly* how you open and save the wiki-text file, after it's been exported. I've been using the "encoded text" option, with UTF-8 encoding and LF delimiter, and the "save it like you found it" setting. Under Windows Vista, OO.o wants to open the file in Calc(!), but right-clicking on the file name and opening with swriter goes straight to the filter dialog. Even if the procedure is a little different under Ubuntu, what shows up inside Writer should be platform-independent, so my Basic code should be, too.

Hope all this is a help, rather than a hindrance. /tj/

--
T. J. Frazier
Melbourne, FL

(TJFrazier on OO.o)

Reply via email to