42 lines
790 B
ReStructuredText
42 lines
790 B
ReStructuredText
Installation
|
|
============
|
|
|
|
``pip install markdownify``
|
|
|
|
|
|
Usage
|
|
=====
|
|
|
|
Convert some HTML to Markdown:
|
|
|
|
.. code:: python
|
|
|
|
from markdownify import markdownify as md
|
|
md('<b>Yay</b> <a href="http://github.com">GitHub</a>') # > '**Yay** [GitHub](http://github.com)'
|
|
|
|
Specify tags to exclude (blacklist):
|
|
|
|
.. code:: python
|
|
|
|
from markdownify import markdownify as md
|
|
md('<b>Yay</b> <a href="http://github.com">GitHub</a>', strip=['a']) # > '**Yay** GitHub'
|
|
|
|
\...or specify the tags you want to include (whitelist):
|
|
|
|
.. code:: python
|
|
|
|
from markdownify import markdownify as md
|
|
md('<b>Yay</b> <a href="http://github.com">GitHub</a>', convert=['b']) # > '**Yay** GitHub'
|
|
|
|
|
|
Development
|
|
===========
|
|
|
|
To run tests:
|
|
|
|
``python setup.py test``
|
|
|
|
To lint:
|
|
|
|
``python setup.py lint``
|