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 toolopen in new window I wrote based on deeplopen in new window, 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 githubopen in new window or cargo install mdi

Codebase addressopen in new window

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.mdopen in new window

Last Updated:
Contributors: gcxfd