Skip to main content

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 --root option:
    • --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_links with smarter path handling for cross-project references.

  • Add more Markdown processing tools:

    • frontmatter manager
    • heading/link normalizer
    • link checker / validator
  • Provide em-md as 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:

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:

Metadata

Release files for em-md 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for em-md 0.1.0
File Size Uploaded Provenance Actions
em_md-0.1.0.tar.gz 7.5 kB Without provenance Details for em_md-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for em-md 0.1.0
File Interpreter ABI Platform Actions
em_md-0.1.0-py3-none-any.whl Python 3 none any Details for em_md-0.1.0-py3-none-any.whl

Total release size: 15.2 kB

Release files / em_md-0.1.0.tar.gz

Download URL em_md-0.1.0.tar.gz
Size 7.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6b61419ce1f6917529c530476540e7c13bfe55aa0dce321f44d11c59b3247243
BLAKE2b-256 checksum
How to use checksums
bc1f3891beec5eb7e663af4e0a40fadaa38c344eb32b3496720b0873367c6acf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Release files / em_md-0.1.0-py3-none-any.whl

Download URL em_md-0.1.0-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
397b2a0934d7c6f12e83356a881e4de93758182ce6e379b13fcbc2d662083e42
BLAKE2b-256 checksum
How to use checksums
d2faf23cab5caa386820ec330e69e6e51d0ab9915862595552d16c3617767e04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.0.1 CPython/3.12.3

Security for em-md 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page