bit3 / contao-pygments
Code elements, using the pygments syntax highlighter for Contao OpenSource CMS
Installs: 13
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Type:contao-module
Requires
- php: >=5.3
- contao-community-alliance/composer-installer: *
- contao-community-alliance/dependency-container: ~1.0
- contao/core: >=3.1,<4-dev
- symfony/process: ~2.3
Requires (Dev)
This package is not auto-updated.
Last update: 2022-02-01 12:34:49 UTC
README
Pygments - the Python syntax highlighter - is a nice syntax highlighter with a lot of lexers, formatters and styles. This extension provide a content element and frontend module that output highlighted code made with pygments.
Limitations
You can select a style per element. This is useful if you use different styles on different pages. But keep in mind that you never can use multiple styles on the same page!
Optimisation
If you select a style in the content element or frontend module, the required style will be added to the page. If you
want to use a "global" style definition, do not select any style in the element. You can dump the styles with
pygmentize -f html -S <style>
. In most cases pygmentize -f html -S default
is a good choice. Use pygmentize -L styles
to get a complete list of all available styles.
After you dumped the styles, put them into a css file and include these file in your layout.
Tip: use the style selector in the element to find your favorite style.