Skip to main content

Remotify local links in README.md.

Project description

mdremotifier

warning _THIS PROJECT IS ALPHA^ALPHA, NOT READY FOR USE

Audience: Developers Platform: Linux

🎇Features  •  🏠Installation  •  🚜Usage  •  💻CLI  •  💡Examples  •  ✅Requirements

Top language GitHub License PyPI - Version Python Version

CLI to replace ./image.png to <raw.githubusercontent.com> remote URL in README.md


Status Stable Unstable
Master Build and Test since tagged last commit
Develop Build and Test since tagged since tagged last commit
Demo

❔ 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.2.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

Output of `python -m mdremotifier.cli --help`

💡 Examples

✅ 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:

🤝 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).
    • Requires pyenv, or an exact matching version of python as in .python-version (which is currently 3.8.0 ).
    • jq, (installation) required for yq, which is itself required for our ./README.md generation, which uses tomlq (from the yq package) to include version strings from ./pyproject.toml.
    • bash, grep, awk, sed xxd, git, xxhash, rsync (for tests/workflows).
    • Requires nodejs (for act).
    • Requires Go (to run act).
    • docker (for act, animation).

Commit Process

  1. (Optionally) Fork the develop branch.
  2. Stage your files: git add path/to/file.py.
  3. bash ./scripts/pre.sh, this will format, lint, and test the code.
  4. git status check if anything changed (generated ./README.md for example), if so, git add the changes, and go back to the previous step.
  5. git commit -m "...".
  6. Make a PR to develop (or push to develop if you have the rights).

🔄🚀 Release Process

These instructions are for maintainers of the project.

  1. In the develop branch, run bash ./scripts/pre.sh to ensure everything is in order.
  2. In the develop branch, bump the version in ./pyproject.toml, following semantic versioning principles. Also modify the last_unstable_release and last_stable_release in the [tool.mdremotifier-project-metadata] table as appropriate. Run bash ./scripts/pre.sh to ensure everything is in order.
  3. In the develop branch, commit these changes with a message like "Prepare release X.Y.Z". (See the contributions section above).
  4. Merge the develop branch into the master branch: git checkout master && git merge develop --no-ff.
  5. master branch: Tag the release: Create a git tag for the release with git tag -a vX.Y.Z -m "Version X.Y.Z".
  6. Publish to PyPI: Publish the release to PyPI with bash ./scripts/deploy-to-pypi.sh.
  7. Push to GitHub: Push the commit and tags to GitHub with git push && git push --tags.
  8. The --no-ff option 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.
  9. Push the develop branch to GitHub: git push origin develop.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mdremotifier-0.2.0.tar.gz (19.1 kB view details)

Uploaded Source

Built Distribution

mdremotifier-0.2.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file mdremotifier-0.2.0.tar.gz.

File metadata

  • Download URL: mdremotifier-0.2.0.tar.gz
  • Upload date:
  • Size: 19.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.0

File hashes

Hashes for mdremotifier-0.2.0.tar.gz
Algorithm Hash digest
SHA256 4ceab764fe0bf5bb0a1b0d58930c7b6ae14717c443c492b1a69f8f7d923f167b
MD5 8a34ddd40cee2098dca15a92fe4e3a41
BLAKE2b-256 4dfacd3a9b74bc0a0d9e9dc453d1631c29d69b4ef3875f4c860c09044cb6b151

See more details on using hashes here.

File details

Details for the file mdremotifier-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mdremotifier-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0a5867ac5271bb9d699fe7752892f33cdcf4a293cb4848f9b867ee5b7fc83459
MD5 d470829a31a0e060f063380a659505ab
BLAKE2b-256 1fb735fe9e069e6fd562863be36446b4718dfc739820ce1031cb802254f2a3bf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page