Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fenced graph blocks (e.g. DOT graph, etc.) #9

Closed
Omikhleia opened this issue Nov 10, 2022 · 2 comments · Fixed by #43
Closed

Fenced graph blocks (e.g. DOT graph, etc.) #9

Omikhleia opened this issue Nov 10, 2022 · 2 comments · Fixed by #43
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Omikhleia
Copy link
Owner

Omikhleia commented Nov 10, 2022

Some Markdown converters recognize fenced code blocks of a certain type (infostring/class) as graph drawing language and renders them visually.

For the record, my previous experiment with a Pandoc custom Lua writer did that too, but only when certain attributes are set:

All the above examples (= of fenced code blocks) specified the programming language after the fenced
code block marker (e.g. lua ). For the DOT graph language, this converter also supports an extended syntax {.dot width=... height=...}. When a width and/or a height are specified, the graph is included as an image, instead of the corresponding code.

Things to address

  • Prerequisite We'd need good packages for invoking the appropriate program and retrieving the image (my old quick'n dirty experiment for dot is certainly subpar).
  • So as to render the fenced block as an image rather than text, we'd need some appropriate way for the markdown package to know which supporting packages are available for a given format (e.g. possibly checking loaded converters, but the SILE converters is IMHO a wrong mess...)
  • Proper Markdown syntax. In the above case I suggested using width/height because:
    • It's very likely the user needs to control these depending on his favored page layout/style.
    • There must be a way to still get the code rendered as text if wanted.
@Omikhleia Omikhleia added the enhancement New feature or request label Nov 10, 2022
@Omikhleia Omikhleia changed the title Fenced graph blocks Fenced graph blocks (e.g. DOT graph, etc.) Nov 10, 2022
@Omikhleia Omikhleia added this to the 1.1 milestone Nov 13, 2022
@Omikhleia
Copy link
Owner Author

In the same vein, also considering Lilypond-in-Markdown...
Some links for mere reference

@Omikhleia Omikhleia modified the milestones: 1.1, 2.0 Dec 3, 2022
@Omikhleia
Copy link
Owner Author

Prerequisite We'd need good packages for invoking the appropriate program and retrieving the image (my old quick'n dirty experiment for dot is certainly subpar).

There we go: https://github.com/Omikhleia/embedders.sile = DOT, Lilypond.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant