markdown-blockdiag
markdown-blockdiag copied to clipboard
Add edge_label_box configuration to optionally remove edge label boxes
Adds configuration to render edge labels without bounding boxes for cleaner diagrams.
Changes
-
New configuration:
edge_label_box(default:True) inBlockdiagExtension -
Drawing logic: Monkey-patches blockdiag's
edge_labelmethod to omitoutlineparameter when disabled -
Compatibility fix: Made
md_globalsoptional inextendMarkdownfor newer Markdown versions - Documentation: Added configuration options section to README with usage examples
-
Tests: Added
test_edge_label_box_configto verify configuration behavior
Usage
# Python API
diagram = draw_blockdiag(content, edge_label_box=False)
# Markdown extension
markdown.markdown(text, extensions=['markdown_blockdiag'],
extension_configs={'markdown_blockdiag': {'edge_label_box': False}})
# MkDocs
markdown_extensions:
- markdown_blockdiag:
edge_label_box: False
Implementation Notes
Only blockdiag uses outline parameter for edge label boxes. Seqdiag renders edge labels without boxes by default, so no patching needed. The monkey-patch approach avoids modifying upstream blockdiag library while providing clean API surface.
Original prompt
This section details on the original issue you should resolve
<issue_title>Support Removal of Edge Label Box</issue_title> <issue_description>Optionally rendering Edge Labels without a bounding box could produce cleaner diagrams.</issue_description>
Comments on the Issue (you are @copilot in this section)
- Fixes gisce/markdown-blockdiag#13
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.