Markdown tables convertor to a multiline and grid format.
Project description
Multiline and grid tables for Foliant
This preprocessor converts tables to multiline and grid format before creating document (very useful especially for pandoc processing). It helps to make tables in doc and pdf formats more proportional — column with more text in it will be more wide. Also it helps whith processing of extremely wide tables with pandoc. Convertation to the grid format allows arbitrary cell' content (multiple paragraphs, code blocks, lists, etc.).
Installation
$ pip install foliantcontrib.multilinetables
Config
To enable the preprocessor with default options, add multilinetables
to preprocessors
section in the project config:
preprocessors:
- multilinetables
The preprocessor has a number of options (best values set by default):
preprocessors:
- multilinetables:
rewrite_src_files: false
min_table_width: 100
keep_narrow_tables: true
table_columns_to_scale: 3
enable_hyphenation: false
hyph_combination: '<br>'
convert_to_grid: false
targets:
- docx
- pdf
rewrite_src_file
: You can update source files after each use of preprocessor. Be careful, previous data will be deleted.
min_table_width
: Wide markdown tables will be shrinked to this width in symbols. This parameter affects scaling - change it if table columns are merging.
keep_narrow_tables
: If true
narrow tables will not be stretched to minimum table width.
table_columns_to_scale
: Minimum amount of columns to process the table.
enable_hyphenation
: Switch breaking text in table cells with the tag set in hyph_combination
. Good for lists, paragraphs, etc.
hyph_combination
: Custom tag to break a text in multiline tables.
convert_to_grid
: If true
tables will be converted to the grid format, that allows arbitrary cell' content (multiple paragraphs, code blocks, lists, etc.).
targets
: Allowed targets for the preprocessor. If not specified (by default), the preprocessor applies to all targets.
Usage
Just add preprocessor to the project config and enjoy the result.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file foliantcontrib.multilinetables-1.2.3.tar.gz
.
File metadata
- Download URL: foliantcontrib.multilinetables-1.2.3.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 029d8ab373bf5dad3341f0ef627933039213009e14ffe1799d4c901f7c4dac9e |
|
MD5 | f210222b0acca8b486190a5ffd985d18 |
|
BLAKE2b-256 | ff9b44dc9cb4d885f7ff269280327a1a60fc35ff8ccebdee77085168740c8f36 |
File details
Details for the file foliantcontrib.multilinetables-1.2.3-py3-none-any.whl
.
File metadata
- Download URL: foliantcontrib.multilinetables-1.2.3-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03b6272bd66244c040e6856801abee4016bdd4ed2fa597b85a05a08d61123e70 |
|
MD5 | a40f83c93d39c7a0311b47d0a9ae643f |
|
BLAKE2b-256 | 5aa9c6fcdc2305c6636e915629e20266138fc9d8d3efabac1eb93f2409a1c5b6 |