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

Documentation: code snippets could be syntax-highlighted #639

Closed
webbedspace opened this issue Oct 15, 2022 · 5 comments
Closed

Documentation: code snippets could be syntax-highlighted #639

webbedspace opened this issue Oct 15, 2022 · 5 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed

Comments

@webbedspace
Copy link
Contributor

Related problem

Consider as an example something like Elvish's documentation. There, the code snippets are syntax-highlighted in HTML to better aid reading comprehension.

Describe the solution you'd like

If you can hook up a basic syntax-highlighting method, lining up with nushell's language, to whatever you use to generate the docs, that'd definitely spruce things up.

Describe alternatives you've considered

No response

Additional context and details

No response

@webbedspace webbedspace added the enhancement New feature or request label Oct 15, 2022
@fdncred
Copy link
Collaborator

fdncred commented Oct 15, 2022

Thanks for the suggestion. We would accept a PR for this change.

@fdncred fdncred added the documentation Improvements or additions to documentation label Oct 15, 2022
@webbedspace
Copy link
Contributor Author

Actually, I've just noticed something strange: some pages are syntax-highlighted, like https://www.nushell.sh/book/commands/where.html, but most of them are not. This means the functionality for syntax-highlighting already exists, but isn't being used for every page… right?

@sholderbach
Copy link
Member

Transferring this issue to https://github.com/nushell/nushell.github.io as the long text documentation is written there and the generation script for the command docs lives there as well.

I think we don't have a markdown integration for exact syntax highlighting yet, but we use a good enough approximation. Maybe checkout what markdown language extension is used and transfer that over for consistency:

``` language
code

@sholderbach sholderbach transferred this issue from nushell/nushell Oct 16, 2022
@fdncred
Copy link
Collaborator

fdncred commented Oct 16, 2022

I'm wondering if we could do something like some | pipe | line | nu-highlight | to html to get some better syntax highlighting in markdown. I'm not sure html is even supported?

@sholderbach sholderbach added the help wanted Extra attention is needed label Feb 13, 2023
@fdncred
Copy link
Collaborator

fdncred commented Oct 2, 2023

closed by #1078

@fdncred fdncred closed this as completed Oct 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants