Skip to main content

aafigure extension for Python Markdown

Project description

logo

Markdown aafigure

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

Project/Repo:

MIT License Supported Python Versions CalVer v202103.1010 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 2018-05 -

INFO: You may want to consider using the markdown-svgbob extension instead of this one. svgbob has an online editor and supports a wider range of shapes and diagrams. Its main disadvantage is that it "only" has builtin support for x86_64 on Windows, Linux and Mac, in contrast to aafigure which is pure python and supported everywhere.

Install

$ pip install markdown-aafigure
$ pip install Pillow    # only if you want to render as png

Use

In your markdown text you can define the block:

```aafigure
      +-----+   ^
      |     |   |
  --->+     +---o--->
      |     |   |
      +-----+   V
```

Parameters can be set for individual figures. Availabale parameters

```aafigure {"foreground": "#ff0000"}
      +-----+   ^
      |     |   |
  --->+     +---o--->
      |     |   |
      +-----+   V
```

Development/Testing

$ git clone https://gitlab.com/mbarkhau/markdown_aafigure
$ cd markdown_aafigure
$ make install
$ make lint mypy test

MkDocs Integration

In your mkdocs.yml add this to markdown_extensions.

markdown_extensions:
  - markdown_aafigure:
      tag_type: inline_svg

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

Changelog for https://gitlab.com/mbarkhau/markdown_aafigure

v202103.1010

v202001.0009

  • Fix: Ignore trailing whitespace after closing fence.

v202001.0008

  • Fix: Bad image substitution when markdown has multiple diagrams

v201907.0006

  • Fix: don't require typing package for py<35

v201904.0005

  • Add: Support for inline svg
  • Add: tag_type option for better control of embedding
  • Depricated: format parameter

v201904.0004

  • Add: Support of format: png extension configuration (requires Pillow)
  • Fix: Use base64 encoding for image uri

v201904.0003

  • Fix #3: escape xml in image data uri
  • Fix: cleanup debug output
  • Change: Move to gitlab.com/mbarkhau/markdown-aafigure
  • Change: Switch to pycalver
  • Change: Project packaging updates

0.2.0 (2018-05-28)

  • 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_aafigure-202103.1010.tar.gz (14.0 kB view details)

Uploaded Source

Built Distribution

markdown_aafigure-202103.1010-py2.py3-none-any.whl (8.4 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file markdown_aafigure-202103.1010.tar.gz.

File metadata

  • Download URL: markdown_aafigure-202103.1010.tar.gz
  • Upload date:
  • Size: 14.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for markdown_aafigure-202103.1010.tar.gz
Algorithm Hash digest
SHA256 ea0522533a40f30e06bdfef7be6426648893d81a2e3c8e66bd9943c6a1c4673b
MD5 d4b2d905fc4cb51da126bc505b411124
BLAKE2b-256 479accae77be1cd1db6cf4bf8a9f68d46e47ec6875f1f6d5a1e407521c9e6bd7

See more details on using hashes here.

File details

Details for the file markdown_aafigure-202103.1010-py2.py3-none-any.whl.

File metadata

  • Download URL: markdown_aafigure-202103.1010-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.6.0.post20210108 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for markdown_aafigure-202103.1010-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6059582124353196977678374edbd501ab063ec56efef8ddbdb0f66bccbce610
MD5 900048fee28d97cb5f5447c2122b25a6
BLAKE2b-256 21ad729e9972e15c8d41023d902b7502482c0a10e8a0f369fe1dfb61b5325160

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