MetaGraph¶
MetaGraph preprocessor for Foliant¶
Preprocessor generates Graphviz diagrams of meta sections in the project.
Installation¶
$ pip install foliantcontrib.metagraph
Config¶
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. Iffalse
— the connections are deretmined by therelates
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 fielddraw: false
. Iffalse
— draws only sections which have meta fielddraw: true
. Default:false
Usage¶
First set up a few meta sections:
<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:
<metagraph></metagraph>