Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elliotgao2/tomd
Convert HTML to Markdown.
https://github.com/elliotgao2/tomd
html markdown python
Last synced: 23 days ago
JSON representation
Convert HTML to Markdown.
- Host: GitHub
- URL: https://github.com/elliotgao2/tomd
- Owner: elliotgao2
- License: gpl-3.0
- Created: 2017-05-25T15:13:41.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-02-02T10:49:25.000Z (almost 5 years ago)
- Last Synced: 2024-10-30T00:10:31.571Z (about 1 month ago)
- Topics: html, markdown, python
- Language: Python
- Size: 44.9 KB
- Stars: 531
- Watchers: 16
- Forks: 71
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- starred-awesome - tomd - Convert HTML to Markdown. (Python)
- project-awesome - elliotgao2/tomd - Convert HTML to Markdown. (Python)
README
# tomd
![[License](https://pypi.python.org/pypi/tomd/)](https://img.shields.io/pypi/l/tomd.svg)
![[Pypi](https://pypi.python.org/pypi/tomd/)](https://img.shields.io/pypi/v/tomd.svg)
![[Python](https://pypi.python.org/pypi/tomd/)](https://img.shields.io/pypi/pyversions/tomd.svg)When crawling online articles such as news, blogs, etc. I want to save them in markdown files but not databases.
Tomd has the ability of converting a HTML that converted from markdown. If a HTML can't be described by markdown, tomd can't convert it right.
Tomd is a python tool.## Road map
- [x] Basic support
- [ ] Full support(Nested list)
- [ ] Command line tool## Installation
`pip install tomd`
## Getting Started
Input
```python
import tomdtomd.Tomd('
h1
').markdown
# or
tomd.convert('h1
')
```Output
```markdown
# h1
```## Usage
```python
from tomd import Tomdhtml="""
h1
h2
h3
h4
h5
h6
paragraph
link
img
- 1
- 2
- 3
- 1
- 2
- 3
blockquote
inline code
block code
del
bold
italic
bold italic
th1
th2
td
td
td
td
"""
Tomd(html).markdown
```
## Result
```markdown
# h1
## h2
### h3
#### h4
##### h5
###### h6
paragraph
[link](https://github.com)
![img](https://github.com)
- 1
- 2
- 3
1. 1
1. 2
1. 3
> blockquote
`inline code`
block code
~~del~~
**bold**
*italic*
***bold italic***
---
|th1|th2
|------
|td|td
|td|td
```