Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
lektor-markdown-highlighter
Advanced tools
Lektor plugin that adds syntax highlighting for markdown blocks with Pygments.
This plugin adds support for syntax highlighting through Pygments to Lektor's markdown support.
To enable the plugin run this command:
lektor plugins add markdown-highlighter
The plugin has a config file that is used to configure a few things
for Pygments. Just create a file named markdown-highlighter.ini
into your
configs/
folder. Currently only pygments.style
is used:
[pygments]
style = tango
You can use this to select any of the built-in Pygments styles. Support for custom styles will come in the future.
The config file is considered the "source" for the Pygments stylesheet, so you must create the configuration file (it can be empty) or Lektor's build will prune pygments.css
.
To use the syntax highlighter you need to use fenced blocks and pass the name of the pygments lexer after the opening fence:
```python
print("Hello World!")
```
In templates the plugin provides the get_pygments_stylesheet
function which
can be used to generate and retrieve a link to the pygments stylesheet:
<link rel="stylesheet" href="{{ get_pygments_stylesheet()|url }}">
In addition the |pygmentize
filter can be used to highlight code from
templates. It takes one argument which is the lexer name:
{{ 'print "Hello World!"'|pygmentize('python') }}
FAQs
Lektor plugin that adds syntax highlighting for markdown blocks with Pygments.
We found that lektor-markdown-highlighter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.