lektor-markdown-highlighter
This plugin adds support for syntax highlighting through Pygments to Lektor's markdown support.
Enabling the Plugin
To enable the plugin run this command:
lektor plugins add markdown-highlighter
Configuring the Plugin
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.
In Markdown
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
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') }}
Metadata
Release files for lektor-markdown-highlighter 0.3.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lektor_markdown_highlighter-0.3.2-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for lektor_markdown_highlighter-0.3.2-py2.py3-none-any.whl |
Release files / lektor_markdown_highlighter-0.3.2-py2.py3-none-any.whl
| Download URL | lektor_markdown_highlighter-0.3.2-py2.py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
8af5468928f039106cb760844d1c78556b7838c47ee792c13dc81ca45a5d2ad0
|
|
BLAKE2b-256 checksum How to use checksums |
90a13a111391644bbbf2b76bea5c80a0bbcfd8cb12b4b2ffdeac60e23b5458d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.0 CPython/3.10.4
|
Security for lektor-markdown-highlighter 0.3.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.