Some markdown processing tools
Project description
Em-Md
tools for processing markdown files & projects with python & CLI
Features
- Local Links Processor
Rewrite Markdown links and embedded media paths in all markdown files in the directory specified with the--rootoption:--mode to-absolute: convert relative links into root-absolute links (relative to your project root).--mode to-relative: convert absolute links (that point to existing files within the project) back into relative paths.- Supports inline links/images, reference-style links, and HTML embeds (
<img>,<a>,<video>,<audio>,<source>). - Skips code blocks and inline code to avoid accidental rewrites.
- Flexible output: root-absolute (
/path/file.md),file:///URLs, or URLs with a base (e.g.https://example.com/...). - CLI with dry-run (
--print-changes), in-place rewrite (--write), and automatic backups (--backup).
This is just the first tool — more Markdown utilities will be added to the Em-Md toolbox over time.
Quickstart
Install on local machine:
pip install em-md
Run the local links processor on your project:
em-md-change-links \
--root . \
--glob "**/*.md" \
--mode to-absolute \
--print-changes
Apply changes in place (with backups):
em-md-change-links \
--root . \
--glob "**/*.md" \
--mode to-absolute \
--write --backup
Convert absolute paths back to relative paths:
em-md-change-links \
--root . \
--glob "**/*.md" \
--mode to-relative \
--write
Documentation
DevOps
To get started using this repository's code, checkout the commands built into its Makefile by running:
make help
Roadmap
-
Extend
local_linkswith smarter path handling for cross-project references. -
Add more Markdown processing tools:
- frontmatter manager
- heading/link normalizer
- link checker / validator
-
Provide
em-mdas an installable CLI entrypoint (pip install em-md). -
Package docs with worked examples and best practices.
Contributing
Get Involved
- GitHub Discussions: if you want to share ideas
- GitHub Issues: if you find bugs, other issues, or would like to submit feature requests
- GitHub Merge Requests: if you think you know what you're doing, you're very welcome!
Donations
To support me in my work on this and other projects, you can make donations with the following currencies:
- Bitcoin:
BC1Q45QEE6YTNGRC5TSZ42ZL3MWV8798ZEF70H2DG0 - Ethereum:
0xA32C3bBC2106C986317f202B3aa8eBc3063323D4 - Fiat (via Credit or Debit Card, Apple Pay, Google Pay, Revolut Pay)
Donations help me:
- dedicate more time to developing and maintaining open-source projects
- cover costs for IT infrastructure
- finance projects requiring additional hardware & compute
About the Developer
This project is developed by a human one-man team, publishing under the name Emendir.
I build open technologies trying to improve our world;
learning, working and sharing under the principle:
Freely I have received, freely I give.
Feel welcome to join in with code contributions, discussions, ideas and more!
Open-Source in the Public Domain
I dedicate this project to the public domain. It is open source and free to use, share, modify, and build upon without restrictions or conditions.
I make no patent or trademark claims over this project.
Formally, you may use this project under either the:
- MIT No Attribution (MIT-0) or
- Creative Commons Zero (CC0) licence at your choice.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file em_md-0.1.0.tar.gz.
File metadata
- Download URL: em_md-0.1.0.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b61419ce1f6917529c530476540e7c13bfe55aa0dce321f44d11c59b3247243
|
|
| MD5 |
1757593e3ac4b793d58a907f23341c12
|
|
| BLAKE2b-256 |
bc1f3891beec5eb7e663af4e0a40fadaa38c344eb32b3496720b0873367c6acf
|
File details
Details for the file em_md-0.1.0-py3-none-any.whl.
File metadata
- Download URL: em_md-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
397b2a0934d7c6f12e83356a881e4de93758182ce6e379b13fcbc2d662083e42
|
|
| MD5 |
065c3edf62e818e57bf88a96f3d564f9
|
|
| BLAKE2b-256 |
d2faf23cab5caa386820ec330e69e6e51d0ab9915862595552d16c3617767e04
|