mirror of
https://github.com/inventree/InvenTree.git
synced 2026-04-25 12:33:33 +00:00
Ensure configuration settings are documented (#11674)
* Export configuration keys to JSON * Support rendering of config options in docs * Check for missing config settings * Simplify macro * Initial tests * Fix collisions * Updates * Ensure values are stringified * Ensure null values are exported correctly * Refactor database config - Observability on the config settings * More docs updates * Updates * Add observability of cache settings * More updates * Observability * Set env config for RTD * Revert RTD config file - Handled by ENV VAR on RTD account * Visibility on background worker settings * Tweaks * Tweaks * Split tracing settings out into separate file - Improved discovery - declutter settings.py * Cleanup LDAP settings * Social providers docs * More updates * Refactor ldap setup into own module * Tweaks * Formatting tweaks * Tweak logic * Fix INVENTREE_SESSION_COOKIE_SECURE setting * Fix wrapping * Add custom default
This commit is contained in:
@@ -1864,8 +1864,13 @@ def export_definitions(c, basedir: str = ''):
|
||||
"""Export various definitions."""
|
||||
if basedir != '' and basedir.endswith('/') is False:
|
||||
basedir += '/'
|
||||
|
||||
base_path = Path(basedir, 'generated').resolve()
|
||||
|
||||
if not base_path.exists():
|
||||
info(f'Creating export directory: {base_path}')
|
||||
base_path.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
filenames = [
|
||||
base_path.joinpath('inventree_settings.json'),
|
||||
base_path.joinpath('inventree_tags.yml'),
|
||||
@@ -2298,12 +2303,19 @@ def doc_schema(c):
|
||||
help={
|
||||
'address': 'Host and port to run the server on (default: localhost:8080)',
|
||||
'compile_schema': 'Compile the API schema documentation first (default: False)',
|
||||
'export_settings': 'Export settings definitions before starting the server (default: True)',
|
||||
}
|
||||
)
|
||||
def docs_server(c, address='localhost:8080', compile_schema=False):
|
||||
def docs_server(
|
||||
c,
|
||||
address='localhost:8080',
|
||||
compile_schema: bool = False,
|
||||
export_settings: bool = True,
|
||||
):
|
||||
"""Start a local mkdocs server to view the documentation."""
|
||||
# Extract settings definitions
|
||||
export_definitions(c, basedir='docs')
|
||||
if export_settings:
|
||||
export_definitions(c, basedir='docs')
|
||||
|
||||
if compile_schema:
|
||||
doc_schema(c)
|
||||
|
||||
Reference in New Issue
Block a user