mdi : embed code in markdown / version number / markdown ...
Preface
Embedding version numbers and demo code in readme.md
is a very common requirement.
There are some similar tools on the market, but none of them works well. So I wrote one myself ( executable size 256 KB ).
The function is to write a statement like > ./demo.js
in markdown to embed the code, and the screenshot of the generated content is as follows :
In addition, with the markdown translation tool I wrote based on deepl, you can automatically translate and render Chinese and English in the same readme.md
file.
Then set an in-text anchor point (as below) at the top of the github readme, and click it to jump to the various language versions of the instructions, which will be a good user experience.
Installation
Download from github or cargo install mdi
Use
mdi [dir]
It will search the directory xxx.mdi.md
and replace > ./xxx.rs
with the embedded code content, and then output to xxx.md
.
If the embed is a markdown file, it will recursively render the references in it.
View the demo file readme.mdi.md