Compare commits
44 Commits
feature/to
...
0.11.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8219d2a673 | ||
|
|
e6e23fd512 | ||
|
|
433fad2dec | ||
|
|
4fb451ffa6 | ||
|
|
0c8ac578c9 | ||
|
|
e8d041c251 | ||
|
|
f729c3ba43 | ||
|
|
eddfdae4ca | ||
|
|
8f047753ae | ||
|
|
50b3b73a8f | ||
|
|
0310216877 | ||
|
|
194c646a20 | ||
|
|
9914474828 | ||
|
|
6263f0e5f0 | ||
|
|
2c533339cf | ||
|
|
2b8cf444f1 | ||
|
|
d375116807 | ||
|
|
eb0330bfc6 | ||
|
|
28793ac0b3 | ||
|
|
9231704988 | ||
|
|
1613c302bc | ||
|
|
55c9e84f38 | ||
|
|
99875683ac | ||
|
|
eaeb0603eb | ||
|
|
cb73590623 | ||
|
|
59417ab115 | ||
|
|
917b01e548 | ||
|
|
652714859d | ||
|
|
ea5b22824b | ||
|
|
ec5858e42f | ||
|
|
02bb914ef3 | ||
|
|
21c0d034d0 | ||
|
|
e3ddc789a2 | ||
|
|
2d0cd97323 | ||
|
|
ec185e2e9c | ||
|
|
079d1721aa | ||
|
|
bf24df3e2e | ||
|
|
15329588b1 | ||
|
|
34ad8485fa | ||
|
|
f0ce934bf8 | ||
|
|
99cd237f27 | ||
|
|
2bde8d3e8e | ||
|
|
8c9b029756 | ||
|
|
ae50065872 |
@@ -175,7 +175,7 @@ change:
|
|||||||
|
|
||||||
|
|
||||||
Command Line Interface
|
Command Line Interface
|
||||||
=====================
|
======================
|
||||||
|
|
||||||
Use ``markdownify example.html > example.md`` or pipe input from stdin
|
Use ``markdownify example.html > example.md`` or pipe input from stdin
|
||||||
(``cat example.html | markdownify > example.md``).
|
(``cat example.html | markdownify > example.md``).
|
||||||
|
|||||||
@@ -3,7 +3,8 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from markdownify import markdownify
|
from markdownify import markdownify, ATX, ATX_CLOSED, UNDERLINED, \
|
||||||
|
SPACES, BACKSLASH, ASTERISK, UNDERSCORE
|
||||||
|
|
||||||
|
|
||||||
def main(argv=sys.argv[1:]):
|
def main(argv=sys.argv[1:]):
|
||||||
@@ -28,16 +29,23 @@ def main(argv=sys.argv[1:]):
|
|||||||
parser.add_argument('--default-title', action='store_false',
|
parser.add_argument('--default-title', action='store_false',
|
||||||
help="A boolean to enable setting the title of a link to its "
|
help="A boolean to enable setting the title of a link to its "
|
||||||
"href, if no title is given.")
|
"href, if no title is given.")
|
||||||
parser.add_argument('--heading-style',
|
parser.add_argument('--heading-style', default=UNDERLINED,
|
||||||
choices=('ATX', 'ATX_CLOSED', 'SETEXT', 'UNDERLINED'),
|
choices=(ATX, ATX_CLOSED, UNDERLINED),
|
||||||
help="Defines how headings should be converted.")
|
help="Defines how headings should be converted.")
|
||||||
parser.add_argument('-b', '--bullets', default='*+-',
|
parser.add_argument('-b', '--bullets', default='*+-',
|
||||||
help="A string of bullet styles to use; the bullet will "
|
help="A string of bullet styles to use; the bullet will "
|
||||||
"alternate based on nesting level.")
|
"alternate based on nesting level.")
|
||||||
|
parser.add_argument('--strong-em-symbol', default=ASTERISK,
|
||||||
|
choices=(ASTERISK, UNDERSCORE),
|
||||||
|
help="Use * or _ to convert strong and italics text"),
|
||||||
parser.add_argument('--sub-symbol', default='',
|
parser.add_argument('--sub-symbol', default='',
|
||||||
help="Define the chars that surround '<sub>'.")
|
help="Define the chars that surround '<sub>'.")
|
||||||
parser.add_argument('--sup-symbol', default='',
|
parser.add_argument('--sup-symbol', default='',
|
||||||
help="Define the chars that surround '<sup>'.")
|
help="Define the chars that surround '<sup>'.")
|
||||||
|
parser.add_argument('--newline-style', default=SPACES,
|
||||||
|
choices=(SPACES, BACKSLASH),
|
||||||
|
help="Defines the style of <br> conversions: two spaces "
|
||||||
|
"or backslash at the and of the line thet should break.")
|
||||||
parser.add_argument('--code-language', default='',
|
parser.add_argument('--code-language', default='',
|
||||||
help="Defines the language that should be assumed for all "
|
help="Defines the language that should be assumed for all "
|
||||||
"'<pre>' sections.")
|
"'<pre>' sections.")
|
||||||
|
|||||||
2
setup.py
2
setup.py
@@ -9,7 +9,7 @@ read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()
|
|||||||
pkgmeta = {
|
pkgmeta = {
|
||||||
'__title__': 'markdownify',
|
'__title__': 'markdownify',
|
||||||
'__author__': 'Matthew Tretter',
|
'__author__': 'Matthew Tretter',
|
||||||
'__version__': '0.11.2',
|
'__version__': '0.11.6',
|
||||||
}
|
}
|
||||||
|
|
||||||
read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()
|
read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()
|
||||||
|
|||||||
10
shell.nix
Normal file
10
shell.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
pkgs.mkShell {
|
||||||
|
name = "python-shell";
|
||||||
|
buildInputs = with pkgs; [
|
||||||
|
python38
|
||||||
|
python38Packages.tox
|
||||||
|
python38Packages.setuptools
|
||||||
|
python38Packages.virtualenv
|
||||||
|
];
|
||||||
|
}
|
||||||
9
tox.ini
9
tox.ini
@@ -2,9 +2,14 @@
|
|||||||
envlist = py38
|
envlist = py38
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
|
passenv = PYTHONPATH
|
||||||
deps =
|
deps =
|
||||||
|
pytest
|
||||||
flake8
|
flake8
|
||||||
pytest
|
restructuredtext_lint
|
||||||
|
Pygments
|
||||||
commands =
|
commands =
|
||||||
flake8 --ignore=E501,W503 markdownify tests
|
|
||||||
pytest
|
pytest
|
||||||
|
flake8 --ignore=E501,W503 markdownify tests
|
||||||
|
restructuredtext-lint README.rst
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user