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
```shell
$ pip install foliantcontrib.multilinetables
```
## Config
To enable the preprocessor with default options, add `multilinetables` to `preprocessors` section in the project config:
```yaml
preprocessors:
- multilinetables
```
The preprocessor has a number of options (best values set by default):
```yaml
preprocessors:
- multilinetables:
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
```
`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.
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
```shell
$ pip install foliantcontrib.multilinetables
```
## Config
To enable the preprocessor with default options, add `multilinetables` to `preprocessors` section in the project config:
```yaml
preprocessors:
- multilinetables
```
The preprocessor has a number of options (best values set by default):
```yaml
preprocessors:
- multilinetables:
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
```
`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
Close
Hashes for foliantcontrib.multilinetables-1.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1862ff5e151c1e1894356a674526d2130f38f3aad409c04508b15ee52ec11a9 |
|
MD5 | 0553a9c9f0287e27f3de9b785e2a80ba |
|
BLAKE2b-256 | c00fc574c8fccf5b23c2caf56faec5ffbaed0b18cd2c78acda4938a96fb35060 |