Question
Wiki is a great tool, but it is also a great text formatter.
I want to use just the text formatter.
is it possible to have it from command line.
e.g.:
cat mytext | twikiformatter > output.html
possible usage: pretty-format reports (its easier to generate twiki text than HTML...)
Environment
--
DrorTirosh - 06 Sep 2005
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
Have you check good old troff. It is an utility for text processing under most unix (and linux). It might do the trick for your needs.
--
AntonioVega - 08 Sep 2005
Interesting. There are, of course, many different text formatting packages out there already, as Antonio highlights. To use the TWiki rendering engine as a formatter, you need the context of a TWiki installation. However that installation wouldn't actually need a web server, it would just sit on your disk. You could simply run the
view script in the
bin directory from the command line to render a TWiki topic, providing the appropriate CGI parameters interactively, and it would print to STDOUT. A script to provide a friendlier interface to the renderer could be knocked up in a few minutes (with
DakarRelease, anyway. It would be a bit more complicated with Cairo (the current release) but could still be done). Look at the
view script, and the
DakarRelease unit tests, for ideas.
--
CrawfordCurrie - 08 Sep 2005