Fake List Detection¶
The default behavior in PyDocX is to convert “faked” lists into “real” lists.
A “faked” list is a sequence of paragraphs in which the numbering has been explicitly typed. Additionally, the spacing across levels is manually set either using tab characters, or indentation. For example:
1. Apple
2. Banana
a. Chiquita
b. Dole
3. Carrot
Conversely, a “real” list is a sequence of paragraphs in which the numbering, and spacing, is automatic:
- Apple
- Banana
- Chiquita
- Dole
- Carrot
What faked lists can PyDocX convert
How to disable fake list detection¶
Extend the exporter
to override
the numbering_span_builder_class
class variable
as follows:
from pydocx.export.numbering_span import BaseNumberingSpanBuilder
class CustomExporter(PyDocXHTMLExporter):
numbering_span_builder_class = BaseNumberingSpanBuilder