View Source Plantuml.Markdown (Plantuml v0.1.1)

Some functions to work with markdown files referencing plantuml diagrams

Link to this section Summary

Functions

Reads a markdown file at a given location and generate links with encoded PlantUML diagrams whenever there's a markdown comment with a link referencing a plantuml diagram

Link to this section Functions

Link to this function

generate_diagram_links(file_path)

View Source
@spec generate_diagram_links(file_path :: Path.t()) ::
  markdown_content_with_diagram_links :: String.t()

Reads a markdown file at a given location and generate links with encoded PlantUML diagrams whenever there's a markdown comment with a link referencing a plantuml diagram

example

Example

A markdown file looking like this:

# Example

<!--[Some Link](./example_diagram.plantuml)-->

<!--![Some Rendered Diagram](./example_diagram.plantuml)-->

Would yield an output like this:

# Example

[Some Link](https://plantuml.com/plantuml/png/JP4v3iCW44NxEGKNI16lKeh8MUj4oWKmfa1om86XyEs36JiP2dZwJupueWieFSRt25CwZJAJj2WUZ6KGT-T0AdHUq3en9hs7taKxI3ylsPan-GAKi-ZTcEzS69ClGLiqEDFC6sFo5GmIPI-3Nh8hO_9rcZ-EMg5nDgJvVoRVm2VggDStFncJRo5jOdVCNSH1l9p8XLbSKBprPAOaipPaeY91rLXUKxvLOgRPHlqACDbcbuj0f-sm_DeN)<!--[Some Link](./example_diagram.plantuml)-->

![Some Rendered Diagram](https://plantuml.com/plantuml/png/JP4v3iCW44NxEGKNI16lKeh8MUj4oWKmfa1om86XyEs36JiP2dZwJupueWieFSRt25CwZJAJj2WUZ6KGT-T0AdHUq3en9hs7taKxI3ylsPan-GAKi-ZTcEzS69ClGLiqEDFC6sFo5GmIPI-3Nh8hO_9rcZ-EMg5nDgJvVoRVm2VggDStFncJRo5jOdVCNSH1l9p8XLbSKBprPAOaipPaeY91rLXUKxvLOgRPHlqACDbcbuj0f-sm_DeN)<!--![Some Rendered Diagram](./example_diagram.plantuml)-->