Skip to content

Commit

Permalink
Merge pull request #27 from oliver-sanders/conf-tree-meta
Browse files Browse the repository at this point in the history
cylc_lang: handle inheritance in configuration documentation
  • Loading branch information
wxtim authored Jun 1, 2020
2 parents 9222d14 + 44f4910 commit e34e43d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions cylc/sphinx_ext/cylc_lang/autodocumenters.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,14 @@ def doc_setting(item):


def doc_section(item):
fields = {}
if item.meta:
fields['Inherits'] = f':cylc:conf:`{repr(item.meta)}`'
return directive(
'cylc:section',
[item.display_name],
{},
{},
fields,
item.desc
)

Expand All @@ -187,13 +190,13 @@ def doc_spec(spec):
ret.extend(
doc_conf(item)
)
elif item.is_leaf():
elif item.is_leaf() and not item.meta:
# setting
ret.extend([
indent(line, ' ' * level)
for line in doc_setting(item)
])
else:
elif not item.is_leaf():
# section
ret.extend([
indent(line, ' ' * level)
Expand Down

0 comments on commit e34e43d

Please sign in to comment.