-
Notifications
You must be signed in to change notification settings - Fork 658
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
json-object lexer (JsonBareObjectLexer) description lacks detail #1600
Comments
Even I have no idea what However, in the current master it is simply the same as |
Thank you. Maybe the intention for |
That use case is already supported by |
@birkenfeld Did you also test on master, given that has a new JsonLexer (for perf)? |
Well when I said 2.7 I meant master - I had thought the new JsonLexer was already in 2.7. If not, make it 2.8 :) |
I confirmed this is in master but not in 2.7; and, confirmed too that the JSON parser in master allows the mentioned use case. After pip-installing from master, all warnings from Sphinx disappeared, very nice! Thanks for the comments and the useful updates. |
Given comments in pygments/pygments#1600, the json-object lexer is geting deprecated with the upcoming Pygments 2.8, and will fall back to "json". At the same time, Pygments 2.8 comes with a new JSON parser that allows for partial blocks missing surrounding curly braces, which is exactly the use case we have in this documentation. Nice update!
The new JSON parser should go out in 2.7.3; I haven't merged anything yet which would warrant 2.8. |
Ok, then you'll need to move around the changelog entry. |
I've been training all my life for this day :) |
Given comments in pygments/pygments#1600, the json-object lexer is geting deprecated with the upcoming Pygments 2.8, and will fall back to "json". At the same time, Pygments 2.8 comes with a new JSON parser that allows for partial blocks missing surrounding curly braces, which is exactly the use case we have in this documentation. Nice update!
This report accompanies the other one at #1599 regarding a lexer which its user docs are lacking detail that helps understand even what the lexer is intended for.
In this case, the
json-object
docs state "For JSON data structures (with missing object curly braces)" (JsonBareObjectLexer) but a bit more in-depth information and even a usage sample would do lots in term of helping to understand the feature.I have a JSON file (here, regardless of how good or bad decision it was to choose JSON for user-editable configuration... JSON is used for historical reasons) of which I want to document a small section (see here for the actual case).
I tried using
json-object
like this, under the assumption that it would work because that's what I'm able to understand from "with missing object curly braces":but it fails parsing and Sphinx warns about it:
Curiously enough, this valid JSON also fails:
The Sphinx warning is the same as before.
(and nevertheless I'd like to avoid putting the additional braces to make it JSON-compliant, because it would add noise and might drive users to think they should somehow write the setting under a new, independent object)
This probably is just a silly misunderstanding like what happened in #1599 so a bit more extended docs would probably help a lot.
The text was updated successfully, but these errors were encountered: