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

feat: schema generator for basic & advanced configs #310

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

DataM0del
Copy link
Contributor

@DataM0del DataM0del commented Nov 17, 2024

Description

Adds a schema generator so you can have autocomplete.
To use this in configs, run the generator script and add:

Testing

Procedure:

  • Add the schema directive for each of the config files
  • comment out everything below that schema directive so we can test the autocomplete
  • Ctrl + Space to trigger the autocomplete.
  • Look at the results.

Checklist

Things need to be done before this Pull Request can be merged.

  • Initial schemas (not auto-generated)
  • Test the schemas
  • Make a script to automatically generate these schemas
  • Test it
  • Change the titles for Basic Configuration and Advanced Configuration to not look like it was generated

Hopefully we can make this dynamic / auto-generated later.
@Snowiiii
Copy link
Owner

Im not sure if this is really necessary, We already have to add config values in the docs it would be really annoying to have to add them in 3 different places

@DataM0del
Copy link
Contributor Author

Im not sure if this is really necessary, We already have to add config values in the docs it would be really annoying to have to add them in 3 different places

We could auto-generate the docs from these schemas. Obviously you don't get auto complete from the docs, so it's probably better if we do that instead.

@Snowiiii
Copy link
Owner

Im not sure if this is really necessary, We already have to add config values in the docs it would be really annoying to have to add them in 3 different places

We could auto-generate the docs from these schemas. Obviously you don't get auto complete from the docs, so it's probably better if we do that instead.

I like to have examples and explain in-depth how things work. Which can be done in the docs

@DataM0del
Copy link
Contributor Author

Im not sure if this is really necessary, We already have to add config values in the docs it would be really annoying to have to add them in 3 different places

We could auto-generate the docs from these schemas. Obviously you don't get auto complete from the docs, so it's probably better if we do that instead.

I like to have examples and explain in-depth how things work. Which can be done in the docs

JSON schemas also have the "example" array in each item, so you can give examples like

"properties": {
  "type": "string",
  "examples": ["yes", "awawhawfrjoiwaojif"]
}

@Snowiiii
Copy link
Owner

Snowiiii commented Dec 4, 2024

I meant larger and more fancy examples using markdown. Im sorry but i don't really see the point in this PR. We now have split the docs to its eaiser to maintain

@DataM0del
Copy link
Contributor Author

DataM0del commented Dec 6, 2024

I meant larger and more fancy examples using markdown. Im sorry but i don't really see the point in this PR. We now have split the docs to its eaiser to maintain

The point of this PR is basically auto-completion.
We could pull the descriptions and etc. from the docs and insert it into the schemas, and maybe insert a link to the docs.
Also, I think most things consuming the JSON schemas are using markdown parsers and then rendering the output HTML anyways.

@DataM0del
Copy link
Contributor Author

Also, I went through all of the config docs, and it seems to just be a few lists here, maybe a info, warning, tip etc. there, and I don't see any images or anything fancy.

@DataM0del DataM0del changed the title feat: add schemas for the configs feat: schema generator for basic & advanced configs Dec 14, 2024
@Snowiiii
Copy link
Owner

I wonder if it is possible to generate Vitepress sites using json schemas

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

Successfully merging this pull request may close these issues.

2 participants