diff options
author | snermolaev <snermolaev@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:53 +0300 |
commit | 7353a3fdea9c67c256980c00a2b3b67f09b23a27 (patch) | |
tree | 1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /build/plugins/docs.py | |
parent | 2015790ac9fcc04caab83fccc23ab2460310a797 (diff) | |
download | ydb-7353a3fdea9c67c256980c00a2b3b67f09b23a27.tar.gz |
Restoring authorship annotation for <snermolaev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'build/plugins/docs.py')
-rw-r--r-- | build/plugins/docs.py | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/build/plugins/docs.py b/build/plugins/docs.py index d656ec876df..760fe3af7f7 100644 --- a/build/plugins/docs.py +++ b/build/plugins/docs.py @@ -24,21 +24,21 @@ def macro_calls_to_dict(unit, calls): def onprocess_docs(unit, *args): - build_tool = unit.get('_DOCS_BUILDER_VALUE') - if build_tool: - if build_tool not in ['mkdocs', 'yfm']: - unit.message(['error', 'Unsupported build tool {}'.format(build_tool)]) + build_tool = unit.get('_DOCS_BUILDER_VALUE') + if build_tool: + if build_tool not in ['mkdocs', 'yfm']: + unit.message(['error', 'Unsupported build tool {}'.format(build_tool)]) else: - build_tool = 'yfm' - unit.ondocs_builder([build_tool]) - if build_tool == 'yfm' and unit.enabled('_DOCS_USE_PLANTUML'): - unit.on_docs_yfm_use_plantuml([]) - orig_variables = macro_calls_to_dict(unit, extract_macro_calls(unit, '_DOCS_VARS_VALUE')) - variables = {k: unit.get(k) or v for k, v in orig_variables.items()} - if variables: - if build_tool == 'mkdocs': - unit.set(['_DOCS_VARS_FLAG', ' '.join(['--var {}={}'.format(k, v) for k, v in variables.items()])]) - elif build_tool == 'yfm': - unit.set(['_DOCS_VARS_FLAG', '--vars {}'.format(json.dumps(json.dumps(variables, sort_keys=True)))]) - else: - assert False, 'Unexpected build_tool value: [{}]'.format(build_tool) + build_tool = 'yfm' + unit.ondocs_builder([build_tool]) + if build_tool == 'yfm' and unit.enabled('_DOCS_USE_PLANTUML'): + unit.on_docs_yfm_use_plantuml([]) + orig_variables = macro_calls_to_dict(unit, extract_macro_calls(unit, '_DOCS_VARS_VALUE')) + variables = {k: unit.get(k) or v for k, v in orig_variables.items()} + if variables: + if build_tool == 'mkdocs': + unit.set(['_DOCS_VARS_FLAG', ' '.join(['--var {}={}'.format(k, v) for k, v in variables.items()])]) + elif build_tool == 'yfm': + unit.set(['_DOCS_VARS_FLAG', '--vars {}'.format(json.dumps(json.dumps(variables, sort_keys=True)))]) + else: + assert False, 'Unexpected build_tool value: [{}]'.format(build_tool) |