summaryrefslogtreecommitdiffstats
path: root/doc/doxygen-link.py
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2011-03-31 12:25:57 (GMT)
committerThomas Graf <tgraf@suug.ch>2011-03-31 12:25:57 (GMT)
commit350b15f9d13fdb33e63d2b9cb09872e22bfbe5c9 (patch)
tree8ef7d3b62be8cc3dae5f48bccb27e53b9c02a0e1 /doc/doxygen-link.py
parent7c620500bbca24c3d18b731756c375a45bb0fcba (diff)
downloadlibnl-350b15f9d13fdb33e63d2b9cb09872e22bfbe5c9.zip
libnl-350b15f9d13fdb33e63d2b9cb09872e22bfbe5c9.tar.gz
libnl-350b15f9d13fdb33e63d2b9cb09872e22bfbe5c9.tar.bz2
Move to asciidoc
The core library documentation has been converted to use asciidoc. It provides better flexibility in creating documentation such as tables and more powerful formatting rules. The doxygen based API reference remains and three scripts have been added to: - gen-tags.sh: extract tag information from doxygen reference - tags2dict.sh: generate a name=link dictionary file - doxygen-link.py: replace all references in the asciidoc documentation refering to API functions, struct, etc. with a link into the doxygen API reference. 'make gendoc' continue to generate all documentation. The following tools are required to generate documentation: - asciidoc - mscgen - asciidoc mscgen plugin - pygments - xmlstarlet
Diffstat (limited to 'doc/doxygen-link.py')
-rwxr-xr-xdoc/doxygen-link.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/doxygen-link.py b/doc/doxygen-link.py
new file mode 100755
index 0000000..fda193c
--- /dev/null
+++ b/doc/doxygen-link.py
@@ -0,0 +1,20 @@
+#!/usr/bin/env python
+
+import fileinput
+import re
+import sys
+
+links = {}
+
+for line in open(sys.argv[1], 'r'):
+ m = re.match('^([^=]+)=([^\n]+)$', line);
+ if m:
+ link = "<a href=\"" + m.group(2) + "\" class=\"dg\">" + m.group(1) + "</a>"
+ links[m.group(1)] = link
+
+def translate(match):
+ return links[match.group(0)]
+
+rc = re.compile('|'.join(map(re.escape, sorted(links, reverse=True))))
+for line in open(sys.argv[2], 'r'):
+ print rc.sub(translate, line),