https://github.com/matsubara0507/mdium
Send post written by Markdown to Medium
https://github.com/matsubara0507/mdium
haskell-application
Last synced: about 1 year ago
JSON representation
Send post written by Markdown to Medium
- Host: GitHub
- URL: https://github.com/matsubara0507/mdium
- Owner: matsubara0507
- License: mit
- Created: 2018-11-02T12:08:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-05-05T14:07:52.000Z (about 3 years ago)
- Last Synced: 2025-04-22T23:12:26.476Z (about 1 year ago)
- Topics: haskell-application
- Language: Haskell
- Size: 1.21 MB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# mdium
## Requirement
- [Haskell Stack](https://docs.haskellstack.org/en/stable/README/) or Docker
- Medium integration token
- you can generate in [medium settigns](https://medium.com/me/settings).
## Install
Clone this repository:
```
$ git clone https://github.com/matsubara0507/mdium.git
$ cd mdium
```
Install with stack tool:
```
$ stack install mdium
```
### Install with Docker
Use https://github.com/users/matsubara0507/packages/container/mdium
```
$ docker pull ghcr.io/matsubara0507/mdium
```
Use command:
```
$ docker run --rm --env-file="$HOME/.env" -v `pwd`:/work -w /work ghcr.io/matsubara0507/mdium example/example.md
```
## Usage
```
$ mdium --help
mdium [options] [input-file]
--help Show this help text
--version Show version
-v --verbose Enable verbose mode: verbosity level "debug"
--me Call Medium `me` API
--title=TEXT Specify title of story that post to medium
--org=PUBLICATION_ID Post story to PUBLICATION_ID organization
--publications Call Medium `publications` API
--gist=TEXT Replace code block to gist link, TEXT is prefix for gist file name
```
Set Medium integration token to `MEDIUM_TOKEN` environment (use `./.env` or `~/.env`).
Can check to validate your token by executing `medium --me` command:
```
$ mdium --me
Hi MATSUBARA Nobutada!!
```
If post [`examle/example.md`](example/example.md) to Medium:
```
$ mdium --gist=mdium-example- ./example/examle.md
post success, browse to: https://medium.com/@nobutada/f40bd8e72f3e
```
then generate story like below in Medium:

## For Development
### Build with Docker
```
$ stack --docker --local-bin-path=./bin install
$ docker build -t matsubara0507/mdium . --build-arg local_bin_path=./bin
```