Skip to content

Commit

Permalink
Implement indentation for :ffdoc:
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Nov 11, 2024
1 parent c55e66a commit ec445d6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion manual/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ def formatter_funcs():
ffml = FFMLProcessor()
all_funcs = formatter_functions().get_builtins()
for func_name, func in all_funcs.items():
ans[func_name] = ffml.document_to_rst(func.doc, func_name)
text = ffml.document_to_rst(func.doc, func_name)
# indent the text since :ffdoc: is used inside lists
# if we need no indent we can create a new role like
# :ffdoc-no-indent:
text = '\n '.join(text.splitlines())
ans[func_name] = text.strip()
db.close()
del db
return ans
Expand Down
1 change: 1 addition & 0 deletions manual/template_ref_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def generate_template_language_help(language):
a(f'.. class:: {func.__class__.__name__}\n\n')
a(ffml.document_to_rst(func.doc, name))
a('\n\n')
db.close()
del db

a(POSTAMBLE)
Expand Down

0 comments on commit ec445d6

Please sign in to comment.