summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2015-11-22 23:43:36 -0500
committerSven Eden <yamakuzure@gmx.net>2017-05-17 15:22:14 +0200
commit9ac0cc095b2d17cd0029048d902ff7b5e353e23e (patch)
treef3b54bd4b3036a5aadceea82f06dca046615e707 /tools
parentc3911d51469ebfc35075b48ef37ea57742731059 (diff)
man: include the target name when linking to man pages in html output
Links like http://www.freedesktop.org/software/elogind/man/elogind.socket.html are changed to http://www.freedesktop.org/software/elogind/man/elogind.socket.html#Accept=. This implementation is quick & dirty, and misses various corner cases. A fairly important one is that when a few directives share the same anchor (which happens when multiple directives are described in the same paragraph), generated links for everything except the first one link to an invalid anchor. Another shortcoming is that the formatting does not use the proper generateID machinery, so the anchor name could be wrong in some cases. But it seems to work for a large percentage of links, so seems to be an improvement in usability. When the anchor is missing, we land at the top of the page, which is the same as before. If the anchor were to point to different spot, this would be more confusing... Not sure if that ever happens. Anyway, the user should be able to recover from landing on the wrong place in the page. (Mostly) fixes https://github.com/elogind/elogind/issues/1956.
Diffstat (limited to 'tools')
-rwxr-xr-xtools/make-directive-index.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/make-directive-index.py b/tools/make-directive-index.py
index 5abcac84d..193f7416f 100755
--- a/tools/make-directive-index.py
+++ b/tools/make-directive-index.py
@@ -195,6 +195,7 @@ def _make_section(template, name, directives, formatting):
b = tree.SubElement(para, 'citerefentry')
c = tree.SubElement(b, 'refentrytitle')
c.text = manpage
+ c.attrib['target'] = varname
d = tree.SubElement(b, 'manvolnum')
d.text = manvolume
entry.tail = '\n\n'