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

Support python3 language identifier (Pygments lexer name) in literalinclude/code-block #160

Open
cmarqu opened this issue Feb 4, 2025 · 1 comment · May be fixed by #162
Open

Support python3 language identifier (Pygments lexer name) in literalinclude/code-block #160

cmarqu opened this issue Feb 4, 2025 · 1 comment · May be fixed by #162
Labels
bug Something isn't working

Comments

@cmarqu
Copy link

cmarqu commented Feb 4, 2025

(Thanks for this awesome extension, I was always looking for something like this, and now I found it ;))

Issue

python3 as a language identifier/Pygments lexer name doesn't seem to be supported.

Expected behavior

Both python3 and python should work the same.

Actually, according to https://pygments.org/docs/lexers/#pygments.lexers.python.PythonLexer, there are more names (python, py, sage, python3, py3, bazel, starlark, pyi), maybe they should all be supported (especially py3)?

Steps to reproduce

I am using .. literalinclude:: python3 or .. code-block:: python3, and I don't see sphinx-codeautolink taking effect.
However, if I change these lines to .. literalinclude:: python and .. code-block:: python respectively, it's working as expected.

@cmarqu cmarqu added the bug Something isn't working label Feb 4, 2025
@felix-hilden
Copy link
Owner

Hi! Thanks for submitting the issue. If they are really just synonyms for the same lexer then there's no reason for us not supporting them! Contributions are welcome if you're up for it, but if not I should get to it within a couple of weeks 👍

cmarqu added a commit to cmarqu/sphinx-codeautolink that referenced this issue Feb 9, 2025
cmarqu added a commit to cmarqu/sphinx-codeautolink that referenced this issue Feb 9, 2025
@cmarqu cmarqu linked a pull request Feb 9, 2025 that will close this issue
3 tasks
cmarqu added a commit to cmarqu/sphinx-codeautolink that referenced this issue Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants