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

URI query string syntax highlighting #2707

Closed
svodnik opened this issue Jan 8, 2021 · 7 comments · Fixed by #2708
Closed

URI query string syntax highlighting #2707

svodnik opened this issue Jan 8, 2021 · 7 comments · Fixed by #2708

Comments

@svodnik
Copy link

svodnik commented Jan 8, 2021

Motivation
I'm building documentation for API requests, and I want to distinguish the parts of the query string in the URI visually.

Description
I'd like to be able to use a URI as my code, and have the scheme, path, query, and fragment visually distinguished, as well as the keys and values within the query.

Alternatives
I've tried a number of supported languages, but none get to this depth of granularity. Choosing http applies distinct formatting to the scheme, but not to any of the other URI parts.

@RunDevelopment
Copy link
Member

Sounds interesting. I'll implement that tomorrow. Some other languages also have URIs as part of their syntax, so granular URI highlighting will benefit them as well.

Choosing http applies distinct formatting to the scheme, but not to any of the other URI parts.

HTTP highlights HTTP messages, not URIs.

@joshgoebel
Copy link

Sounds interesting. I'll implement that tomorrow.

To do that does that mean adding new styles to all of the official themes?

@RunDevelopment
Copy link
Member

To do that does that mean adding new styles to all of the official themes?

I don't think so. Why would it?

@joshgoebel
Copy link

have the scheme, path, query, and fragment visually distinguished

I could be ignorant here. But I was assuming there is a single color for URL now... so how will you distinguish the scheme, path, query, and fragment without adding 3 different colors, one for each piece?

@RunDevelopment
Copy link
Member

Now, I get what you mean. I don't intend to add any coloring for now. I will just add a grammar that tokenizes URIs.

Our current themes won't support the new URI tokens and leave them as is. If users (or theme authors) wish to highlights (parts of) URIs, they can modify their theme.

@svodnik
Copy link
Author

svodnik commented Jan 11, 2021

Thanks a bunch for building this! Looking forward to implementing it in my site once it goes live.

@slavafomin
Copy link

Looking forward for the next release. We would really like to use this new URL syntax highlighting.

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

Successfully merging a pull request may close this issue.

4 participants