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

Add custom Groovy lexer to sphinx/rtd #140

Merged
merged 3 commits into from
Mar 27, 2024

Conversation

elevans
Copy link
Member

@elevans elevans commented Mar 26, 2024

This PR adds a lexers.py module that contains a custom Groovy lexer that adds "#@" lines as comments. To use this custom lexer simply define your code block like so:

.. code-block:: scijava-groovy

This PR resolves the annoying errors with "#@" in groovy scripts and stops the error highlighting in our scijava ops docs.

This commit adds a "lexer.py" module that contains
a custom Groovy lexer that adds "#@" lines as comments.
To use this custom lexer simply define your code block like so:

.. code-block:: fijigroovy
@elevans elevans requested a review from gselzer March 26, 2024 20:43
Copy link
Member

@ctrueden ctrueden left a comment

Choose a reason for hiding this comment

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

Thanks a lot for figuring this out! I would just request the name be "SciJava" instead of "Fiji" since that's the relevant layer here.

docs/conf.py Outdated Show resolved Hide resolved
docs/conf.py Outdated Show resolved Hide resolved
elevans added 2 commits March 27, 2024 11:23
Instead of duplicating the Groovy lexer to
modify it, we can simply subclass it
and inherit it's tokens.

This commit also renames the lexer to
"SciJavaGroovyLexer".
Copy link
Member Author

@elevans elevans left a comment

Choose a reason for hiding this comment

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

Thanks for the feedback @ctrueden! We can use this custom Groovy lexer with the scijava-groovy alias.

Copy link
Member

@ctrueden ctrueden left a comment

Choose a reason for hiding this comment

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

Thanks @elevans! LGTM

@ctrueden ctrueden merged commit 5aeff72 into main Mar 27, 2024
2 checks passed
@ctrueden ctrueden deleted the scijava-ops-docs/fijigroovy-lexer branch March 27, 2024 20:20
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