aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnermolaev <snermolaev@yandex-team.com>2024-03-20 04:53:09 +0300
committersnermolaev <snermolaev@yandex-team.com>2024-03-20 05:04:40 +0300
commit796e35f1c3e479658c299107de28b51408e6997c (patch)
tree9dac4dea6ba35235b9d969a8f15d28a1b1338e53
parent51abdcf4bfdd1b9ca77966c06289d099f59c1af1 (diff)
downloadydb-796e35f1c3e479658c299107de28b51408e6997c.tar.gz
move MKDOCS module to build/internal/conf/docs.conf
88f7386589f692e03986516255e45757237a5fd5
-rw-r--r--build/conf/docs.conf96
-rw-r--r--build/plugins/docs.py9
2 files changed, 1 insertions, 104 deletions
diff --git a/build/conf/docs.conf b/build/conf/docs.conf
index 6a4c3b5805..a5f611da2f 100644
--- a/build/conf/docs.conf
+++ b/build/conf/docs.conf
@@ -217,95 +217,8 @@ multimodule DOCS {
}
}
-_DOCS_FS_TOOLS=$YMAKE_PYTHON3 ${input:"build/scripts/fs_tools.py"} ${input;hide:"build/scripts/process_command_files.py"}
-
-_DOCS_MKDOCS_CMDLINE_SUFFIX=
-_DOCS_MKDOCS_BOOK_CMDLINE_SUFFIX=${pre=--dep ;ext=preprocessed.tar.gz:PEERS}
-_DOCS_MKDOCS_LIB_CMDLINE_SUFFIX=--preprocess-md-only
-
-_DOCS_MKDOCS_CMDLINE=\
-${cwd:ARCADIA_ROOT} $_DOCS_FS_TOOLS copy_all_files $_MKDOCS_DOCS_DIR_VALUE $BINDIR/__s $_DOCS_IMPLICIT_SRCS_VALUE \
-&& $YMAKE_PYTHON3 ${input:"build/scripts/copy_files_to_dir.py"} ${input;hide:"build/scripts/process_command_files.py"} --dest-dir $BINDIR/__s --skip-prefix $ARCADIA_ROOT --skip-prefix $ARCADIA_BUILD_ROOT ${input;context=TEXT:INCLUDE_SRCS} \
-&& ${cwd:BINDIR} $YMAKE_PYTHON3 ${input:"build/scripts/mkdocs_builder_wrapper.py"} $ARCADIA_BUILD_ROOT ${tool:"tools/mkdocs_builder"} --docs-dir $BINDIR/__s --output-tar $TARGET --config ${input:CONFIG} $_DOCS_VARS_FLAG $_DOCS_MKDOCS_CMDLINE_SUFFIX $_DOCS_EXTRA_TOOLS ${hide;input:EXTRA_INPUTS} $_DOCS_ENV $_DOCS_KV
-
-# tag:internal tag:docs
-macro _DOCS_MKDOCS_CMD_IMPL(CONFIG, INCLUDE_SRCS[], EXTRA_INPUTS[]) {
- .CMD=$_DOCS_MKDOCS_CMDLINE
-}
-
-_DOCS_MKDOCS_CMD=$_DOCS_MKDOCS_CMD_IMPL($_DOCS_CONFIG_VALUE INCLUDE_SRCS $_DOCS_INCLUDE_SOURCES_VALUE)
-
+# tag:docs tag:internal
_DOCS_YFM_DEFAULT_CONFIG=$MODDIR/.yfm
-_DOCS_MKDOCS_DEFAULT_CONFIG=$MODDIR/mkdocs.yml
-
-# tag:docs
-### This module is intended for internal use only. Common parts for submodules of MKDOCS multimodule
-### should be defined here.
-module _MKDOCS_BASE_UNIT: _DOCS_BARE_UNIT {
- .ALIASES=DOCS_DIR=_MKDOCS_DOCS_DIR
-
- ENABLE(_MKDOCS_BASE_UNIT)
-
- DOCS_CONFIG($_DOCS_MKDOCS_DEFAULT_CONFIG)
-}
-
-# tag:internal tag:docs
-### _MKDOCS_EPILOOGUE() # internal
-###
-### This macro executes macros which should be envoked after all user
-### specified macros in the ya.make file
-macro _MKDOCS_EPILOGUE() {
- _LATE_GLOB(_DOCS_SRCS_GLOB ${pre=${ARCADIA_ROOT}/;suf=/**/*:_MKDOCS_DOCS_DIR_VALUE})
- SET(_DOCS_IMPLICIT_SRCS_VALUE \${input;hide:_DOCS_SRCS_GLOB})
-}
-
-# tag:docs
-### @usage: MKDOCS()
-###
-### Documentation project multimodule.
-###
-### When built directly, via RECURSE, DEPENDS or BUNDLE the output artifact is docs.tar.gz with statically generated site (using mkdocs as builder).
-### When PEERDIRed from other MKDOCS() module behaves like a UNION (supplying own content and dependencies to build target).
-### Peerdirs from modules other than MKDOCS are not accepted.
-### Most usual macros are not accepted, only used with the macros DOCS_DIR(), DOCS_CONFIG(), DOCS_VARS().
-###
-### @see: [DOCS_DIR()](#macro_DOCS_DIR), [DOCS_CONFIG()](#macro_DOCS_CONFIG), [DOCS_VARS()](#macro_DOCS_VARS).
-multimodule MKDOCS {
- module MKDOCSBOOK: _MKDOCS_BASE_UNIT {
- .CMD=_DOCS_MKDOCS_CMD
- .EPILOGUE=_MKDOCS_EPILOGUE
- .FINAL_TARGET=yes
- .PEERDIR_POLICY=as_build_from
-
- ENABLE(MKDOCSBOOK)
-
- SET(MODULE_TYPE PROGRAM)
- SET(PEERDIR_TAGS MKDOCSLIB)
- SET(MODULE_TAG MKDOCSBOOK)
-
- _DOCS_MKDOCS_CMDLINE_SUFFIX=$_DOCS_MKDOCS_BOOK_CMDLINE_SUFFIX
-
- PROCESS_MKDOCS()
- }
-
- module MKDOCSLIB: _MKDOCS_BASE_UNIT {
- .CMD=_DOCS_MKDOCS_CMD
- .EPILOGUE=_MKDOCS_EPILOGUE
- .PEERDIR_POLICY=as_include
-
- ENABLE(MKDOCSLIB)
-
- SET(MODULE_TYPE LIBRARY)
- SET(PEERDIR_TAGS MKDOCSLIB)
- SET(MODULE_TAG MKDOCSLIB)
-
- REALPRJNAME=preprocessed
-
- _DOCS_MKDOCS_CMDLINE_SUFFIX=$_DOCS_MKDOCS_LIB_CMDLINE_SUFFIX
-
- PROCESS_MKDOCS()
- }
-}
# tag:docs
_DOCS_USE_PLANTUML=
@@ -358,13 +271,6 @@ macro _YFM_DOCS_DIR(DIR) {
SET(_YFM_DOCS_DIR_DEFAULT_VALUE __dummy_dir__)
}
-# tag:docs tag:internal
-_MKDOCS_DOCS_DIR_VALUE=$MODDIR
-### @usage: DOCS_DIR(path) # internal
-macro _MKDOCS_DOCS_DIR(Dir) {
- SET(_MKDOCS_DOCS_DIR_VALUE $Dir)
-}
-
# tag:docs
_DOCS_DEFAULT_CONFIG=
_DOCS_CONFIG_VALUE=$_DOCS_DEFAULT_CONFIG
diff --git a/build/plugins/docs.py b/build/plugins/docs.py
index 85bdfdcbc1..bced1127a7 100644
--- a/build/plugins/docs.py
+++ b/build/plugins/docs.py
@@ -1,5 +1,4 @@
import json
-import six
def extract_macro_calls(unit, macro_value_name):
@@ -46,11 +45,3 @@ def onprocess_docs(unit, *args):
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 sorted(six.iteritems(variables))])]
- )