user_guide
user_guide copied to clipboard
CWL examples could have better syntax highlighting
Sphinx uses pygments for code highlighting
https://pygments.org/docs/lexerdevelopment/
(see also https://github.com/common-workflow-language/common-workflow-language/issues/784 )
Sphinx uses pygments for code highlighting
https://pygments.org/docs/lexerdevelopment/
(see also common-workflow-language/common-workflow-language#784 )
I noticed yaml is currently used as the lexer in the guide, @kinow picked it. Are you suggesting a new lexer is created for pygments?
Sphinx uses pygments for code highlighting https://pygments.org/docs/lexerdevelopment/ (see also common-workflow-language/common-workflow-language#784 )
I noticed yaml is currently used as the lexer in the guide, @kinow picked it. Are you suggesting a new lexer is created for pygments?
Yes, we need a better lexer to distinguish between CWL keywords and user supplied names and values
Sphinx uses pygments for code highlighting https://pygments.org/docs/lexerdevelopment/ (see also common-workflow-language/common-workflow-language#784 )
I noticed yaml is currently used as the lexer in the guide, @kinow picked it. Are you suggesting a new lexer is created for pygments?
Yes, we need a better lexer to distinguish between CWL keywords and user supplied names and values
Okay, I'll create a repo and tag you to review once I'm done before creating a pr in the pygments repo.
So this seems to be doable -
- First you need to make a new lexer for pygments (https://pygments.org/docs/lexers/)
- You can either try to add it to the pygments open source project OR you can change the code to refer to it a local lexer which might be a good stop-gap solution
- To make the lexer - instead of developing it from scratch there is a tool to convert existing vim-highlighting to lexer - since we have an existing vim plugin for CWL -- you can convert to the the proper format, test it out, if it looks good then we are set
- https://github.com/manabuishii/vim-cwl
- https://github.com/honza/vim2pygments
- https://stackoverflow.com/questions/48615629/how-to-include-pygments-styles-in-a-sphinx-project thoughts @kinow
@Mackenzie-OO7 is going to work on this.
Everything sounds right to me @swzCuroverse . Great job with the action plan! I did not have time, so I just used YAML. But it is definitely a very interesting task to anyone interested in programming (and compilers, interpreters, programming languages, and so on).
So this seems to be doable -
- First you need to make a new lexer for pygments (https://pygments.org/docs/lexers/)
- You can either try to add it to the pygments open source project OR you can change the code to refer to it a local lexer which might be a good stop-gap solution
- To make the lexer - instead of developing it from scratch there is a tool to convert existing vim-highlighting to lexer - since we have an existing vim plugin for CWL -- you can convert to the the proper format, test it out, if it looks good then we are set
- https://github.com/manabuishii/vim-cwl
- https://github.com/honza/vim2pygments
- https://stackoverflow.com/questions/48615629/how-to-include-pygments-styles-in-a-sphinx-project thoughts @kinow
Hi, I ran into an issue while trying to convert the vim plugin. When I try to generate the css file by running ./pygmentize -S cwl -f html -a .highlight > cwl.css
I get the error: /usr/bin/env: ‘python2’: No such file or directory
Looks like the version of pygmentise
you are using needs Python 2. Some software older than a few years might have a Python 2 version, but also a newer Python 3. You need to confirm the version you have installed and try to update to a newer version, if available.
If you are using the instructions from https://github.com/honza/vim2pygments, I see one of their commits from 9 years ago has this message "make it work with python 3+". So it should work.
Looks like the version of
pygmentise
you are using needs Python 2. Some software older than a few years might have a Python 2 version, but also a newer Python 3. You need to confirm the version you have installed and try to update to a newer version, if available.If you are using the instructions from https://github.com/honza/vim2pygments, I see one of their commits from 9 years ago has this message "make it work with python 3+". So it should work.
I have Python 3 installed. Yup, I'm following the instructions from https://github.com/honza/vim2pygments, and I got that error.
In looking forward - it looks like this might just create a style instead of a lexer that is needed. Let me do a little more research - although the style might be useful.