markdownify 0.14.0__tar.gz → 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {markdownify-0.14.0 → markdownify-1.0.0}/PKG-INFO +18 -5
- {markdownify-0.14.0 → markdownify-1.0.0}/README.rst +17 -4
- markdownify-1.0.0/markdownify/__init__.py +712 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/markdownify/main.py +4 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/markdownify.egg-info/PKG-INFO +18 -5
- {markdownify-0.14.0 → markdownify-1.0.0}/pyproject.toml +1 -1
- markdownify-0.14.0/markdownify/__init__.py +0 -490
- {markdownify-0.14.0 → markdownify-1.0.0}/.github/workflows/python-app.yml +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/.github/workflows/python-publish.yml +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/.gitignore +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/LICENSE +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/MANIFEST.in +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/markdownify.egg-info/SOURCES.txt +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/markdownify.egg-info/dependency_links.txt +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/markdownify.egg-info/entry_points.txt +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/markdownify.egg-info/not-zip-safe +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/markdownify.egg-info/requires.txt +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/markdownify.egg-info/top_level.txt +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/setup.cfg +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/shell.nix +0 -0
- {markdownify-0.14.0 → markdownify-1.0.0}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: markdownify
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: Convert HTML to markdown.
|
|
5
5
|
Author-email: Matthew Tretter <m@tthewwithanm.com>
|
|
6
6
|
Project-URL: Homepage, http://github.com/matthewwithanm/python-markdownify
|
|
@@ -163,10 +163,23 @@ keep_inline_images_in
|
|
|
163
163
|
that should be allowed to contain inline images, for example ``['td']``.
|
|
164
164
|
Defaults to an empty list.
|
|
165
165
|
|
|
166
|
+
table_infer_header
|
|
167
|
+
Controls handling of tables with no header row (as indicated by ``<thead>``
|
|
168
|
+
or ``<th>``). When set to ``True``, the first body row is used as the header row.
|
|
169
|
+
Defaults to ``False``, which leaves the header row empty.
|
|
170
|
+
|
|
166
171
|
wrap, wrap_width
|
|
167
172
|
If ``wrap`` is set to ``True``, all text paragraphs are wrapped at
|
|
168
173
|
``wrap_width`` characters. Defaults to ``False`` and ``80``.
|
|
169
174
|
Use with ``newline_style=BACKSLASH`` to keep line breaks in paragraphs.
|
|
175
|
+
A `wrap_width` value of `None` reflows lines to unlimited line length.
|
|
176
|
+
|
|
177
|
+
strip_document
|
|
178
|
+
Controls whether leading and/or trailing separation newlines are removed from
|
|
179
|
+
the final converted document. Supported values are ``LSTRIP`` (leading),
|
|
180
|
+
``RSTRIP`` (trailing), ``STRIP`` (both), and ``None`` (neither). Newlines
|
|
181
|
+
within the document are unaffected.
|
|
182
|
+
Defaults to ``STRIP``.
|
|
170
183
|
|
|
171
184
|
Options may be specified as kwargs to the ``markdownify`` function, or as a
|
|
172
185
|
nested ``Options`` class in ``MarkdownConverter`` subclasses.
|
|
@@ -191,7 +204,7 @@ If you have a special usecase that calls for a special conversion, you can
|
|
|
191
204
|
always inherit from ``MarkdownConverter`` and override the method you want to
|
|
192
205
|
change.
|
|
193
206
|
The function that handles a HTML tag named ``abc`` is called
|
|
194
|
-
``convert_abc(self, el, text,
|
|
207
|
+
``convert_abc(self, el, text, parent_tags)`` and returns a string
|
|
195
208
|
containing the converted HTML tag.
|
|
196
209
|
The ``MarkdownConverter`` object will handle the conversion based on the
|
|
197
210
|
function names:
|
|
@@ -204,8 +217,8 @@ function names:
|
|
|
204
217
|
"""
|
|
205
218
|
Create a custom MarkdownConverter that adds two newlines after an image
|
|
206
219
|
"""
|
|
207
|
-
def convert_img(self, el, text,
|
|
208
|
-
return super().convert_img(el, text,
|
|
220
|
+
def convert_img(self, el, text, parent_tags):
|
|
221
|
+
return super().convert_img(el, text, parent_tags) + '\n\n'
|
|
209
222
|
|
|
210
223
|
# Create shorthand method for conversion
|
|
211
224
|
def md(html, **options):
|
|
@@ -219,7 +232,7 @@ function names:
|
|
|
219
232
|
"""
|
|
220
233
|
Create a custom MarkdownConverter that ignores paragraphs
|
|
221
234
|
"""
|
|
222
|
-
def convert_p(self, el, text,
|
|
235
|
+
def convert_p(self, el, text, parent_tags):
|
|
223
236
|
return ''
|
|
224
237
|
|
|
225
238
|
# Create shorthand method for conversion
|
|
@@ -139,10 +139,23 @@ keep_inline_images_in
|
|
|
139
139
|
that should be allowed to contain inline images, for example ``['td']``.
|
|
140
140
|
Defaults to an empty list.
|
|
141
141
|
|
|
142
|
+
table_infer_header
|
|
143
|
+
Controls handling of tables with no header row (as indicated by ``<thead>``
|
|
144
|
+
or ``<th>``). When set to ``True``, the first body row is used as the header row.
|
|
145
|
+
Defaults to ``False``, which leaves the header row empty.
|
|
146
|
+
|
|
142
147
|
wrap, wrap_width
|
|
143
148
|
If ``wrap`` is set to ``True``, all text paragraphs are wrapped at
|
|
144
149
|
``wrap_width`` characters. Defaults to ``False`` and ``80``.
|
|
145
150
|
Use with ``newline_style=BACKSLASH`` to keep line breaks in paragraphs.
|
|
151
|
+
A `wrap_width` value of `None` reflows lines to unlimited line length.
|
|
152
|
+
|
|
153
|
+
strip_document
|
|
154
|
+
Controls whether leading and/or trailing separation newlines are removed from
|
|
155
|
+
the final converted document. Supported values are ``LSTRIP`` (leading),
|
|
156
|
+
``RSTRIP`` (trailing), ``STRIP`` (both), and ``None`` (neither). Newlines
|
|
157
|
+
within the document are unaffected.
|
|
158
|
+
Defaults to ``STRIP``.
|
|
146
159
|
|
|
147
160
|
Options may be specified as kwargs to the ``markdownify`` function, or as a
|
|
148
161
|
nested ``Options`` class in ``MarkdownConverter`` subclasses.
|
|
@@ -167,7 +180,7 @@ If you have a special usecase that calls for a special conversion, you can
|
|
|
167
180
|
always inherit from ``MarkdownConverter`` and override the method you want to
|
|
168
181
|
change.
|
|
169
182
|
The function that handles a HTML tag named ``abc`` is called
|
|
170
|
-
``convert_abc(self, el, text,
|
|
183
|
+
``convert_abc(self, el, text, parent_tags)`` and returns a string
|
|
171
184
|
containing the converted HTML tag.
|
|
172
185
|
The ``MarkdownConverter`` object will handle the conversion based on the
|
|
173
186
|
function names:
|
|
@@ -180,8 +193,8 @@ function names:
|
|
|
180
193
|
"""
|
|
181
194
|
Create a custom MarkdownConverter that adds two newlines after an image
|
|
182
195
|
"""
|
|
183
|
-
def convert_img(self, el, text,
|
|
184
|
-
return super().convert_img(el, text,
|
|
196
|
+
def convert_img(self, el, text, parent_tags):
|
|
197
|
+
return super().convert_img(el, text, parent_tags) + '\n\n'
|
|
185
198
|
|
|
186
199
|
# Create shorthand method for conversion
|
|
187
200
|
def md(html, **options):
|
|
@@ -195,7 +208,7 @@ function names:
|
|
|
195
208
|
"""
|
|
196
209
|
Create a custom MarkdownConverter that ignores paragraphs
|
|
197
210
|
"""
|
|
198
|
-
def convert_p(self, el, text,
|
|
211
|
+
def convert_p(self, el, text, parent_tags):
|
|
199
212
|
return ''
|
|
200
213
|
|
|
201
214
|
# Create shorthand method for conversion
|