4 ms·
https://casual-effects.com/markdeep/ https://casual-effects.com/markdeep/ has a similar idea but different execution. I use something similar for my blog (I do
by phiresky 4y ago
https://casual-effects.com/markdeep/ https://casual-effects.com/markdeep/ has a similar idea but different execution.
I use something similar for my blog (I don't have a WYSIWYG editor for the widgets though, that's pretty neat): The posts are written in markdown, but then there's a few "widgets" that are basically markdown code blocks with a special "language" tag set that will render a React component with the text content as a input prop. I also use pandoc-flavored markdown (https://pandoc.org/ https://pandoc.org/) which already has many features that make formatting a bit more complex things easier (tables, latex math, ...)
For example a bar chart widget ( https://phiresky.github.io/blog/2019/rga--ripgrep-for-zip-targz-docx-odt-epub-jpg/ https://phiresky.github.io/blog/2019/rga--ripgrep-for-zip-ta... ):
[...] it will be much slower:
```barchart
title: Searching in 65 pdfs with 93 slides each
series: run time (seconds, lower is better)
data:
pdfgrep: 19.16
rga (first run): 2.95
rga (subsequent runs): 0.092
```
becomes a colored bar chart with three bars. So the file is both kinda readable in a plain text editor, in a browser with js disabled (with React server side rendering), and in the richest version with JS enabled.
Full example:
Markdown:
https://github.com/phiresky/blog/blob/master/posts/2021/hosting-sqlite-databases-on-github-pages.md https://github.com/phiresky/blog/blob/master/posts/2021/host...
Corresponding post with interactive widgets:
https://phiresky.github.io/blog/2021/hosting-sqlite-databases-on-github-pages/ https://phiresky.github.io/blog/2021/hosting-sqlite-database...