An open API service indexing awesome lists of open source software.

https://github.com/smrfeld/medium-to-markdown

Helpers to parse your data downloaded from Medium into markdown
https://github.com/smrfeld/medium-to-markdown

convert html markdown medium python

Last synced: 2 months ago
JSON representation

Helpers to parse your data downloaded from Medium into markdown

Awesome Lists containing this project

README

          

# Medium to markdown

Convert your medium articles from their `html` format to `markdown`. A deep copy of your data can be made, including images.

## Example

An example input and output are located in the `example` directory.

drawing

drawing

## Usage

1. Go to your medium account and request a copy of your data.

2. Look for the `posts` directory where your articles are located in `html` format.

3. Execute:
```
python run.py convert --posts-dir --output-dir
```
to convert the posts into the output directory in Markdown format.

The default posts directory is `posts` and the default output directory is `output`.

The `convert` command executes the following commands:
```
convert_html_to_md(args)
download_imgs(args, cover_img_only=True)
resize_cover_imgs0(args)
```
i.e.
1. Converts HTML in the `posts` directory to markdown
2. Downloads the cover images
3. Resizes the cover images

You can also run the commands independently:
```
python run.py convert-html-to-md
python run.py download-cover-imgs
python run.py resize-cover-imgs
```
To see a full list of options:
```
python run.py -h
```