Skip to main content

Archeme integration preprocessor for Foliant.

Project description

Archeme

Archeme preprocessor allows to integrate Foliant with Archeme, a tool for describing and visualizing schemes and diagrams, primarily architectural. Archeme requires Graphviz to be installed.

Archeme preprocessor finds diagram definitions that are described with Archeme DSL, in source Markdown content, then calls Archeme and Graphviz to draw diagrams, and then replaces the diagram definitions with image references.

Installation

$ pip install foliantcontrib.archeme

Config

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

preprocessors:
    - archeme

The preprocessor has a number of options with the following default values:

preprocessors:
    - archeme:
        cache_dir: !path .archemecache
        graphviz_paths:
            dot: dot
            neato: neato
            fdp: fdp
        config_concat: false
        config_file: null
        action: generate
        format: png
        targets: []

Some values of options specified in the project config may be overridden by tag attributes, see below.

cache_dir : Directory to store generated Graphviz sources and drawn diagram images.

graphviz_paths : Paths to binaries of Graphviz engines to be used in external commands: dot, neato, and fdp.

config_concat : Flag that tells the preprocessor to read the config file and the diagram definition as YAML strings, concatenate these strings, and then load the concatenation result, i.e. single YAML string, as an object. If this option is not set (by default), config and diagram definition will be loaded as separate objects, and then merged. This option may be useful when some aliases are defined in the config, and you would like to use their values in the diagram definition.

config_file : Path to default config file. May be overridden with the value of the respective config_file tag attribute, see below. Config file usually defines common settings of multiple diagrams, it’s recommended but not strictly required. By default, no config file is used.

action : Default action. Used when the respective action tag attribute is not specified explicitly, see below. Available values are: generate (default), and merge (see descriptions in Archeme documentation).

format : Format of the output image. May take any value supported by Graphviz, but note that drawn images are used within Markdown content that will be rendered by one or another backend. Preferred values are: png (default), and svg. The value of this option may be overridden by the respective format tag attribute.

targets : Allowed targets for the preprocessor. If not specified (by default), the preprocessor applies to all targets. Limitation of available targets may be useful when it’s needed to build a certain Foliant project in different ways with various settings, e.g. as a stand-alone documentation (for example, with the site target), and as a part of a documentation that combines several Foliant projects (in this case the pre target is usually used).

Usage

To insert an Archeme diagram definition into your Markdown source, enclose it between <archeme>...</archeme> tags:

<archeme>
structure:
    - node:
        id: first
    - node:
        id: second
edges:
    -   tail: first
        head: second
</archeme>

You may use optional tag attributes:

  • caption—to set an alternative text description of the diagram that may be rendered as image caption by some backends;
  • module_id—to specify an unique ID of the diagram that may be used for merging multiple diagram definitions;
  • action—action that should be applied to the diagram definition; the available values are generate and merge; this attribute overrides the respective action config option;
  • config_file—path to a specific config file for the certain diagram definition; this attribute overrides the respective config_file config option;
  • format—output image format for the certain diagram definition; this attribute overrides the respective format config option.

Examples

Diagram definition with explicitly specified ID, config file, and output format:

<archeme module_id="one" caption="Module 1" config_file="!project_path another_config.yml" format="svg">
structure:
    - node:
        id: first
    - node:
        id: second
edges:
    -   tail: first
        head: second
</archeme>

Archeme DSL definition that prescribes to combine two modules with explicitly specified IDs:

<archeme action="merge">
structure:
    - module:
        id: one
    - module:
        id: two
</archeme>

Note that the file and description module parameters in Archeme DSL work as usual. If you need to combine the diagrams that are identified within the current Foliant project by using <archeme module_id="..."> tags, you should to omit the file and description module parameters in your combined diagrams definitions.

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

foliantcontrib.archeme-1.0.3.tar.gz (6.2 kB view details)

Uploaded Source

Built Distribution

foliantcontrib.archeme-1.0.3-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file foliantcontrib.archeme-1.0.3.tar.gz.

File metadata

  • Download URL: foliantcontrib.archeme-1.0.3.tar.gz
  • Upload date:
  • Size: 6.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.11.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for foliantcontrib.archeme-1.0.3.tar.gz
Algorithm Hash digest
SHA256 6ec31e2f35a55c9ddde3b256e468052be42a96be92c730d38774c3ff31f11962
MD5 5dce6219ef20087346ad0a703f9b3435
BLAKE2b-256 13550ddb490f1e1f837e6ded8813b210c0a5492b754e9f1b2cff10af4a909f1f

See more details on using hashes here.

File details

Details for the file foliantcontrib.archeme-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: foliantcontrib.archeme-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.11.1 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8

File hashes

Hashes for foliantcontrib.archeme-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3f66b055a9b4aa5149cb0bfd12b9df0e2246375d788528721377cf1fd8774ae0
MD5 fc47afccbed81dd205e9cbd1cb3bea46
BLAKE2b-256 86d99bf3470f274e6d3e959bf898166b9c414e2d3ef25fa13d7f26aba4f08ebe

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