Skip to content

Clarify usage of parameters when using CSV from file #65

@mfhepp

Description

@mfhepp

It seems pantable understands parameters like caption, alignment, etc. in combination with CSV from a file only if they are in the markup or in the file, not in the element meta-data.

As putting them into the file will make the file unusable for most other tools, this is a bit unfortunate.

Approach 3, i.e. putting the meta-data including the include parameter into the code block is actually fine, but it should be documented more clearly if possible. Thanks!

This works: Approach 1

```{.table include="data/csv_example_with_header.csv"}
```

File: csv_example_with_header.csv

---
caption: '*Awesome* **Markdown** Table from `pantable`'
alignment: RC
table-width: 2/3
markdown: True
---
prefix, city_or_region, comments, Status
'030', 'Berlin', 'My comment', True
'069', 'Frankfurt', , False
'089', 'Munich', 'Another comment', True

This does not work (caption etc. missing): Approach 2

```{.table include="data/csv_example.csv" alignment="RC" caption="A cool CSV Table"}
```

This also works: Approach 3

```table
---
caption: '*Awesome* **Markdown** Table from `pantable`'
alignment: RC
table-width: 2/3
markdown: True
include: "data/csv_example.csv"
---
```

File: csv_example.csv

prefix, city_or_region, comments, Status
'030', 'Berlin', 'My comment', True
'069', 'Frankfurt', , False
'089', 'Munich', 'Another comment', True

Environment:

pandoc                    2.17.0.1             
pandoc-crossref           0.3.12.2           
pantable                  0.14.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions