Skip to main content

csv to markdown table convertor.

Project description

CSVTables for Foliant

This preprocessor converts csv data to markdown tables.

Installation

$ pip install foliantcontrib.csvtables

Config

To enable the preprocessor with default options, add csvtables to preprocessors section in the project config:

preprocessors:
  - csvtables

The preprocessor has a number of options (default values stated below):

preprocessors:
    - csvtables:
        delimiter: ';'
        padding_symbol: ' '
        paddings_number: 1

delimiter : Delimiter of csv data.

padding_symbol : Symbol combination that will be places around datum (reversed on the right side).

paddings_number : Symbol combination multiplier.

Usage

You can place csv data in csvtable tag.

<csvtable>
    Header 1;Header 2;Header 3;Header 4;Header 5
    Datum 1;Datum 2;Datum 3;Datum 4;Datum 5
    Datum 6;Datum 7;Datum 8;Datum 9;Datum 10
</csvtable>

Or in external file.csv.

<csvtable src="table.csv"></csvtable>

You can reassign setting for certain csv tables.

<csvtable delimiter=":" padding_symbol=" *">
    Header 1:Header 2:Header 3:Header 4:Header 5
    Datum 1:Datum 2:Datum 3:Datum 4:Datum 5
    Datum 6:Datum 7:Datum 8:Datum 9:Datum 10
</csvtable>

Example

Usage section will be converted to this:

You can place csv data in csvtable tag.

| Header 1 | Header 2 | Header 3 | Header 4 | Header 5 |
|----------|----------|----------|----------|----------|
| Datum 1  | Datum 2  | Datum 3  | Datum 4  | Datum 5  |
| Datum 6  | Datum 7  | Datum 8  | Datum 9  | Datum 10 |

Or in external file.csv.

| Header 1 | Header 2 | Header 3 | Header 4 | Header 5 |
|----------|----------|----------|----------|----------|
| Datum 1  | Datum 2  | Datum 3  | Datum 4  | Datum 5  |
| Datum 6  | Datum 7  | Datum 8  | Datum 9  | Datum 10 |

You can reassign setting for certain csv tables.

| *Header 1* | *Header 2* | *Header 3* | *Header 4* | *Header 5* |
|------------|------------|------------|------------|------------|
| *Datum 1*  | *Datum 2*  | *Datum 3*  | *Datum 4*  | *Datum 5*  |
| *Datum 6*  | *Datum 7*  | *Datum 8*  | *Datum 9*  | *Datum 10* |

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

foliantcontrib.csvtables-1.0.2.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

foliantcontrib.csvtables-1.0.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file foliantcontrib.csvtables-1.0.2.tar.gz.

File metadata

  • Download URL: foliantcontrib.csvtables-1.0.2.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for foliantcontrib.csvtables-1.0.2.tar.gz
Algorithm Hash digest
SHA256 65589c58e63a53aa6d58e612c3b101d6bd0ed20ac12c57501b2d8254df5bde35
MD5 f79a17f959d56cd922dff603266b8213
BLAKE2b-256 15fdd1369581304e2d52293f05972c411a87b4417db92c6bf974bd6587e6c0d9

See more details on using hashes here.

File details

Details for the file foliantcontrib.csvtables-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: foliantcontrib.csvtables-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for foliantcontrib.csvtables-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 04157d8a19949efece0f1f40376198ccc113d568e66f9dec130463c919f615cb
MD5 be40cbf740016b9a7f1d8b4407f9bac5
BLAKE2b-256 e0f5b2486f47f7a518a7d391c8f7aa01b763b73d07c410a4c7649a5c7bd66491

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page