From d3ba2008f9b1ddd896993ab98e14ba34bf658dee Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 23 Jan 2023 13:55:21 +0000 Subject: [PATCH] Improve JSON Schema Related: https://github.com/ansible/devtools/issues/86 --- docs/schema.json | 7 +++ docs/schema/extensions/markdown.json | 8 +++ docs/schema/extensions/pymdownx.json | 52 ++++++++++++++++++- docs/schema/plugins.json | 6 +++ docs/schema/plugins/external/gen-files.json | 28 ++++++++++ .../plugins/external/section-index.json | 19 +++++++ 6 files changed, 118 insertions(+), 2 deletions(-) create mode 100644 docs/schema/plugins/external/gen-files.json create mode 100644 docs/schema/plugins/external/section-index.json diff --git a/docs/schema.json b/docs/schema.json index 5aa39981885..d04afb3541b 100644 --- a/docs/schema.json +++ b/docs/schema.json @@ -153,6 +153,13 @@ }, "nav": { "$ref": "schema/nav.json" + }, + "watch": { + "items": { + "title": "Path to watch for changes", + "type": "string" + }, + "type": "array" } }, "additionalProperties": false diff --git a/docs/schema/extensions/markdown.json b/docs/schema/extensions/markdown.json index 271b2660730..a1275d5bae3 100644 --- a/docs/schema/extensions/markdown.json +++ b/docs/schema/extensions/markdown.json @@ -27,6 +27,14 @@ "attr_list" ] }, + { + "title": "Markdown extension: a classier syntax for admonitions", + "markdownDescription": "https://github.com/oprypin/markdown-callouts", + "enum": [ + "markdown.extensions.callouts", + "callouts" + ] + }, { "title": "Definition Lists – Python Markdown", "markdownDescription": "https://squidfunk.github.io/mkdocs-material/setup/extensions/python-markdown/#definition-lists", diff --git a/docs/schema/extensions/pymdownx.json b/docs/schema/extensions/pymdownx.json index bda22c5a05b..a7f4722f08f 100644 --- a/docs/schema/extensions/pymdownx.json +++ b/docs/schema/extensions/pymdownx.json @@ -324,18 +324,66 @@ "markdownDescription": "https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/", "type": "object", "properties": { + "hide_protocol":{ + "markdownDescription": "https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/#options", + "type": "boolean", + "default": false + }, + "labels": { + "markdownDescription": "https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/#labels", + "type": "object", + "default": { + "commit": "Commit", + "compare": "Compare", + "issue": "Issue", + "pull": "Pull Request", + "mention": "User", + "repository": "Repository" + } + }, + "normalize_issue_symbols": { + "markdownDescription": "https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/#options", + "type": "boolean", + "default": false + }, "user": { "markdownDescription": "https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/#options", - "type": "string" + "type": "string", + "default": "" + }, + "provider": { + "markdownDescription": "https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/#options", + "type": "string", + "default": "github" }, "repo": { "markdownDescription": "https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/#options", - "type": "string" + "type": "string", + "repo": "" }, "repo_url_shorthand": { "markdownDescription": "https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/#options", "type": "boolean", "default": true + }, + "repo_url_shortener": { + "markdownDescription": "https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/#options", + "type": "boolean", + "default": false + }, + "social_url_shorthand": { + "markdownDescription": "https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/#options", + "type": "boolean", + "default": false + }, + "social_url_shortener": { + "markdownDescription": "https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/#options", + "type": "boolean", + "default": false + }, + "shortener_user_exclude": { + "markdownDescription": "https://facelessuser.github.io/pymdown-extensions/extensions/magiclink/#user-excludes", + "type": "object" } }, "additionalProperties": false, diff --git a/docs/schema/plugins.json b/docs/schema/plugins.json index 45f5ccfb54e..4b826dc1031 100644 --- a/docs/schema/plugins.json +++ b/docs/schema/plugins.json @@ -51,6 +51,9 @@ "external": { "description": "External plugins, schema provided by us", "oneOf": [ + { + "$ref": "plugins/external/gen-files.json" + }, { "$ref": "plugins/external/git-authors.json" }, @@ -71,6 +74,9 @@ }, { "$ref": "plugins/external/redirects.json" + }, + { + "$ref": "plugins/external/section-index.json" } ] }, diff --git a/docs/schema/plugins/external/gen-files.json b/docs/schema/plugins/external/gen-files.json new file mode 100644 index 00000000000..92b2ce06141 --- /dev/null +++ b/docs/schema/plugins/external/gen-files.json @@ -0,0 +1,28 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema", + "title": "MkDocs plugin to programmatically generate documentation pages during the build", + "oneOf": [ + { + "markdownDescription": "https://github.com/oprypin/mkdocs-gen-files", + "enum": [ + "git-authors" + ] + }, + { + "type": "object", + "properties": { + "gen-files": { + "additionalProperties": false, + "properties": { + "scripts": { + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": ["object", "null"] + } + } + }] +} diff --git a/docs/schema/plugins/external/section-index.json b/docs/schema/plugins/external/section-index.json new file mode 100644 index 00000000000..da191bcb4f8 --- /dev/null +++ b/docs/schema/plugins/external/section-index.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema", + "title": "MkDocs plugin to allow clickable sections that lead to an index page", + "oneOf": [ + { + "markdownDescription": "https://github.com/oprypin/mkdocs-section-index", + "enum": [ + "section-index" + ] + }, + { + "type": "object", + "additionalProperties": false, + "properties": { + "section-index": { + } + } + }] +}