mdi : embed code in markdown / version number / markdown ...


Embedding version numbers and demo code in 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 toolopen in new window I wrote based on deeplopen in new window, you can automatically translate and render Chinese and English in the same 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.


Download from githubopen in new window or cargo install mdi

Codebase addressopen in new window


mdi [dir]

It will search the directory and replace > ./ with the embedded code content, and then output to

If the embed is a markdown file, it will recursively render the references in it.

View the demo file readme.mdi.mdopen in new window

Last Updated:
Contributors: gcxfd