-
Notifications
You must be signed in to change notification settings - Fork 84
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
YAML (JSON) schema for the config file? #206
Comments
Hi @kachkaev , The links you've provided should help me to look into this, thank you. As I do so, could you help me with the following questions:
Thanks again! |
Thanks for your reply and for the potential interest @cmhughes!
Yep, VSCode has There’s also https://vscodium.com, which is the same editor, but built by the community instead of Microsoft.
I believe so, yes. YAML / JSON schemas are a pretty wide-spread concept, so I’m sure there is a solid integration into many editors and other tools. I first encountered it long before switching to VSCode a few years ago. Check out this page for example: https://vega.github.io/editor/#/examples/vega-lite/rect_binned_heatmap. Because the JSON starts with Since JSON and YAML files are essentially the same thing, a once-generated schema is applicable to both formats. The spec can be found at https://json-schema.org |
That's helpful, many thanks.
I'll take a more detailed look at this soon. From what you've said here, it
sounds like a good idea.
In the mean time, if you have any success in progressing it, do feel free
to let me know and to submit a pull request.
…On Sun, 7 Jun 2020, 16:29 Alexander Kachkaev, ***@***.***> wrote:
Thanks for your reply and for the potential interest @cmhughes
<https://github.com/cmhughes>!
is VSCode available for Linux?
Yep, VSCode has *.deb and *.rpm distributions:
https://code.visualstudio.com/download
There’s also https://vscodium.com, which is the same editor, but built by
the community instead of Microsoft.
would other editors (such as vim, for example) have natural ways to
connect with this...?
I believe so, yes. YAML / JSON schemas are a pretty wide-spread concept,
so I’m sure there is a solid integration into many editors and other tools.
I first encountered if long before switching to VSCode a few years ago.
Check out this page for example:
https://vega.github.io/editor/#/examples/vega-lite/rect_binned_heatmap.
Because the JSON starts with "$schema": "
https://vega.github.io/schema/vega-lite/v4.json", the rest of the
document can be statically analysed to a certain extent. Try replacing
"width" with "widthx" or shorten it down to "w" and press ctrl+space.
Since JSON and YAML files are essentially the same thing, a once-generated
schema is applicable to both formats. The spec can be found at
https://json-schema.org
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#206 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ7CYAZRBDR2JBQ66BKHYDRVOW5NANCNFSM4NXFDGNA>
.
|
If anyone feels like taking this on (or, simply starting it), please do feel free. All pull requests to the |
Very sorry for the delay on this. Development is slow at the moment for various reasons. If anyone feels like starting it, please feel free :) all pull requests to |
@kachkaev some good news, I've made created https://github.com/cmhughes/latexindent.pl/blob/develop/documentation/latexindent-yaml-schema.json :) It's on the If you'd like to take a look, I'd welcome any feedback. Documentation is in https://github.com/cmhughes/latexindent.pl/blob/develop/documentation/appendices.tex :) |
Hi @cmhughes 👋 That’s great news indeed, thanks a lot for your effort! I’m not actively working on any LaTeX documents at the moment, so won’t be able to check out the new feature any time soon – sorry. I’m sure I’ll benefit from it next time, so thanks a lot again! And a happy New Year! 🎉 |
@kachkaev many thanks, that's great :) I've implemented this as of https://github.com/cmhughes/latexindent.pl/releases/tag/V3.13.5 and have uploaded it to ctan. Improvements and feedback welcome as and when you (and others) come to it. Happy new year! |
Relevant part of documentation at https://latexindentpl.readthedocs.io/en/latest/appendices.html#latexindent-yaml-schema-json |
If you can make this happen using github actions, contrubuitions welcome! |
schema store needs a URL. https://github.com/SchemaStore/schemastore/pull/3510/files#diff-1b8f038f5afb1158263a1fc83b9c0ca5a7438cceb90adad99d87168f70edc815R476 Keep the json schema's URL not changed is OK to get updated 😄 |
OK, well I'll try to keep the url unchanged. If anything else needs to be
changed, feel free to submit a pull request.
…On Thu, 11 Jan 2024, 14:45 wzy, ***@***.***> wrote:
schema store needs a URL.
https://github.com/SchemaStore/schemastore/pull/3510/files#diff-1b8f038f5afb1158263a1fc83b9c0ca5a7438cceb90adad99d87168f70edc815R476
Keep the json schema's URL not changed is OK to get updated 😄
—
Reply to this email directly, view it on GitHub
<#206 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAQ7CYHBK6YKP3LMMQLDYX3YN73HJAVCNFSM4NXFDGNKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBYG4ZTGNRQHA4Q>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
👋 @cmhughes, may thanks for creating
latexindent
!I’m new to the tool, so haven’t got much further than creating
latexindent.yaml
in my LaTeX Project and configuring VSCode LaTeX Workshop to apply my local config file on save.settings.json
My feature request is about the user experience for editing
latexindent.yml
. At the moment, the only way to know which options are valid is to read latexindent pdf or the website. If there is a typo in the config key of if a key is under a wrong section, there is no feedback until some tex file is saved. Besides, there is no intellisense (autocompletion) for keys and values.VSCode can read YAML (JSON) schemas and thus significantly improve the UX. Here is an example of what autocompletion looks like when I edit a Kubernetes deployment or ESLint config:
Autocompletion for ESLint seems to come from https://json.schemastore.org/eslintrc, because somebody once contributed to https://www.schemastore.org/json/ and VSCode picked that up. The k8s schemas probably come from a corresponding VSCode extension – I haven’t fully traced that.
YAML / JSON schemas are not only useful for intellisense, but can also be picked by linting tools such as
yaml-schema-validator
(I'm sure there are plenty of such of a kind).A schema for
latexindent.pl
YAMLs can enable some nice scenarios, so it’d be great if you could consider creating it. What do you think?The text was updated successfully, but these errors were encountered: