# mii **Repository Path**: codepee/mii ## Basic Information - **Project Name**: mii - **Description**: Markdown Include Images - **Primary Language**: Unknown - **License**: GPL-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-14 - **Last Updated**: 2026-01-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # mii - Markdown-include-images A script tool that replaces externally linked images in a Markdown file with their base64-encoded content (embedded directly in the file). ![mii by draw.io](./mii.png) **ATTENTION**: Gitee doesn't support this kind of markdown file,i give up. ## Dependence If no externally images in the source markdown file,no need to install this module,and no errors will show. ```shell $pip install aiohttp # OR $pip install aiohttp -i https://pypi.tuna.tsinghua.edu.cn/simple ``` ## Usage ```shell python markdown-include-images.py [-i][-o other-markdown-file] input-markdown-file -i,--interactive overwrite input-markdown-file -o other-markdown-file,--output other-markdown-file save the content to other-markdown-file ``` ## What Happened Just replace all the image anchor(`![alt](path-to-image)`) to local image id tag and convert the image to base64 string,and append them at the tail of markdown file. ## Here is a test ### image doesn't exist ![I know this local image doesn't exist](./res/test.jpg) ### image online ![this is online](https://wallpapercave.com/wp/wp8788340.jpg) ![this is online](https://wallpapercave.com/wp/wp8788341.jpg) ![this is online](https://wallpapercave.com/wp/wp8788342.jpg) ## Here is the result ```shell x@wang:~/ws/mii$ python3 markdown-include-images.py README.md -o new-readme >>> [WARN] image file (/home/x/ws/mii/path-to-image) not found,skip this tag: ![alt](path-to-image)... >>> [WARN] image file (/home/x/ws/mii/./res/test.jpg) not found,skip this tag: ![this local image doesn't exist](./res/test.jpg)... >>> operation done,output file:new-readme.md ```