Pup
A command line tool aiming to upload the local image used in your markdown file to the GitHub repo and replace the local file path with the returned URL.
TO DO
- Use system password management to store TOKEN
- Support for Windows
- Multithreading file manipulation
- Relative image path support
Demo video
How to use
- Go to token-settings to generate a new token, make sure it has access to your picture repo.
- Then clone this repo and build from source
Or download the prebuilt binary, currently only available for macOS(arm64)
$ git clone https://github.com/SteveLauC/pup.git
$ cd pup
$ cargo build
- Move the compiled binary to the directory in your $PATH
$ cp target/debug/pup your_dir
- Double check you have pup installed
$ which pup
some_path_to_pup
- init config file
$ pup
name is unset.
repo is unset.
mail is unset.
token is unset.
- On your first run,
pup
will create a configuration file under$HOME/.config/pup
and complain about the incompleteness of the configuration to you. - Then edit it to make it complete.
$ vim $HOME/.config/pup/config.toml
Make it something like the following one, remeber to replace each field with your own one.
Currently the token is stored in plain text, will fix it later!
# configuration file for pup
[user]
github-user-name = "SteveLauC"
github-repo-name = "test-repo"
mail = "[email protected]"
[authorization]
token = "your-secret-token"
- Time to enjoy
$ pup your-markdown-file.md