Skip to main content

Argdown Diagrams Preprocessor for Foliant

Argdown is modeling language for creating argument maps. This preprocessor converts Argdown diagram definitions in source markdown files and converts them into images on the fly during project build.

This preprocessor uses Argdown Image Export package tool by Christian Voigt to convert diagrams into images.

Installation

$ pip install foliantcontrib.argdown

You will also need to install Argdown CLI and the Image Export package:

$ npm install -g @argdown/cli
$ npm install -g @argdown/image-export

Config

To enable the preprocessor, add argdown to preprocessors section in the project config:

preprocessors:
    - argdown

The preprocessor has a number of options:

preprocessors:
    - argdown:
        cache_dir: !path .diagramscache/argdown
        converter_path: argdown
        format: png
        as_image: true
        params:
            no-title: true
        `fix_svg_size`: false

cache_dir : Path to the cache directory for the generated diagrams. It can be a path relative to the project root or a global one.

To save time during build, only new and modified diagrams are rendered. The generated images are cached and reused in future builds.

converter_path : Path to Argdown CLI. By default, it is assumed that you have the argdown command in your PATH, but if it is not the case you can define it here. Default: argdown

format : Output format of the diagram image. Available formats at the time of writing: dot, graphml, svg, pdf, png, jpg, webp. Default: png

as_image : If true — inserts the diagram into the document as Markdown-image. If false — inserts the source code of the diagram directly into the document (works only for svg, dot and graphml formats). Default: true

params : Params passed to the Argdown CLI map tool. Value of this option must be a YAML-mapping. Params which require values should be specified as param: value; params which don't require values should be specified as param: true.

To see the full list of available params, run argdown map --help.

fix_svg_size : Works only with svg format and as_image: false. By default svg is embedded with hardcoded width and height so they may exceed the boundaries of your HTML page. If this option is set to true the svg width and height will be set to 100% which will make it fit inside your content container. Default: false.

Usage

To insert a diagram definition in your Markdown source, enclose it between <argdown>...</argdown> tags:

Here’s the diagram:

<argdown>
===
title: The Core Argument of Populism
author: David Lanius
date: 27/10/2018
===


This is a recontruction of right-wing populist argumentation 
based on the electoral platform of the German party...
</argdown>

You can override preprocessor parameters in the tag options. For example if the format for diagrams is set to png in foliant.yml and you need one of your diagrams to render in svg, override the format option in the tag:

SVG diagram:

<argdown format="svg">
...
</argdown>

Tags also have an exclusive option caption — the markdown caption of the diagram image.

Diagram with a caption:

<argdown caption="Diagram of the opposing arguments">
...
</argdown>

Release files for foliantcontrib.argdown 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for foliantcontrib.argdown 0.1.1
File Size Uploaded
foliantcontrib.argdown-0.1.1.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for foliantcontrib.argdown 0.1.1
File Interpreter ABI Platform
foliantcontrib.argdown-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size:10.9 kB

Release files / foliantcontrib.argdown-0.1.1.tar.gz

Download URL foliantcontrib.argdown-0.1.1.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
5c7672fe1ebf5abe729be30ae6ace17a42a78ba0e3f4923bbf30e2bb51447232
BLAKE2b-256 checksum
How to use checksums
ff1f0936628e338a4fa4a919079b29b68735de5935ddaeb00102628c47d6d75f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.10

Release files / foliantcontrib.argdown-0.1.1-py3-none-any.whl

Download URL foliantcontrib.argdown-0.1.1-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4fe678a62c83e108235134ea842069c99c0efb01dacad19fce319d4df80bbb5a
BLAKE2b-256 checksum
How to use checksums
fbe383530028b9a03fa6a5e6ea922d161537e771eebf92f3f61254d977dcc0f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page