30 lines
687 B
ReStructuredText
30 lines
687 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'
|