-
Notifications
You must be signed in to change notification settings - Fork 615
Description
Hi!
Thanks for the excellent project.
I’m currently working on a state diagram for a flight sequencer and would like to attach detailed documentation to each state. While D2’s inline Markdown support works functionally, embedding large blocks of documentation directly in the diagram quickly makes the file difficult to read and maintain.
documentation: |md
Imagine this is a large amount of documentation...
|
documentation.shape: rectangleIt would be extremely helpful to be able to import a Markdown file, similar to how D2 files can already be imported, rather than inlining the documentation. Compared to placing documentation in a node in a separate D2 file and importing it, importing Markdown directly has the advantage of allowing the documentation to be reused elsewhere, avoiding the need to maintain parallel .d2 and .md versions of the same content. In my case, that documentation already has to exist as Markdown, it's cleaner to reuse it! For example:
documentation: @documentation_file.md
documentation.shape: rectangleor via variables:
vars: {
mydocument: @documentation_file.md
}
documentation: ${mydocument}
documentation.shape: rectangleThe same capability would also be useful for tooltips:
x: { tooltip: @documentation_file.md }I believe much of the existing import infrastructure could potentially be reused, given that D2 already supports importing other D2 files.
Thanks again for your time and for building such an amazing project!
Metadata
Metadata
Assignees
Labels
Type
Projects
Status