diff options
author | monster <[email protected]> | 2022-07-07 14:41:37 +0300 |
---|---|---|
committer | monster <[email protected]> | 2022-07-07 14:41:37 +0300 |
commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /build/plugins/docs.py | |
parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) |
fix ya.make
Diffstat (limited to 'build/plugins/docs.py')
-rw-r--r-- | build/plugins/docs.py | 46 |
1 files changed, 0 insertions, 46 deletions
diff --git a/build/plugins/docs.py b/build/plugins/docs.py deleted file mode 100644 index 29f89e9a8eb..00000000000 --- a/build/plugins/docs.py +++ /dev/null @@ -1,46 +0,0 @@ -import json - - -def extract_macro_calls(unit, macro_value_name): - if not unit.get(macro_value_name): - return [] - - return filter(None, unit.get(macro_value_name).replace('$' + macro_value_name, '').split()) - - -def macro_calls_to_dict(unit, calls): - def split_args(arg): - if arg is None: - return None - - kv = filter(None, arg.split('=')) - if len(kv) != 2: - unit.message(['error', 'Invalid variables specification "{}": value expected to be in form %name%=%value% (with no spaces)'.format(arg)]) - return None - - return kv - - return dict(filter(None, map(split_args, calls))) - - -def get_variables(unit): - orig_variables = macro_calls_to_dict(unit, extract_macro_calls(unit, '_DOCS_VARS_VALUE')) - return {k: unit.get(k) or v for k, v in orig_variables.items()} - - -def onprocess_docs(unit, *args): - if unit.enabled('_DOCS_USE_PLANTUML'): - unit.on_docs_yfm_use_plantuml([]) - - if unit.get('_DOCS_DIR_VALUE') == '': - unit.on_yfm_docs_dir([unit.get('_YFM_DOCS_DIR_DEFAULT_VALUE')]) - - variables = get_variables(unit) - if variables: - unit.set(['_DOCS_VARS_FLAG', '--vars {}'.format(json.dumps(json.dumps(variables, sort_keys=True)))]) - - -def onprocess_mkdocs(unit, *args): - variables = get_variables(unit) - if variables: - unit.set(['_DOCS_VARS_FLAG', ' '.join(['--var {}={}'.format(k, v) for k, v in variables.items()])]) |