Updated Branches: refs/heads/master dfba93de1 -> eb4e26384
doc: add configuration variables to the index Add configuration variables to the Sphinx index. I don't know whether I'm doing this right, but I beat Sphinx. In your face, Sphinx! Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a0d96c58 Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a0d96c58 Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a0d96c58 Branch: refs/heads/master Commit: a0d96c5877dfe4066cb410eafb1c873da6b325ac Parents: dfba93d Author: James Peach <[email protected]> Authored: Fri Aug 16 12:57:12 2013 -0700 Committer: James Peach <[email protected]> Committed: Fri Aug 16 12:57:12 2013 -0700 ---------------------------------------------------------------------- doc/ext/traffic-server.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a0d96c58/doc/ext/traffic-server.py ---------------------------------------------------------------------- diff --git a/doc/ext/traffic-server.py b/doc/ext/traffic-server.py index f87feea..5911d9c 100644 --- a/doc/ext/traffic-server.py +++ b/doc/ext/traffic-server.py @@ -66,7 +66,7 @@ class TSConfVar(std.Target): anchor = nodes.target('', '', names=[cv_name]) # Second (optional) arg is 'msgNode' - no idea what I should pass for that # or if it even matters, although I now think it should not be used. - self.state.document.note_explicit_target(anchor); + self.state.document.note_explicit_target(anchor) env.domaindata['ts']['cv'][cv_name] = env.docname fl = nodes.field_list() @@ -85,7 +85,18 @@ class TSConfVar(std.Target): nn = nodes.compound(); self.state.nested_parse(self.content, self.content_offset, nn) - return [ anchor, title, fl, nn ] + # Create an index node so that Sphinx adds this config variable to the + # index. nodes.make_id() specifies the link anchor name that is + # implicitly generated by the anchor node above. + indexnode = sphinx.addnodes.index(entries=[]) + indexnode['ids'].append(cv_name) + indexnode['entries'].append( + ('single', _('%s') % cv_name, nodes.make_id(cv_name), '') + ) + + return [ + indexnode, anchor, title, fl, nn + ] class TSConfVarRef(XRefRole): def process_link(self, env, ref_node, explicit_title_p, title, target):
