add shorthands for graph

main
Jean-Marie 'Histausse' Mineau 2024-03-21 14:37:03 +01:00
parent 250b89b585
commit f80a8573d3
Signed by: histausse
GPG Key ID: B66AEEDA9B645AD2
3 changed files with 32 additions and 1 deletions

View File

@ -39,6 +39,22 @@ digraph mygraph {
\```
```
`digraphLR`, `digraphTB`, `graphLR` and `graphTB` remove boilerplate code where writing in a hurry:
```
\```digraphLR
a -> b;
b -> c;
c -> a;
\```
\```graphTB
a -- b;
b -- c;
c -- a;
\```
```
### Todo
```
@ -47,6 +63,5 @@ Lorem ipsum dolore #todo[sit] amet
## TODO:
- add new raw type with graphviz boillerplate code
- biblio
- add a list of all todo at the end of the file

View File

@ -2,6 +2,10 @@
#let notes-template(doc) = [
#show raw.where(lang: "dot-render"): it => render-image(it.text)
#show raw.where(lang: "digraphLR"): it => render-image("digraph mygraph { rankdir=\"LR\";" + it.text + "}")
#show raw.where(lang: "digraphTB"): it => render-image("digraph mygraph { rankdir=\"TB\";" + it.text + "}")
#show raw.where(lang: "graphLR"): it => render-image("graph mygraph { rankdir=\"TB\";" + it.text + "}")
#show raw.where(lang: "graphTB"): it => render-image("graph mygraph { rankdir=\"TB\";" + it.text + "}")
#doc
]

View File

@ -10,4 +10,16 @@ digraph mygraph {
}
```
```digraphLR
a -> b;
b -> c;
c -> a;
```
```graphTB
a -- b;
b -- c;
c -- a;
```
Lorem ipsum dolore #todo[sit] amet