Skip to content

Marked Diagrams - Markdeep iteration#4376

Open
G-Ambatte wants to merge 10 commits intonaturalcrit:masterfrom
G-Ambatte:experimentalMarkedDiagrams
Open

Marked Diagrams - Markdeep iteration#4376
G-Ambatte wants to merge 10 commits intonaturalcrit:masterfrom
G-Ambatte:experimentalMarkedDiagrams

Conversation

@G-Ambatte
Copy link
Copy Markdown
Collaborator

This PR adds the Marked-Diagrams module, which uses the functions from Markdeep to generate SVGs from ASCII source.

Example Brew:

Content:

{{wide
```diagram

+-------------------+                           ^                      .---.
|    A Box          |__.--.__    __.-->         ║      .-.             |   |   ║   ║   |   |
|                   |        '--'               v     | * |<---        |   |   ║   v   v   |
+-------------------+                                  '-'             |   +---+<==+===+---+->
                       Round                                       *---(-. |   |   ^   ║   ^
  .-----------------.  .-------.    .----------.         .-------.     | | |   |   |   ║   ║
 |   Mixed Rounded  | |         |  / Diagonals  \        |   |   |     | | |
 | & Square Corners |  '--. .--'  /              \       |---+---|     '-)-'       .--+-----.
 '--+------------+-'  .--. |     '-------+--------'      |   |   |       |        / Search /
    |            |   |    | '---.        |               '-------'       |       '-+------'
    |<==========>|   |    |      |       v                Interior                 |     ^
    '           <---'      '----'   .-----------.              ---.     .---       v     |
 .------------------.  Diag line    | .-------. +---.              \   /           .     |
 |   if (a > b)     +---.      .--->| |       | |    | Curved line  \ /           / \    |
 |   obj->fcn()     |    \    /     | '-------' |<--'                +           /   \   |
 '------------------'     '--'      '--+--------'      .--. .--.     |  .-.     +Done?+-'
    .---+-----.                        |   ^           |\ | | /|  .--+ |   |     \   /
    |   |     | Join        \|/    |   |   | Curved    | \| |/ | |    \    |      \ /
    |   |     +---->  ◌    --◍--   |    '-'  Vertical  '--' '--'  '--  '--'        +  .---.
 <--+---+-----'       |     /|\    ║                                               |  | 3 |
                      v            ║                not:line    'quotes'        .-'   '---'
  .-.             .---+--------.   |        /            A || B   *bold*       |        ^
 |   |           |   Not a dot  |  |   <---+===<--    A dash--is not a line    v        |
  '-'             '---------+--'          /           Nor/is this.            ---       |

--->~~~>--->===>~~~>====----====~~~~----.__.----.__.----~~~~====----====<~~~<===<---<~~~<---

\```  <= Please note, the end of this codefence is escaped so GitHub doesn't parse it incorrectly
}}

Styling:

.page svg {
  width: 100%;
}

Result:
image


Limitations

The current function from MarkDeep does not generate actual polygons, but rather disjoint collections of paths. Thus, most styling is not possible on most diagram features.

@G-Ambatte
Copy link
Copy Markdown
Collaborator Author

The test diagram in a deployment document:

https://homebrewery-pr-4376.herokuapp.com/edit/L5XFZ-FoHbmZ

@5e-Cleric
Copy link
Copy Markdown
Member

can characters be escaped of the diagram? for example say i wanted to have a single o in a text, but that makes the white circle, can i escape it to get the text?

@5e-Cleric
Copy link
Copy Markdown
Member

It works even better than i thought, although having to add manually the spaces or any character back for everything to realign is a bit of a pain.

@G-Ambatte
Copy link
Copy Markdown
Collaborator Author

It works even better than i thought, although having to add manually the spaces or any character back for everything to realign is a bit of a pain.

I have been experimenting with the deployment and I definitely don't hate the diagrams... but the inability to style arrows or blocks individually is definitely problematic.

@ericscheid
Copy link
Copy Markdown
Collaborator

It's a fascinating implementation of what is essentially just ASCII Art.

@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-4376 September 30, 2025 03:06 Inactive
@G-Ambatte
Copy link
Copy Markdown
Collaborator Author

It's a fascinating implementation of what is essentially just ASCII Art.

I'm not against implementing this functionality; it's better than the nothing that is currently available... Perhaps changing the activation language from diagram to asciiArt might help tune down user expectations to a more reasonable level.

@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-4376 December 30, 2025 06:03 Inactive
@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-4376 December 30, 2025 07:10 Inactive
@G-Ambatte G-Ambatte temporarily deployed to homebrewery-pr-4376 December 31, 2025 19:33 Inactive
@5e-Cleric
Copy link
Copy Markdown
Member

What does this PR need to reach completion? or is it ready already

@5e-Cleric 5e-Cleric moved this from Backlog to Under Review in @calculuschild's backlog Jan 3, 2026
@G-Ambatte
Copy link
Copy Markdown
Collaborator Author

What does this PR need to reach completion? or is it ready already

At this point, if we want to move ahead with it, we either:

a) bring the Markdeep diagram extension files into the Homebrewery project, or
b) publish the Markdeep Diagrams for Markdown as a full Marked extension, so that this PR no longer points at the repository on my personal GitHub; probably bringing it into the NC umbrella, much like has been done with the other Marked extensions.

Beyond redirecting the module location, I think this PR is as ready as it's going to get.

@5e-Cleric
Copy link
Copy Markdown
Member

What does this PR need to reach completion? or is it ready already

At this point, if we want to move ahead with it, we either:

a) bring the Markdeep diagram extension files into the Homebrewery project, or b) publish the Markdeep Diagrams for Markdown as a full Marked extension, so that this PR no longer points at the repository on my personal GitHub; probably bringing it into the NC umbrella, much like has been done with the other Marked extensions.

Beyond redirecting the module location, I think this PR is as ready as it's going to get.

I vote for b, makes it way easier to remove if we ever want to stop using it, opens it up for other people, and will be less things to test in-house.

@5e-Cleric
Copy link
Copy Markdown
Member

This is now completely broken when pulling from master, got any idea?

@5e-Cleric 5e-Cleric added the 🔍 R3 - Reviewed - Awaiting Fixes 🔧 PR is okayed but needs fixes before merging label Mar 25, 2026
@G-Ambatte G-Ambatte had a problem deploying to homebrewery-pr-4376 March 26, 2026 06:41 Failure
@G-Ambatte
Copy link
Copy Markdown
Collaborator Author

This is now completely broken when pulling from master, got any idea?

I changed the name of the package to better reflect it's origin in Markdeep, and forgot to update the dependency in package.json. It's fixed now, but now there's a hanging conflict with stylelint. I'll dig a little deeper and see what's going on with that.

@G-Ambatte G-Ambatte had a problem deploying to homebrewery-pr-4376 March 26, 2026 07:04 Failure
@G-Ambatte G-Ambatte had a problem deploying to homebrewery-pr-4376 March 26, 2026 07:11 Failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experiment P2 - minor feature or not urgent Minor bugs or less-popular features 🔍 R3 - Reviewed - Awaiting Fixes 🔧 PR is okayed but needs fixes before merging

Projects

Status: Under Review

Development

Successfully merging this pull request may close these issues.

4 participants