mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Implement indentation for :ffdoc:
This commit is contained in:
parent
c55e66a40a
commit
ec445d6c32
@ -33,7 +33,12 @@ def formatter_funcs():
|
|||||||
ffml = FFMLProcessor()
|
ffml = FFMLProcessor()
|
||||||
all_funcs = formatter_functions().get_builtins()
|
all_funcs = formatter_functions().get_builtins()
|
||||||
for func_name, func in all_funcs.items():
|
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()
|
db.close()
|
||||||
del db
|
del db
|
||||||
return ans
|
return ans
|
||||||
|
@ -77,6 +77,7 @@ def generate_template_language_help(language):
|
|||||||
a(f'.. class:: {func.__class__.__name__}\n\n')
|
a(f'.. class:: {func.__class__.__name__}\n\n')
|
||||||
a(ffml.document_to_rst(func.doc, name))
|
a(ffml.document_to_rst(func.doc, name))
|
||||||
a('\n\n')
|
a('\n\n')
|
||||||
|
db.close()
|
||||||
del db
|
del db
|
||||||
|
|
||||||
a(POSTAMBLE)
|
a(POSTAMBLE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user