Skip to main content

svgbob extension for Python Markdown

Project description

logo

markdown-svgbob

This is an extension for Python Markdown which renders diagrams using svgbob.

You can try it out using the Svgbob Editor or the AsciiGrid Editor.

Project/Repo:

MIT License Supported Python Versions CalVer v202112.1022 PyPI Version PyPI Downloads

Code Quality/CI:

GitHub CI Status GitLab CI Status Type Checked with mypy Code Coverage Code Style: sjfmt

Name role since until
Manuel Barkhau (mbarkhau@gmail.com) author/maintainer 2019-04 -

Install

$ pip install markdown-svgbob

This package includes the following binaries:

  • svgbob_0.5.5_x86_64-Darwin
  • svgbob_0.5.5_x86_64-Linux
  • svgbob_0.5.5_x86_64-Windows.exe

If you are on another platform, or want to use a more recent version of svgbob_cli, you will need to install rust and then svgbob via cargo.

$ curl https://sh.rustup.rs -sSf | sh   # see https://rustup.rs/
$ cargo install svgbob_cli

This extension will always use the installed version of svgbob if it is available.

Usage

In your markdown text you can define the block:

```bob
     .---.
    /-o-/--
 .-/ / /->
( *  \/
 '-.  \
    \ /
     '
```

The info string bob is chosen to match spongedown.

Development/Testing

$ git clone https://github.com/mbarkhau/markdown-svgbob
$ cd markdown-svgbob
$ make conda
$ make lint mypy test

MkDocs Integration

In your mkdocs.yml add this to markdown_extensions.

markdown_extensions:
  - markdown_svgbob:
      tag_type: inline_svg
      bg_color: white
      fg_color: black
      min_char_width: 80

Valid options for tag_type are inline_svg (the default), img_utf8_svg and img_base64_svg.

The option min_char_width allows you to create diagrams of a uniform scale.

Changelog for https://github.com/mbarkhau/markdown-svgbob

v202112.1022

  • Upgrade svgbob binaries to 0.5.5

v202109.1020

  • Upgrade to svgbob 0.6.2 for Linux
  • Packaging with lib3to6==202108.1048

I can't get newer binaries for windows or macos, contributions to svgbob would be welcome. https://github.com/ivanceras/svgbob/issues/35

v202107.1018

  • Fix: False positive warning due to 'toc' extension.

v202104.1016

  • Fix: Close file descriptiors of Popen
  • Add support for blocks with extra backticks

v202103.1015

v202006.0015

  • Fix: bg_color not updated in some cases

v202001.0013-beta

  • Fix #2: Ignore trailing whitespace after closing fence.

v202001.0012-beta

  • Add: min_char_width option. Allows diagrams in a document to have a uniform scale.

v202001.0011-beta

  • Fix: Bad image substitution when markdown has multiple diagrams

v202001.0009-beta

  • Fix: Bad parsing of fences

v201907.0008-beta

  • Fix: use PEP 508 environment marker to not always install the typing package. Fixes gitlab#1

v201905.0007-beta

  • Add: bg_color and fg_color options

v201905.0006-beta

  • Fix: better error reporting
  • Fix: cleanup temp dir

v201904.0004-beta

  • Initial release

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

markdown-svgbob-202112.1022.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

markdown_svgbob-202112.1022-py2.py3-none-any.whl (2.6 MB view details)

Uploaded Python 2 Python 3

File details

Details for the file markdown-svgbob-202112.1022.tar.gz.

File metadata

  • Download URL: markdown-svgbob-202112.1022.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for markdown-svgbob-202112.1022.tar.gz
Algorithm Hash digest
SHA256 025a77fbe01de48ba216260de78f039351b2d416481616485d7edff21a6fd1f9
MD5 c1a5b097ca697ed784b183d1836761f7
BLAKE2b-256 9deeb96df636a9d24f97d2a28199493582c6efca955aada7b2882b735208476a

See more details on using hashes here.

File details

Details for the file markdown_svgbob-202112.1022-py2.py3-none-any.whl.

File metadata

  • Download URL: markdown_svgbob-202112.1022-py2.py3-none-any.whl
  • Upload date:
  • Size: 2.6 MB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for markdown_svgbob-202112.1022-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ab4bbfb9b445d59ce1aa9e3238215f62c98335d228c11cb5b77544f050004a85
MD5 ef57836931691bfe402290f9472ff5b0
BLAKE2b-256 2ec091c481edaac359e8d205b15d039e97ee2981877ad8e21296e2ca9d1a7c4b

See more details on using hashes here.

Supported by

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