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

Embed the Pygments lexers in Catala #428

Merged
merged 3 commits into from
Mar 14, 2023
Merged

Conversation

AltGr
Copy link
Contributor

@AltGr AltGr commented Mar 13, 2023

Instead of requiring that our custom lexers for Catala be installed on the
system (or the proper venv loaded), this passes them to the pygmentize command
on the fly.

This makes the HTML literate output usable on any stock installation of
Pygments.

In addition, this also works for LaTeX output by removing the need for minted,
and generating the latex for colored code output by calling pygmentize
directly from Catala, using the built-in lexers.

This enables the HTML output to work without a custom Pygments installation (or
the proper venv activated)
This leverages the embedded lexer already used for HTML output, and uses the
LaTeX pygments backend to colorise code directly, without the need for `minted`.
Copy link
Contributor

@denismerigoux denismerigoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's so neat, thanks!

compiler/literate/html.ml Show resolved Hide resolved
@denismerigoux denismerigoux merged commit 43ad270 into CatalaLang:master Mar 14, 2023
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.

2 participants