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

Enable passing options to pygments #207

Closed
shimizukawa opened this issue Jan 2, 2015 · 3 comments
Closed

Enable passing options to pygments #207

shimizukawa opened this issue Jan 2, 2015 · 3 comments
Labels
extensions type:enhancement enhance or introduce a new feature
Milestone

Comments

@shimizukawa
Copy link
Member

Hi,

Related to issue 175 (and discussed on #python-docs), it would be nice to have a way of passing options to pygments.

This is essential for small snippets of PHP (the :startsinline: option) - there are probably other cases too.

Default options might go in conf.py, with sourcecode block options allowed.

Thanks


@shimizukawa shimizukawa added this to the some future version milestone Jan 2, 2015
@shimizukawa shimizukawa added type:enhancement enhance or introduce a new feature extensions labels Jan 2, 2015
@shimizukawa
Copy link
Member Author

From Konstantin Molchanov on 2012-12-11 17:30:16+00:00

Vital feature, please add!

@tk0miya
Copy link
Member

tk0miya commented Jan 8, 2017

Note: #175

@tk0miya
Copy link
Member

tk0miya commented Jan 10, 2021

Now we provides a config variable highlight_options to pass options to pygments since v1.3. I think it can resolve this case. Please let me know if you'd like to apply options to an arbitrary code-block.

BTW, the highlight_options are only applied to the language that is specified to highlight_language. It means we can't pass the options to pygments when using two or more languages. It should be improved before closing this.

tk0miya added a commit to tk0miya/sphinx that referenced this issue Jan 10, 2021
This changes the structure of `highlight_options` to a dictionary that
maps language names to option dictionary.  It allows to setting pygments
options for multiple languages at once.
@tk0miya tk0miya modified the milestones: some future version, 3.5.0 Jan 10, 2021
tk0miya added a commit to tk0miya/sphinx that referenced this issue Jan 11, 2021
This changes the structure of `highlight_options` to a dictionary that
maps language names to option dictionary.  It allows to setting pygments
options for multiple languages at once.
tk0miya added a commit to tk0miya/sphinx that referenced this issue Jan 11, 2021
This changes the structure of `highlight_options` to a dictionary that
maps language names to option dictionary.  It allows to setting pygments
options for multiple languages at once.
tk0miya added a commit that referenced this issue Jan 11, 2021
Close #207: Now highlight_language supports multiple languages
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions type:enhancement enhance or introduce a new feature
Projects
None yet
Development

No branches or pull requests

2 participants