From 814d373e52c32d887c42230c380cc55fe79e79af Mon Sep 17 00:00:00 2001 From: TetraTheta <37061801+TetraTheta@users.noreply.github.com> Date: Sat, 17 Dec 2022 02:13:12 +0900 Subject: [PATCH 1/6] Add 'cache_safe' to mkdocs-minify-plugin schema --- docs/schema/plugins/external/minify.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/schema/plugins/external/minify.json b/docs/schema/plugins/external/minify.json index d4bff5dae..22b3e242a 100644 --- a/docs/schema/plugins/external/minify.json +++ b/docs/schema/plugins/external/minify.json @@ -24,18 +24,26 @@ "minify_js": { "title": "Minify JavaScript files", "markdownDescription": "https://github.com/byrnereese/mkdocs-minify-plugin#options", - "type": "boolean" + "type": "boolean", + "default": false }, "minify_css": { "title": "Minify CSS files", "markdownDescription": "https://github.com/byrnereese/mkdocs-minify-plugin#options", - "type": "boolean" + "type": "boolean", + "default": false }, "htmlmin_opts": { "title": "Options for HTML minifier", "markdownDescription": "https://github.com/byrnereese/mkdocs-minify-plugin#options", "type": "object" }, + "cache_safe": { + "title": "Add hash to Javascript and CSS file names", + "markdownDescription": "https://github.com/byrnereese/mkdocs-minify-plugin#options", + "type": "boolean", + "default": false + }, "js_files": { "title": "JavaScript files to minify", "markdownDescription": "https://github.com/byrnereese/mkdocs-minify-plugin#options", From 8fe1666ad7a0e55b42529771543fac3c2660ccef Mon Sep 17 00:00:00 2001 From: TetraTheta <37061801+TetraTheta@users.noreply.github.com> Date: Sat, 17 Dec 2022 02:22:18 +0900 Subject: [PATCH 2/6] Add 'literate-nav' plugin scheme --- .../schema/plugins/external/literate-nav.json | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 docs/schema/plugins/external/literate-nav.json diff --git a/docs/schema/plugins/external/literate-nav.json b/docs/schema/plugins/external/literate-nav.json new file mode 100644 index 000000000..53fd6970d --- /dev/null +++ b/docs/schema/plugins/external/literate-nav.json @@ -0,0 +1,27 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "Literate nav plugin", + "type": "object", + "properties": { + "literate-nav": { + "markdownDescription": "https://github.com/oprypin/mkdocs-literate-nav", + "type": "object", + "properties": { + "nav_file": { + "title": "The name of the file to read to determine the navigation for a particular directory under `docs_dir`", + "markdownDescription": "https://oprypin.github.io/mkdocs-literate-nav/reference.html#nav_file", + "type": "string", + "default": "SUMMARY.md" + }, + "implicit_index": { + "title": "If set and a directory has a file named `index.md` or `README.md`, but the literate nav for that directory that never includes it, it will be inserted as the first item of the nav", + "markdownDescription": "https://oprypin.github.io/mkdocs-literate-nav/reference.html#implicit_index", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} From 33e8d48f1fb506db425e1439690b2bfa8ec977ab Mon Sep 17 00:00:00 2001 From: TetraTheta <37061801+TetraTheta@users.noreply.github.com> Date: Sat, 17 Dec 2022 02:35:55 +0900 Subject: [PATCH 3/6] Add 'macros' plugin schema --- docs/schema/plugins/external/macros.json | 56 ++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 docs/schema/plugins/external/macros.json diff --git a/docs/schema/plugins/external/macros.json b/docs/schema/plugins/external/macros.json new file mode 100644 index 000000000..13f9578b2 --- /dev/null +++ b/docs/schema/plugins/external/macros.json @@ -0,0 +1,56 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema", + "title": "Macros plugin", + "type": "object", + "properties": { + "macros": { + "markdownDescription": "", + "type": "object", + "properties": { + "module_name": { + "title": "Name of the Python module containing macros, filters and variables.", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/#configuration-of-the-plugin", + "type": "string", + "default": "main" + }, + "modules": { + "title": "List of preinstalled Python modules, i.e. listed by `pip list`.", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/#configuration-of-the-plugin", + "type": "array" + }, + "include_dir": { + "title": "Directory for including external files", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#changing-the-directory-of-the-includes", + "type": "string" + }, + "include_yaml": { + "title": "List of yaml files or `key: filename` pairs to be included", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#including-external-yaml-files", + "type": "array" + }, + "j2_block_start_string": { + "title": "Non-standard Jinja2 marker for start of block", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", + "type": "string" + }, + "j2_block_end_string": { + "title": "Non-standard Jinja2 marker for end of block", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", + "type": "string" + }, + "j2_variable_start_string": { + "title": "Non-standard Jinja2 marker for start of variable", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", + "type": "string" + }, + "j2_variable_end_string": { + "title": "Non-standard Jinja2 marker for end of variable", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} From 0753df10e98da83556102924679a997dc2bfd9b6 Mon Sep 17 00:00:00 2001 From: TetraTheta <37061801+TetraTheta@users.noreply.github.com> Date: Sat, 17 Dec 2022 02:39:22 +0900 Subject: [PATCH 4/6] Update 'plugins.json' for adding information about newly added schemas --- docs/schema/plugins.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/schema/plugins.json b/docs/schema/plugins.json index 2f287669b..e1066d3fa 100644 --- a/docs/schema/plugins.json +++ b/docs/schema/plugins.json @@ -57,6 +57,12 @@ { "$ref": "plugins/external/git-revision-date.json" }, + { + "$ref": "plugins/external/literate-nav.json" + }, + { + "$ref": "plugins/external/macros.json" + }, { "$ref": "plugins/external/minify.json" }, From ae511115fcc5866727d20669aaee58ca54654557 Mon Sep 17 00:00:00 2001 From: TetraTheta <37061801+TetraTheta@users.noreply.github.com> Date: Sat, 17 Dec 2022 02:50:43 +0900 Subject: [PATCH 5/6] Add 'on_error_fail' to macros schema But it supports '!env' but I don't know how to support it on schema --- docs/schema/plugins/external/macros.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/schema/plugins/external/macros.json b/docs/schema/plugins/external/macros.json index 13f9578b2..80a1f4e74 100644 --- a/docs/schema/plugins/external/macros.json +++ b/docs/schema/plugins/external/macros.json @@ -47,6 +47,12 @@ "title": "Non-standard Jinja2 marker for end of variable", "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", "type": "string" + }, + "on_error_fail": { + "title": "Stop build/serve when macro error happens", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#can-i-make-mkdocs-macros-build-process-to-fail-in-case-of-error-instead-of-displaying-the-error-on-the-page", + "type": "boolean", + "default": false } }, "additionalProperties": false From 65501ffc934f63a507c511f36c9ceee564e61513 Mon Sep 17 00:00:00 2001 From: squidfunk Date: Sat, 17 Dec 2022 23:00:06 +0100 Subject: [PATCH 6/6] Added default variants for plugins to schema --- .../schema/plugins/external/literate-nav.json | 44 ++++--- docs/schema/plugins/external/macros.json | 114 ++++++++++-------- 2 files changed, 89 insertions(+), 69 deletions(-) diff --git a/docs/schema/plugins/external/literate-nav.json b/docs/schema/plugins/external/literate-nav.json index 53fd6970d..3a2f518e4 100644 --- a/docs/schema/plugins/external/literate-nav.json +++ b/docs/schema/plugins/external/literate-nav.json @@ -1,27 +1,37 @@ { "$schema": "http://json-schema.org/draft-07/schema", - "title": "Literate nav plugin", - "type": "object", - "properties": { - "literate-nav": { + "title": "Literate navigation plugin", + "oneOf": [ + { "markdownDescription": "https://github.com/oprypin/mkdocs-literate-nav", + "enum": [ + "literate-nav" + ] + }, + { "type": "object", "properties": { - "nav_file": { - "title": "The name of the file to read to determine the navigation for a particular directory under `docs_dir`", - "markdownDescription": "https://oprypin.github.io/mkdocs-literate-nav/reference.html#nav_file", - "type": "string", - "default": "SUMMARY.md" - }, - "implicit_index": { - "title": "If set and a directory has a file named `index.md` or `README.md`, but the literate nav for that directory that never includes it, it will be inserted as the first item of the nav", - "markdownDescription": "https://oprypin.github.io/mkdocs-literate-nav/reference.html#implicit_index", - "type": "boolean", - "default": false + "literate-nav": { + "markdownDescription": "https://github.com/oprypin/mkdocs-literate-nav", + "type": "object", + "properties": { + "nav_file": { + "title": "The name of the file to read to determine the navigation for a particular directory under `docs_dir`", + "markdownDescription": "https://oprypin.github.io/mkdocs-literate-nav/reference.html#nav_file", + "type": "string", + "default": "SUMMARY.md" + }, + "implicit_index": { + "title": "If set and a directory has a file named `index.md` or `README.md`, but the literate nav for that directory that never includes it, it will be inserted as the first item of the nav", + "markdownDescription": "https://oprypin.github.io/mkdocs-literate-nav/reference.html#implicit_index", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false } }, "additionalProperties": false } - }, - "additionalProperties": false + ] } diff --git a/docs/schema/plugins/external/macros.json b/docs/schema/plugins/external/macros.json index 80a1f4e74..450118c62 100644 --- a/docs/schema/plugins/external/macros.json +++ b/docs/schema/plugins/external/macros.json @@ -1,62 +1,72 @@ { "$schema": "http://json-schema.org/draft-07/schema", "title": "Macros plugin", - "type": "object", - "properties": { - "macros": { - "markdownDescription": "", + "oneOf": [ + { + "markdownDescription": "https://github.com/oprypin/mkdocs-literate-nav", + "enum": [ + "literate-nav" + ] + }, + { "type": "object", "properties": { - "module_name": { - "title": "Name of the Python module containing macros, filters and variables.", - "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/#configuration-of-the-plugin", - "type": "string", - "default": "main" - }, - "modules": { - "title": "List of preinstalled Python modules, i.e. listed by `pip list`.", - "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/#configuration-of-the-plugin", - "type": "array" - }, - "include_dir": { - "title": "Directory for including external files", - "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#changing-the-directory-of-the-includes", - "type": "string" - }, - "include_yaml": { - "title": "List of yaml files or `key: filename` pairs to be included", - "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#including-external-yaml-files", - "type": "array" - }, - "j2_block_start_string": { - "title": "Non-standard Jinja2 marker for start of block", - "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", - "type": "string" - }, - "j2_block_end_string": { - "title": "Non-standard Jinja2 marker for end of block", - "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", - "type": "string" - }, - "j2_variable_start_string": { - "title": "Non-standard Jinja2 marker for start of variable", - "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", - "type": "string" - }, - "j2_variable_end_string": { - "title": "Non-standard Jinja2 marker for end of variable", - "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", - "type": "string" - }, - "on_error_fail": { - "title": "Stop build/serve when macro error happens", - "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#can-i-make-mkdocs-macros-build-process-to-fail-in-case-of-error-instead-of-displaying-the-error-on-the-page", - "type": "boolean", - "default": false + "macros": { + "markdownDescription": "", + "type": "object", + "properties": { + "module_name": { + "title": "Name of the Python module containing macros, filters and variables", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/#configuration-of-the-plugin", + "type": "string", + "default": "main" + }, + "modules": { + "title": "List of preinstalled Python modules, i.e. listed by `pip list`", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/#configuration-of-the-plugin", + "type": "array" + }, + "include_dir": { + "title": "Directory for including external files", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#changing-the-directory-of-the-includes", + "type": "string" + }, + "include_yaml": { + "title": "List of yaml files or `key: filename` pairs to be included", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#including-external-yaml-files", + "type": "array" + }, + "j2_block_start_string": { + "title": "Non-standard Jinja2 marker for start of block", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", + "type": "string" + }, + "j2_block_end_string": { + "title": "Non-standard Jinja2 marker for end of block", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", + "type": "string" + }, + "j2_variable_start_string": { + "title": "Non-standard Jinja2 marker for start of variable", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", + "type": "string" + }, + "j2_variable_end_string": { + "title": "Non-standard Jinja2 marker for end of variable", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#solution-4-altering-the-syntax-of-jinja2-for-mkdocs-macros", + "type": "string" + }, + "on_error_fail": { + "title": "Stop build/serve when macro error happens", + "markdownDescription": "https://mkdocs-macros-plugin.readthedocs.io/en/latest/advanced/#can-i-make-mkdocs-macros-build-process-to-fail-in-case-of-error-instead-of-displaying-the-error-on-the-page", + "type": "boolean", + "default": false + } + }, + "additionalProperties": false } }, "additionalProperties": false } - }, - "additionalProperties": false + ] }