🎇Features • 🏠Installation • 🚜Usage • 💻CLI • 💡Examples • ✅Requirements
❔ What
What mdremotifier does:
Turn this (./mdremotifier/examples/EXAMPLE.md):
# Example markdown file
A link to a local file [LICENSE.md](./LICENSE.md).
Into this (./mdremotifier/examples/EXAMPLE.remotified.md):
# Example markdown file
A link to a local file [LICENSE.md](https://raw.githubusercontent.com/realazthat/mdremotifier/master/LICENSE.md).
This is useful for uploading README.md files to third-party sites, like the
npmjs.com registry, or pypi.org registry, because these registries will break
the local images in your README when displayed on their sites.
🎇 Features
- 📷🔗📡🌐🖼️ Replace local URLs with raw.githubusercontent.com URLs.
🏠 Installation
# Install from pypi (https://pypi.org/project/mdremotifier/)
pip install mdremotifier
# Install from git (https://github.com/realazthat/mdremotifier)
pip install git+https://github.com/realazthat/mdremotifier.git@v0.3.0
🚜 Usage
Example README: (./mdremotifier/examples/EXAMPLE.md):
# Example markdown file
A link to a local file [LICENSE.md](./LICENSE.md).
Generating the README:
$ python -m mdremotifier.cli -i ./mdremotifier/examples/EXAMPLE.md --url-prefix https://raw.githubusercontent.com/realazthat/mdremotifier/master/ -o - 2>/dev/null
# Example markdown file
A link to a local file [LICENSE.md](https://raw.githubusercontent.com/realazthat/mdremotifier/master/LICENSE.md).
💻 Command Line Options
💡 Examples
- mdremotifier's own
README:- Original: ./README.md.
- Remotified: ./.github/README.remotified.md.
- Generation script: ./scripts/generate-readme.sh.
- Example:
- Original: ./mdremotifier/examples/EXAMPLE.md.
- Remotified: ./mdremotifier/examples/EXAMPLE.remotified.md.
- Generation script: ./mdremotifier/examples/example.sh.
✅ Requirements
- Linux-like environment
- Why: Uses pexpect.spawn().
- Python 3.8+
- Why: Some dev dependencies require Python 3.8+.
Tested Platforms
- WSL2 Ubuntu 20.04, Python
3.8.0. - Ubuntu 20.04, Python
3.8.0, 3.9.0, 3.10.0, 3.11.0, 3.12.0, tested in GitHub Actions workflow (build-and-test.yml).
🤏 Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
🔑 License
This project is licensed under the MIT License - see the ./LICENSE.md file for details.
🙏 Thanks
Main libraries used in mdremotifier are:
- Markdown AST: mistletoe.
- Colorful CLI help: rich-argparse.
🤝 Related Projects
Not complete, and not necessarily up to date. Make a PR (contributions) to insert/modify.
| Project | Stars | Last Update | Language | Platform | Similarity X Obviousness |
|---|---|---|---|---|---|
| bdashore3/remark-github-images | 0 | 2022/12/29 |
JS | CLI | ⭐⭐⭐⭐⭐ |
| laobie/WriteMarkdownLazily | 36 | 2024/01/06 |
Python | CLI | ⭐⭐⭐⭐ |
| crh19970307/mdul | 1 | 2020/02/01 |
Python | CLI | ⭐⭐⭐⭐ |
| SkyLee424/Go-MarkDown-Image-Transfer-Helper | 0 | 2024/03/25 |
Go | CLI | ⭐⭐⭐⭐ |
| jen6/imgo | 0 | 2020/03/18 |
Pyhon | CLI | ⭐⭐⭐⭐ |
| chocoluffy/lazy-markdown | 0 | 2016/11/20 |
Python | CLI | ⭐⭐⭐⭐ |
| loheagn/gopic | 0 | 2021/11/24 |
Go | CLI | ⭐⭐⭐⭐ |
| Undertone0809/imarkdown | 57 | 2024/01/06 |
Python | Python | ⭐⭐⭐ |
| ravgeetdhillon/markdown-imgur-upload | 1 | 2022/03/26 |
Python | CLI | ⭐⭐⭐ |
🫡 Contributions
Development environment: Linux-like
-
For running
pre.sh(Linux-like environment).-
From ./.github/dependencies.yml, which is used for the GH Action to do a fresh install of everything:
bash: scripts. findutils: scripts. grep: tests. xxd: tests. git: scripts, tests. xxhash: scripts (changeguard). rsync: out-of-directory test. expect: for `unbuffer`, useful to grab and compare ansi color symbols. jq: dependency for [yq](https://github.com/kislyuk/yq), which is used to generate the README; the README generator needs to use `tomlq` (which is a part of `yq`) to query `pyproject.toml`.
-
Requires
pyenv, or an exact matching version of python as in .python-version (which is currently3.8.0). -
jq, (installation) required for yq, which is itself required for our ./README.md generation, which usestomlq(from the yq package) to include version strings from ./pyproject.toml. -
act (to run the GH Action locally):
- Requires nodejs.
- Requires Go.
- docker.
-
Generate animation:
- docker
-
Commit Process
- (Optionally) Fork the
developbranch. - Stage your files:
git add path/to/file.py. bash ./scripts/pre.sh, this will format, lint, and test the code.git statuscheck if anything changed (generated ./README.md for example), if so,git addthe changes, and go back to the previous step.git commit -m "...".- Make a PR to
develop(or push to develop if you have the rights).
🔄🚀 Release Process
These instructions are for maintainers of the project.
- In the
developbranch, runbash ./scripts/pre.shto ensure everything is in order. - In the
developbranch, bump the version in ./pyproject.toml, following semantic versioning principles. Also modify thelast_unstable_releaseandlast_stable_releasein the[tool.mdremotifier-project-metadata]table as appropriate. Runbash ./scripts/pre.shto ensure everything is in order. - In the
developbranch, commit these changes with a message like"Prepare release X.Y.Z". (See the contributions section above). - Merge the
developbranch into themasterbranch:git checkout master && git merge develop --no-ff. masterbranch: Tag the release: Create a git tag for the release withgit tag -a vX.Y.Z -m "Version X.Y.Z".- Publish to PyPI: Publish the release to PyPI with
bash ./scripts/deploy-to-pypi.sh. - Push to GitHub: Push the commit and tags to GitHub with
git push && git push --tags. - The
--no-ffoption adds a commit to the master branch for the merge, so refork the develop branch from the master branch:git checkout develop && git merge master. - Push the develop branch to GitHub:
git push origin develop.
Release files for mdremotifier 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mdremotifier-0.3.0.tar.gz | 19.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mdremotifier-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 31.3 kB
Release files / mdremotifier-0.3.0.tar.gz
| Download URL | mdremotifier-0.3.0.tar.gz |
|---|---|
| Size | 19.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
44376ed1e4a6a030c5f2f8fc6490d9bc8928ad54a5bc7cc3852bd08dee3c1d79
|
|
BLAKE2b-256 checksum How to use checksums |
c87b7c9ecdfcdf9914797196fb9aaedefeb5336ca18dd577c8b810ba63b862f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.0
|
Release files / mdremotifier-0.3.0-py3-none-any.whl
| Download URL | mdremotifier-0.3.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4d39fb020117133b3ed18a2b8a92562bd981deabac5c4ca28f42988acd49d179
|
|
BLAKE2b-256 checksum How to use checksums |
a53e58f24e142049a45cb9f04b88f3b3b64a229c1fa7d5f20e1b146ecad71022
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.0
|