Skip to content

Commit 482d36c

Browse files
committed
Add HTTP resources to TOC
1 parent 005bbbb commit 482d36c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

sphinxcontrib/httpdomain.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,21 @@ def add_target_and_index(self, name_cls, sig, signode):
351351
def get_index_text(self, modname, name):
352352
return ''
353353

354+
def _object_hierarchy_parts(self, sig_node):
355+
if 'fullname' not in sig_node:
356+
return ()
357+
path = sig_node.get('path')
358+
method = sig_node.get('method')
359+
if not path or not sig_node:
360+
return ()
361+
return tuple(path.split('/')) + (method, sig_node['fullname'])
362+
363+
def _toc_entry_name(self, sig_node):
364+
if not sig_node.get('_toc_parts'):
365+
return ''
366+
367+
return sig_node['_toc_parts'][-1]
368+
354369

355370
class HTTPOptions(HTTPResource):
356371

0 commit comments

Comments
 (0)