trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject git commit: doc: add permalinks to records.config variables
Date Fri, 16 Aug 2013 21:32:23 GMT
Updated Branches:
  refs/heads/master eb4e26384 -> 8a0676f3d


doc: add permalinks to records.config variables


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/8a0676f3
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/8a0676f3
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/8a0676f3

Branch: refs/heads/master
Commit: 8a0676f3dce3a7973f82d0453527216d609ece8d
Parents: eb4e263
Author: James Peach <jpeach@apache.org>
Authored: Fri Aug 16 14:30:53 2013 -0700
Committer: James Peach <jpeach@apache.org>
Committed: Fri Aug 16 14:30:53 2013 -0700

----------------------------------------------------------------------
 doc/ext/traffic-server.py | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/8a0676f3/doc/ext/traffic-server.py
----------------------------------------------------------------------
diff --git a/doc/ext/traffic-server.py b/doc/ext/traffic-server.py
index 5911d9c..260b83d 100644
--- a/doc/ext/traffic-server.py
+++ b/doc/ext/traffic-server.py
@@ -56,9 +56,28 @@ class TSConfVar(std.Target):
         cv_scope, cv_name, cv_type = self.arguments[0:3]
         if (len(self.arguments) > 3):
             cv_default = self.arguments[3]
-        title = sphinx.addnodes.desc_name(text=cv_name)
+
+        # First, make a generic desc() node to be the parent.
+        node = sphinx.addnodes.desc()
+        node.document = self.state.document
+        node['objtype'] = 'cv'
+
+        # Next, make a signature node. This creates a permalink and a
+        # highlighted background when the link is selected.
+        title = sphinx.addnodes.desc_signature(cv_name, '')
+        title['ids'].append(nodes.make_id(cv_name))
+        title['names'].append(cv_name)
+        title['first'] = False
+        title['objtype'] = 'cv'
         self.add_name(title)
         title.set_class('ts-cv-title')
+
+        # Finally, add a desc_name() node to display the name of the
+        # configuration variable.
+        title += sphinx.addnodes.desc_name(cv_name, cv_name)
+
+        node.append(title)
+
         if ('class' in self.options):
             title.set_class(self.options.get('class'))
         # This has to be a distinct node before the title. if nested then
@@ -66,7 +85,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(title)
         env.domaindata['ts']['cv'][cv_name] = env.docname
 
         fl = nodes.field_list()
@@ -89,14 +108,12 @@ class TSConfVar(std.Target):
         # 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
-        ]
+        return [ indexnode, node, fl, nn ]
+
 
 class TSConfVarRef(XRefRole):
     def process_link(self, env, ref_node, explicit_title_p, title, target):


Mime
View raw message