diff --git a/docs/conf.py b/docs/conf.py index b1f6ca184..7ad2d42be 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -5,9 +5,12 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- General configuration --------------------------------------------------- - +import sys +import os from multiproject.utils import get_project +sys.path.insert(0, os.path.abspath('.')) + # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. @@ -56,6 +59,13 @@ myst_heading_anchors = 4 nb_execution_mode = "off" +# -- Custom Lexers ----------------------------------------------------------- + +from lexers import SciJavaGroovyLexer + +def setup(app): + app.add_lexer('scijava-groovy', SciJavaGroovyLexer) + # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for diff --git a/docs/lexers.py b/docs/lexers.py new file mode 100644 index 000000000..29dbb8e8d --- /dev/null +++ b/docs/lexers.py @@ -0,0 +1,11 @@ +from pygments.lexer import inherit +from pygments.lexers.jvm import GroovyLexer +from pygments.token import Comment + +class SciJavaGroovyLexer(GroovyLexer): + tokens = { + 'base': [ + (r'#@.*?$', Comment.Single), + inherit, + ] + } \ No newline at end of file diff --git a/docs/ops/doc/examples/example_gaussian_subtraction.rst b/docs/ops/doc/examples/example_gaussian_subtraction.rst index c53f4b03f..df7bb9c93 100644 --- a/docs/ops/doc/examples/example_gaussian_subtraction.rst +++ b/docs/ops/doc/examples/example_gaussian_subtraction.rst @@ -9,7 +9,7 @@ SciJava Ops via Fiji's sripting engine with `script parameters`_: .. tabs:: - .. code-tab:: groovy + .. code-tab:: scijava-groovy #@ ImgPlus img #@ Double (label="Sigma:", value=5.0) sigma