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(frontend): Improve highlighting of code samples #2538

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

JacobCoffee
Copy link
Member

What

Add highlighting for the prompt marker in the code samples.

Refactor the html formatting so that the html tags are automatically generated and don't have to be written manually in the code samples sources.

Add highlighting for the prompt marker in the code samples.

Refactor the html formatting so that the html tags are automatically
generated and don't have to be written manually in the code samples
sources.
@timhoffm
Copy link

timhoffm commented Sep 12, 2024

From original PR:

format_html() is actually a poor man's pygments, but I did not want to introduce this dependency. However, switching to pygments would be straight forward, if one wants to have full-fledged highlighting at some point in the future.

Not sure whether it was not the case at the time of the original PR or whether I just didn't know, but sphinx depends on pygments, so it's available in your doc build environment and you could use that instead of this manual approach.

@JacobCoffee
Copy link
Member Author

@timhoffm I'm not sure that we install docs deps where this is used, but I can check tomorrow. pygments is okay with me if it cleans up some cruft

@ewdurbin
Copy link
Member

I would lean towards using pygments.

@JacobCoffee JacobCoffee changed the title Improve highlighting of code samples feat(frontend): Improve highlighting of code samples Sep 16, 2024
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.

3 participants