A renderer of code-block -> png for lookatme. Also requires an image-rendering extension
Project description
lookatme.contrib.render
This is a lookatme extension that renders code blocks of supported languages into images, which are then rendered using whichever image rendering options the user has available.
To get something useful out of this extension, you must have an image-rendering contrib extension installed for lookatme that is able to display images, such as lookatme.contrib.urwid_ueberzug. See lookatme's list of known extensions for other potential options.
Example
After installing this lookatme, this extension, and lookatme.contrib.urwid_ueberzug, you should be able to see something like this:
Installation
pip install lookatme.contrib.render
Usage
Enable this plugin by adding it to the metadata in the head of the markdown file.
---
title: <title>
author: <author>
extensions:
- render
---
The following languages are currently supported:
Code-block Language(s) | Renderer | Executable Required | Note |
---|---|---|---|
dot , graphviz |
Graphviz | dot |
apt-get install graphviz |
mermaid |
mermaid.cli | mmdc |
npm install mermaid.cli; export PATH="$PATH:$(pwd)/node_modules/.bin" |
The height of the rendered image can be set by either appending -N
or N
to the codeblock language to specify the number of rows the rendered image
should use when being displayed.
The example below will render a mermaid-js graph with a height of 10 rows:
```mermaid-10
graph TD
A0 -> B
A1 -> B
B -> C
C -> D
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Hashes for lookatme.contrib.render-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f3ad9d90cae5cfad3f917f482c29e42094784cfd142f06b380de363c70e5bd7a |
|
MD5 | 0d650983cbf339c804fe85e259ff78c4 |
|
BLAKE2b-256 | 6989526dbe5f507ac819f4aca24d331e9aee0b7d1e49c411b18594490f8749d9 |