From 6b3accd2a77c99b8f53badb94f673a310ccf143f Mon Sep 17 00:00:00 2001 From: Adrian Rumpold Date: Tue, 21 Nov 2023 16:01:30 +0100 Subject: [PATCH 1/2] Add mkdocs.yml JSON schema support for sane_lists and Neoteroi markdown extensions --- docs/schema/extensions.json | 3 +++ docs/schema/extensions/external/neoteroi.json | 27 +++++++++++++++++++ docs/schema/extensions/markdown.json | 8 ++++++ 3 files changed, 38 insertions(+) create mode 100644 docs/schema/extensions/external/neoteroi.json diff --git a/docs/schema/extensions.json b/docs/schema/extensions.json index 50bb5fc5c72..a237216d8f9 100644 --- a/docs/schema/extensions.json +++ b/docs/schema/extensions.json @@ -10,6 +10,9 @@ }, { "$ref": "extensions/pymdownx.json" + }, + { + "$ref": "extensions/external/neoteroi.json" } ] }, diff --git a/docs/schema/extensions/external/neoteroi.json b/docs/schema/extensions/external/neoteroi.json new file mode 100644 index 00000000000..de9543663ca --- /dev/null +++ b/docs/schema/extensions/external/neoteroi.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema", + "title": "Neoteroi markdown extensions", + "markdownDescription": "https://www.neoteroi.dev/mkdocs-plugins", + "oneOf": [ + { + "title": "Cards – Neoteroi Markdown", + "markdownDescription": "https://www.neoteroi.dev/mkdocs-plugins/cards/", + "const": "neoteroi.cards" + }, + { + "title": "Timeline – Neoteroi Markdown", + "markdownDescription": "https://www.neoteroi.dev/mkdocs-plugins/timeline/", + "const": "neoteroi.timeline" + }, + { + "title": "Gantt – Neoteroi Markdown", + "markdownDescription": "https://www.neoteroi.dev/mkdocs-plugins/gantt/", + "const": "neoteroi.projects" + }, + { + "title": "Spantable – Neoteroi Markdown", + "markdownDescription": "https://www.neoteroi.dev/mkdocs-plugins/spantable/", + "const": "neoteroi.spantable" + } + ] +} diff --git a/docs/schema/extensions/markdown.json b/docs/schema/extensions/markdown.json index 0de7f1fbada..746040fafca 100644 --- a/docs/schema/extensions/markdown.json +++ b/docs/schema/extensions/markdown.json @@ -59,6 +59,14 @@ "md_in_html" ] }, + { + "title": "Sane Lists – Python Markdown", + "markdownDescription": "https://python-markdown.github.io/extensions/sane_lists/", + "enum": [ + "markdown.extensions.sane_lists", + "sane_lists" + ] + }, { "title": "Tables – Python Markdown", "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/#tables", From 3d76c8948305f698f41aa3f87758f8dc661ea0c3 Mon Sep 17 00:00:00 2001 From: Adrian Rumpold Date: Wed, 22 Nov 2023 08:03:04 +0100 Subject: [PATCH 2/2] Replace Neoteroi markdown extensions schema with external URL --- docs/schema/extensions.json | 32 +++++++++++++++---- docs/schema/extensions/external/neoteroi.json | 27 ---------------- 2 files changed, 25 insertions(+), 34 deletions(-) delete mode 100644 docs/schema/extensions/external/neoteroi.json diff --git a/docs/schema/extensions.json b/docs/schema/extensions.json index a237216d8f9..6e4b128b597 100644 --- a/docs/schema/extensions.json +++ b/docs/schema/extensions.json @@ -4,18 +4,36 @@ "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/extensions/", "type": "array", "items": { - "oneOf": [ + "anyOf": [ { - "$ref": "extensions/markdown.json" + "$ref": "#/$defs/external" }, { - "$ref": "extensions/pymdownx.json" - }, - { - "$ref": "extensions/external/neoteroi.json" + "$ref": "#/$defs/external-community" } ] }, "uniqueItems": true, - "minItems": 1 + "minItems": 1, + "$defs": { + "external": { + "description": "External markdown extensions, schema provided by us", + "anyOf": [ + { + "$ref": "extensions/markdown.json" + }, + { + "$ref": "extensions/pymdownx.json" + } + ] + }, + "external-community": { + "description": "External markdown extensions, schema provided by our community", + "anyOf": [ + { + "$ref": "https://raw.githubusercontent.com/Neoteroi/mkdocs-plugins/main/docs/extensions-schema.json" + } + ] + } + } } diff --git a/docs/schema/extensions/external/neoteroi.json b/docs/schema/extensions/external/neoteroi.json deleted file mode 100644 index de9543663ca..00000000000 --- a/docs/schema/extensions/external/neoteroi.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft-07/schema", - "title": "Neoteroi markdown extensions", - "markdownDescription": "https://www.neoteroi.dev/mkdocs-plugins", - "oneOf": [ - { - "title": "Cards – Neoteroi Markdown", - "markdownDescription": "https://www.neoteroi.dev/mkdocs-plugins/cards/", - "const": "neoteroi.cards" - }, - { - "title": "Timeline – Neoteroi Markdown", - "markdownDescription": "https://www.neoteroi.dev/mkdocs-plugins/timeline/", - "const": "neoteroi.timeline" - }, - { - "title": "Gantt – Neoteroi Markdown", - "markdownDescription": "https://www.neoteroi.dev/mkdocs-plugins/gantt/", - "const": "neoteroi.projects" - }, - { - "title": "Spantable – Neoteroi Markdown", - "markdownDescription": "https://www.neoteroi.dev/mkdocs-plugins/spantable/", - "const": "neoteroi.spantable" - } - ] -}