The two awk-scripts w2u.awk and u2w.awk provide the possibility to convert documents written for udo from and to the wiki-language.
Copy the files listed below (except w2u.ui) into a directory in $PATH or your local directory. The include-file w2u.ui is first searched in the local directory, then in $HOME/wiki. Copy the Makefile to your local directory.
- u2w.awk Convert from udo to wiki
- w2u.awk Convert from wiki to udo
- u2w Shell-script to call u2w.awk
- w2u Shell-script to call w2u.awk
- getxml Retrieve xml-source from the wiki
- makenodes Create nodes- and label-list
- Makefile see below
- w2u.ui Includefile needed for the udo-output by w2u.awk, contains some macros and
Download the xml-file from the wiki using
To download the MiNT-usermanual for example enter:
This will produce the file
in your local directory.
Convert from wiki to udo
You get udo-source from wiki-xml by entering
awk -f w2u.awk <wiki-source>
The output-filename will have the same base as the source with the extension .wu.
For example to convert the MiNT-usermanual to udo enter:
awk -f w2u.awk User_manual.xml
This will produce the file
Now you can convert this using udo to any format you need.
Convert from udo to wiki
You get wiki-source from udo-source by entering
awk -f u2w.awk <udo-source>
The output-filename will have the same base as the source with the extension .wik.
To convert the MiNT-usermanual to wiki enter:
awk -f u2w.awk User_manual.wu
which can be imported into the wiki by copy/paste.
If you want local links for nodes and labels in the wiki-output you need to create a file
which contains a list of all nodes and labels.
You can create this file by running
egrep "(^!(sub)*node|^!label)" <udo-source> ><udo-source>.n
Using the Makefile
to produce the output-format you want. Example:
will produce User_manual.html from User_manual.xml, User_manual.wu, or User_manual.u.
Both tools only cover a small subset of their input-language, so it's up to the user to not use anything that's not supported.
Coverage of udo-syntax
Lines that start with a '#' are comments. They are converted into
<!--# <text> -->
Coverage of wiki-syntax
are removed from the wiki-source. If you want to add a comment to the wiki-source type:
<!--# <your comment> -->
so your comment will be a comment in udo-source and will not get lost or cause errors. Only one-line-comments are possible.
What should be avoided in wiki
- Using links as headlines is a ba idea, because udo places the link
itself in the TOC not the link-text.
- Using brackets in a link-text is not reccommended, because they may confuse udo and the converter.
- definition lists don't work because awk kills any leading ';' from the input-stream.
What should be avoided in udo
The converter emits a warning for any unknown udo-command it encounters.
Both converters use the URL given in the base-statement, which is for wiki:
and for udo:
#! base URL
at the start of the document.
- When repeatetly converting back and forth, the bold-environment may not always be correct (as well as other things).
awk, udo, egrep, wget
The combination udo/awk is too limited (or my skills are) to make a complete converter, so this is probably the last version.