diff options
author | Thomas Graf <tgraf@suug.ch> | 2011-07-21 14:24:31 (GMT) |
---|---|---|
committer | Thomas Graf <tgraf@suug.ch> | 2011-07-21 14:24:31 (GMT) |
commit | 50074732af4fbfc0ca5ae4bb07e971bc9e222126 (patch) | |
tree | 8211dd82daaf32efaba045f76adfc8bae58b12ea /doc/resolve-asciidoc-refs.py | |
parent | dea6de42f69a5137544723f7a96bc097adbbdd29 (diff) | |
download | libnl-50074732af4fbfc0ca5ae4bb07e971bc9e222126.zip libnl-50074732af4fbfc0ca5ae4bb07e971bc9e222126.tar.gz libnl-50074732af4fbfc0ca5ae4bb07e971bc9e222126.tar.bz2 |
more documentation updates
- improved stylesheets for both doxygen and asciidoc
- use of xml doxygen layout
- python script to resolve <<foo>> asciidoc references to
<<foo, title>> based on the target caption
- graphics for netlink and netlink error headers
- more link documentation
Diffstat (limited to 'doc/resolve-asciidoc-refs.py')
-rwxr-xr-x | doc/resolve-asciidoc-refs.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/resolve-asciidoc-refs.py b/doc/resolve-asciidoc-refs.py new file mode 100755 index 0000000..5418747 --- /dev/null +++ b/doc/resolve-asciidoc-refs.py @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +import fileinput +import re +import sys + +refs = {} +complete_file = "" + +for line in open(sys.argv[1], 'r'): + complete_file += line + +for m in re.findall('\[\[(.+)\]\]\n=+ ([^\n]+)', complete_file): + ref, title = m + refs["<<" + ref + ">>"] = "<<" + ref + ", " + title + ">>" + +def translate(match): + try: + return refs[match.group(0)] + except KeyError: + return "" + +rc = re.compile('|'.join(map(re.escape, sorted(refs, reverse=True)))) +for line in open(sys.argv[1], 'r'): + print rc.sub(translate, line), |