Skip to main content

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:

example

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lookatme.contrib.render-1.1.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lookatme.contrib.render-1.1.0-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file lookatme.contrib.render-1.1.0.tar.gz.

File metadata

  • Download URL: lookatme.contrib.render-1.1.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for lookatme.contrib.render-1.1.0.tar.gz
Algorithm Hash digest
SHA256 18ae8f8f4e9cc9d249d2a64fbfeb21b4527acb222221c94cd8e9f460c3692572
MD5 dbe926e263da4ed641ba174e42a87ae4
BLAKE2b-256 bf8765a1a703156c5260f4fa623cbd5bdfcb3ef1ed6a096f2d83e29539ad983e

See more details on using hashes here.

File details

Details for the file lookatme.contrib.render-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: lookatme.contrib.render-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.0 requests/2.24.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.5

File hashes

Hashes for lookatme.contrib.render-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 114c39d75bc240a7dd29b816b2f46849d3d327aa4cbddc60ad46c6ea55af38b1
MD5 ebf97b40db6192b034740b037517a721
BLAKE2b-256 84bd864b92b0880145094adc6a750c52a3df1b540312334f75e287891cdd81b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page