Skip to content

netspective-studios/hugo-shortcode-diagram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Hugo shortcode to render Kroki diagrams

The diagram Hugo shortcode renders Kroki supported diagrams from in markdown text. Kroki provides an HTTP API to create diagrams from textual descriptions and supports many diagramming formats.

Usage

Include this in your Hugo config.yaml:

module:
  imports:
    - path: github.com/netspective-studios/hugo-shortcode-diagram
      mounts:
        - source: shortcodes
          target: layouts/shortcodes

If you are using config.toml in Hugo

[[module.imports]]
path                              = "github.com/netspective-studios/hugo-shortcode-diagram"

[[module.imports.mounts]]
source                            = "shortcodes"
target                            = "layouts/shortcodes"

Dot Sample

{{<diagram name="diagram1" type="dot">}}
digraph { Hello -> World }
{{</diagram>}}

PlantUML Sample

{{<diagram name="diagram2" type="plantuml">}}
@startuml
cloud helloWorld as "Hello World (PlantUML)"
@enduml
{{</diagram>}}

About

Hugo shortcode to render Kroki diagrams

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages