2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-15 03:25:42 +00:00

fix a number of A002 cases

This commit is contained in:
Matthias Mair
2024-08-20 00:41:06 +02:00
parent 377a416cbc
commit 78e9de2179
6 changed files with 21 additions and 20 deletions

View File

@ -200,12 +200,13 @@ def define_env(env):
return assets
@env.macro
def includefile(filename: str, title: str, format: str = ''):
def includefile(filename: str, title: str, fmt: str = ''):
"""Include a file in the documentation, in a 'collapse' block.
Arguments:
- filename: The name of the file to include (relative to the top-level directory)
- title:
- fmt:
"""
here = os.path.dirname(__file__)
path = os.path.join(here, '..', filename)
@ -218,7 +219,7 @@ def define_env(env):
content = f.read()
data = f'??? abstract "{title}"\n\n'
data += f' ```{format}\n'
data += f' ```{fmt}\n'
data += textwrap.indent(content, ' ')
data += '\n\n'
data += ' ```\n\n'
@ -233,7 +234,7 @@ def define_env(env):
'src', 'backend', 'InvenTree', 'report', 'templates', filename
)
return includefile(fn, f'Template: {base}', format='html')
return includefile(fn, f'Template: {base}', fmt='html')
@env.macro
def rendersetting(setting: dict):