MCPcopy Create free account
hub / github.com/apache/trafficserver / run

Method run

doc/ext/extras/txnbox.cmake.in.py:170–222  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

168
169 # External entry point
170 def run(self):
171 env = self.state.document.settings.env
172 txb_name = self.arguments[0]
173 txb_id = nodes.make_id(txb_name)
174
175 # First, make a generic desc() node to be the parent.
176 node = sphinx.addnodes.desc()
177 node.document = self.state.document
178 node['objtype'] = 'extractor'
179
180 # Next, make a signature node. This creates a permalink and a highlighted background when the link is selected.
181 title = sphinx.addnodes.desc_signature(txb_name, '')
182 title['ids'].append(txb_id)
183 title['names'].append(txb_name)
184 title['first'] = False
185 title['objtype'] = 'extractor'
186 self.add_name(title)
187 title['classes'].append('directive-title')
188
189 # Finally, add a desc_name() node to display the name of the
190 # configuration variable.
191 title += sphinx.addnodes.desc_name(txb_name, txb_name)
192
193 node.append(title)
194
195 if ('class' in self.options):
196 title['classes'].append(self.options.get('class'))
197
198 # This has to be a distinct node before the title. if nested then the browser will scroll forward to just past the title.
199 anchor = nodes.target('', '', names=[txb_name])
200 # Second (optional) arg is 'msgNode' - no idea what I should pass for that
201 # or if it even matters, although I now think it should not be used.
202 self.state.document.note_explicit_target(title)
203 env.domaindata['txb']['extractor'][txb_name] = env.docname
204
205 fl = nodes.field_list()
206 if ('result' in self.options):
207 fl.append(self.make_field('Result', sphinx.addnodes.literal_emphasis(text=self.options['result'])))
208
209
210# fl.append(self.make_field('Result', self.options['result']))
211 if ('arg' in self.options):
212 fl.append(self.make_field('Argument', self.options['arg']))
213
214 # Get any contained content
215 nn = nodes.compound()
216 self.state.nested_parse(self.content, self.content_offset, nn)
217
218 # Create an index node so that Sphinx adds this directive to the index.
219 indexnode = sphinx.addnodes.index(entries=[])
220 indexnode['entries'].append(('single', _('%s') % txb_name, txb_id, '', ''))
221
222 return [indexnode, node, fl, nn]
223
224
225class TxbDirectiveRef(XRefRole):

Callers

nothing calls this directly

Calls 4

indexMethod · 0.80
appendMethod · 0.45
getMethod · 0.45
make_fieldMethod · 0.45

Tested by

no test coverage detected