#pygments — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #pygments, aggregated by home.social.
-
Does anyone here know #pygments or #chroma lexer stuff well enough to tell me how (if at all?) one can mark up stuff in *multiple ways at once*?
For instance the following line:
# foo **bar**
The entire line should be a "Heading", the first two characters and the stars should be "Keyword"s, and the bar should be "GenericStrong".
I can't for the life of me figure out how that's possible to achieve.
CC @avghelper
-
When in doubt of which type of code block alias to use in your RST file, pygments provides all available lexers 📜 for a neat documentation project
https://pygments.org/docs/lexers/
#pygments #RST #sphinx -
At last, submitted a proposal for a #Python source code annotator for #wily, by @tonybaloney.
It allows inline visualization of code metrics in source code, inspired by @coveragepy
Uses #radon to calculate #Cyclomatic #Complexity and #Halstead metrics, then adds color coded metric values to a #Pygments highlighted source listing and allows changing the metrics for visualization.
The code works, there are screenshots and an example in the linked issue.
-
Working on a #Python source code annotator for #wily, which uses #radon to calculate #Cyclomatic #Complexity and #Halstead metrics. It adds metric values to a #Pygments highlighted source listing and allows changing the metrics for visualization.
Because radon doesn't record line numbers for Halstead metrics, we do a little song and dance to add them. Will probably offer a patch to include them upstream.
https://devdanzin.github.io/wily/annotated_src.annotator.py.html
-
#MediaWiki uses the #Pygments syntax highlighter to enable rich formatting of code blocks: https://www.mediawiki.org/wiki/Extension:SyntaxHighlight
diskdance has submitted a pull request to add a lexer to support #wikitext markup: https://github.com/pygments/pygments/pull/2373
Hopefully it'll be in a release soon, to be used in on-wiki help pages and documentation!
(h/t to rundg for spotting)