Progressbars for Markdown Now there's a spec

4 pointsposted 6 hours ago
by markg85

2 Comments

markg85

6 hours ago

I wanted to have a progressbar in markdown so I sat down and created a spec for it. AI helped me draft a format that is markdown friendly.

The spec itself is here: https://github.com/markg85/static-hedgedoc/blob/main/specs/p... but it's better to view it through my static renderer (https://static-hedgedoc.sc2.nl/?mdfile=specs/progress_bar.md) as it obviously supports my own extensions :) Github doesn't.

The code that implements this can be found here (markdown-it): https://github.com/markg85/static-hedgedoc/blob/main/js/mark...

Some short examples:

This would show a bar full at 25%, no text on the bar. Here no min and max is specified so 0 and 100 is implied behind the scenes [progress 25]

Same bar but with "25.00%" [progress 25 "{%:.2}%"]

Or just the percentage [progress 25 "{%}%"]

Or a more elaborate value (format is current | min | max) that also shows 25%: [progress 1000 0 4000 "{%}%"]

user

6 hours ago

[deleted]