Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VSCode yaml.schemas does not support open-in-new-tab #5

Open
sebpretzer opened this issue Jun 12, 2024 · 4 comments
Open

VSCode yaml.schemas does not support open-in-new-tab #5

sebpretzer opened this issue Jun 12, 2024 · 4 comments

Comments

@sebpretzer
Copy link

Issue:

I am using VSCode Intellisense to validate mkdocs.yml, as described here: https://squidfunk.github.io/mkdocs-material/creating-your-site/#minimal-configuration for .vscode/settings.json:

"yaml.schemas": {
        "https://squidfunk.github.io/mkdocs-material/schema.json": "mkdocs.yml"
    },

When attempting to use the plugin in mkdocs.yml like so:

plugins:
  - open-in-new-tab

I get the following error:

image

click for copy pasted error
Value is not accepted. Valid values: "blog", "info", "meta", "offline", "optimize", "privacy", "projects", "search", "social", "tags", "typeset", "git-authors", "git-committers", "git-revision-date", "literate-nav", "macros", "section-index", "include-markdown", "material-relative-language-selector", "rss", "git-revision-date-localized", "glightbox", "meta-descriptions", "mkdocstrings", "coverage", "spellcheck", "markdown-exec", "table-reader".yaml-schema: Built-in blog plugin | Built-in info plugin | Built-in meta plugin | Built-in offline plugin | Built-in optimize plugin | Built-in privacy plugin | Built-in projects plugin | Built-in search plugin | Built-in social plugin | Built-in tags plugin | Built-in typeset plugin | Generate pages during the build | Add git authors to pages | Add git contributors to pages | Add git revision date to pages | Configure navigation in Markdown instead of YAML | Use variables and macros in Markdown | Add index section pages to navigation(1)
Plugins || Plugins || Plugins
Built-in plugins || External plugins, schema provided by us || External plugins, schema provided by our community

Allowed Values:

 - include-markdown
 - material-relative-language-selector
 - rss
 - git-revision-date-localized
 - glightbox
 - meta-descriptions
 - mkdocstrings
 - coverage
 - spellcheck
 - markdown-exec
 - table-reader

Source: [schema.json](vscode-file://vscode-app/Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)

Potential Solutions:

I am unclear on the best way to resolve this. Please let me know what you think is the best solution.

1. Add to the official schema

Based on the conversation in squidfunk/mkdocs-material#3660, it seems like squidfunk would prefer that users use his insider's plugin, which would be understandable. I doubt he would support adding this to the official schema, like done in squidfunk/mkdocs-material#6378. But I can attempt to do so, if that is the easier solution.

2. Override .vscode/settings.json

An alternative could be to override yaml.customTags, which would silence the error. Although I am not sure how format it in a way that would silence it. I tried a few different patterns like described in redhat-developer/vscode-yaml#137 but could not get it to silence. This is an educated guess as a possible solution, but guidance would be needed on how to implement.

@JakubAndrysek
Copy link
Owner

Hi, thank you for providing the information. I will look at it next week.

@JakubAndrysek
Copy link
Owner

JakubAndrysek commented Jun 17, 2024

I have added https://github.com/JakubAndrysek/mkdocs-open-in-new-tab/blob/main/schema.json

It seems to work well after adding it to material repo - locally
image

@JakubAndrysek
Copy link
Owner

@sebpretzer
After I add schema to all of my plugins, I will create PR to mkdocs-material repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants