semvec/pypi-packages huggingface dataset:
foliantcontrib.admonitions 1.0.1
Preprocessor for admonitions
License: MIT

[![](https://img.shields.io/pypi/v/foliantcontrib.admonitions.svg)](https://pypi.org/project/foliantcontrib.admonitions/)  [![](https://img.shields.io/github/v/tag/foliant-docs/foliantcontrib.admonitions.svg?label=GitHub)](https://github.com/foliant-docs/foliantcontrib.admonitions)

# Admonitions preprocessor for Foliant

Preprocessor which tries to make admonitions syntax available for most backends.

Admonitions are decorated fragments of text which indicate a warning, notice, tip, etc.

We use [rST-style syntax for admonitions](https://python-markdown.github.io/extensions/admonition/) which is already supported by mkdocs backend with `admonition` extension turned on. This preprocessor makes this syntax work for pandoc and slate backends.

## Installation

```bash
$ pip install foliantcontrib.admonitions
```

## Config

Just add `admonitions` into your preprocessors list. Right now the preprocessor doesn't have any options:

```yaml
preprocessors:
    - admonitions
```

## Usage

Add an admonition to your Markdown file:

```
!!! warning "optional admonition title"
    Admonition text.

    May be several paragraphs.
```


Currently supported backends:

- `pandoc`
- `mkdocs`*
- `slate`

\* for admonitions to work in mkdocs, add `admonition` to the `markdown_extensions` section of your mkdocs.yml config:

```yaml
backend_config:
    mkdocs:
        mkdocs.yml:
            markdown_extensions:
                - admonition
```

### Notes for slate

Slate has its own admonitions syntax of three types: `notice` (blue notes), `warning` (red warnings) and `success` (green notes). If another type is supplied, slate draws a blue note but without the "i" icon.

Admonitions preprocessor transforms some of the general admonition types into slate's for convenience (so you could use `error` type to display same kind of note in both slate and mkdocs). These translations are indicated in the table below:

original type | translates to
------------- | -------------
error         | warning
danger        | warning
caution       | warning
info          | notice
note          | notice
tip           | notice
hint          | notice
foliantcontrib.metagraph 0.1.3
Preprocessor which generates schemes from metadata
License: MIT

[![](https://img.shields.io/pypi/v/foliantcontrib.metagraph.png)](https://pypi.org/project/foliantcontrib.metagraph/)  [![](https://img.shields.io/github/v/tag/foliant-docs/foliantcontrib.metagraph.png?label=GitHub)](https://github.com/foliant-docs/foliantcontrib.metagraph)

# MetaGraph preprocessor for Foliant

Preprocessor generates Graphviz diagrams of meta sections in the project.

## Installation

```bash
$ pip install foliantcontrib.metagraph
```

## Config

```yaml
preprocessors:
    - metagraph:
        natural: false
        directed: false
        draw_all: false
```

`natural`
:   if `true` — the graph is generated based on "natural" section structure: main sections are connected to the inner sections, which are connected to their child sections and so on. If `false` — the connections are deretmined by the `relates` meta section of each chapter. Default: `false`

`directed`
:   If `true` — draws a directed graph (with arrows). Default: `false`

`draw_all`
:   If `true` — draws all sections, except those which have meta field `draw: false`. If `false` — draws only sections which have meta field `draw: true`. Default: `false`

## Usage

First set up a few meta sections:

```html
<meta title="Main document" id="main" relates="['first', 'sub']" draw="true"></meta>

# First title
<meta id="first" draw="true"></meta>

Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nesciunt, atque.

## Subtitle

<meta id="sub"  draw="true"></meta>
```

Then add a `metagraph` tag somewhere in the project:

```html
<metagraph></metagraph>
```