All Projects → Alir3z4 → html2text

Alir3z4 / html2text

Licence: GPL-3.0 license
Convert HTML to Markdown-formatted text.

Projects that are alternatives of or similar to html2text

Fresh
上海科技大学新生生存手册 React.js Markdown文档自动生成器
Stars: ✭ 54 (-96%)
Mutual labels:  markdown-parser
Westwind.aspnetcore.markdown
An ASP.NET Core Markdown support library that provides Markdown parsing, a Markdown TagHelper and Markdown Page Handler Middleware
Stars: ✭ 148 (-89.05%)
Mutual labels:  markdown-parser
Markdown
A Python implementation of John Gruber’s Markdown with Extension support.
Stars: ✭ 2,725 (+101.7%)
Mutual labels:  markdown-parser
Laravel Smartmd
🎯 A simple markdown editor compatible most markdown parse,You can choose any parse methods on server or client,like Mathematical formula、flowchart、upload image...
Stars: ✭ 76 (-94.37%)
Mutual labels:  markdown-parser
Mdtool
A tool which can process markdown to HTML
Stars: ✭ 136 (-89.93%)
Mutual labels:  markdown-parser
Showdown
A bidirectional Markdown to HTML to Markdown converter written in Javascript
Stars: ✭ 12,137 (+798.37%)
Mutual labels:  markdown-parser
Markdown
A super fast, highly extensible markdown parser for PHP
Stars: ✭ 945 (-30.05%)
Mutual labels:  markdown-parser
SwiftMark
[⚠️Not a complete implementation] A Markdown renderer written in Swift.
Stars: ✭ 77 (-94.3%)
Mutual labels:  markdown-parser
Proton
A stand-alone application to quickly preview and edit Markdown files using Electron.
Stars: ✭ 140 (-89.64%)
Mutual labels:  markdown-parser
Markdig
A fast, powerful, CommonMark compliant, extensible Markdown processor for .NET
Stars: ✭ 2,730 (+102.07%)
Mutual labels:  markdown-parser
Markdown
Markdown parser written in Racket.
Stars: ✭ 93 (-93.12%)
Mutual labels:  markdown-parser
Forum
A fully-fledged modern forum app, including @mention and private messaging, built with Laravel 5.3 and Vue 2.
Stars: ✭ 135 (-90.01%)
Mutual labels:  markdown-parser
Myst Parser
An extended commonmark compliant parser, with bridges to docutils/sphinx
Stars: ✭ 157 (-88.38%)
Mutual labels:  markdown-parser
Gopdf
pdf document generation library
Stars: ✭ 63 (-95.34%)
Mutual labels:  markdown-parser
Frontyaml
YAML Front matter parser
Stars: ✭ 248 (-81.64%)
Mutual labels:  markdown-parser
Markdown Latex
A markdown parser for converting markdown to LaTeX written in PHP.
Stars: ✭ 40 (-97.04%)
Mutual labels:  markdown-parser
Markdown It Py
Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed. Now in Python!
Stars: ✭ 156 (-88.45%)
Mutual labels:  markdown-parser
blackfriday-confluence
🛠 Blackfriday-Confluence is confluence wiki renderer for the Blackfriday v2 markdown processor.
Stars: ✭ 20 (-98.52%)
Mutual labels:  markdown-parser
ModooCode
Repo for the Modoocode.
Stars: ✭ 42 (-96.89%)
Mutual labels:  markdown-parser
Parsedown
Better Markdown Parser in PHP
Stars: ✭ 13,959 (+933.23%)
Mutual labels:  markdown-parser

html2text

Build Status Coverage Status Downloads Version Wheel? Format License

html2text is a Python script that converts a page of HTML into clean, easy-to-read plain ASCII text. Better yet, that ASCII also happens to be valid Markdown (a text-to-HTML format).

Usage: html2text [filename [encoding]]

Option Description
--version Show program's version number and exit
-h, --help Show this help message and exit
--ignore-links Don't include any formatting for links
--escape-all Escape all special characters. Output is less readable, but avoids corner case formatting issues.
--reference-links Use reference links instead of links to create markdown
--mark-code Mark preformatted and code blocks with [code]...[/code]

For a complete list of options see the docs

Or you can use it from within Python:

>>> import html2text
>>>
>>> print(html2text.html2text("<p><strong>Zed's</strong> dead baby, <em>Zed's</em> dead.</p>"))
**Zed's** dead baby, _Zed's_ dead.

Or with some configuration options:

>>> import html2text
>>>
>>> h = html2text.HTML2Text()
>>> # Ignore converting links from HTML
>>> h.ignore_links = True
>>> print h.handle("<p>Hello, <a href='https://www.google.com/earth/'>world</a>!")
Hello, world!

>>> print(h.handle("<p>Hello, <a href='https://www.google.com/earth/'>world</a>!"))

Hello, world!

>>> # Don't Ignore links anymore, I like links
>>> h.ignore_links = False
>>> print(h.handle("<p>Hello, <a href='https://www.google.com/earth/'>world</a>!"))
Hello, [world](https://www.google.com/earth/)!

Originally written by Aaron Swartz. This code is distributed under the GPLv3.

How to install

html2text is available on pypi https://pypi.org/project/html2text/

$ pip install html2text

How to run unit tests

tox

To see the coverage results:

coverage html

then open the ./htmlcov/index.html file in your browser.

Documentation

Documentation lives here

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].