Skip to content

micnncim/medicine

Repository files navigation

MIT License Go Report Card


Come on, Medium code blocks do not support syntax highlighting... Although we can use syntax highlight by GitHubGist, it's painful when we have many code blocks.

medicine automatically converts code blocks with markdown in Medium into GitHubGist embedded links.

Table of Contents

Description

Look at an example of medicine.

Convert the code block in your Medium article

func main() {
    fmt.Println("Hello, World!")
}

into the embedded Gist!

screenshot 2018-07-31 11 22 44

Installation

$ go get github.com/micnncim/medicine

Usage

  1. Get GitHub Access Token and Medium Access Token.
  2. Prepare a Markdown file. See the following rules.
  • The first line should be Medium article title.
  • Code blocks require a filename. See the example.
  1. Run medicine <MARKDOWN_FILE> . If you run it for the first time, it requires your access tokens and saves the tokens in ~/.config/medicine/config.toml .
  2. A few seconds later, your browser opens your Medium article from the markdown file as a draft. Edit and publish it!

Example

Clone this repository and cd the path. Then, just run it!

$ medicine example.md

Author

@micnncim

License

FOSSA Status