@hackage pandoc-csv2table1.0.0

Convert CSV to Pandoc Table Markdown

pandoc-csv2table-filter

A Pandoc filter that replaces image links having *.csv extension with Pandoc Table Markdown.

A CSV file rendered to Markdown and PDF

Usage

In your markdown, include the csv file as shown below.

![This text will become the table caption](table.csv)

You can use Pandoc Markdown in the CSV file. It will be parsed by the Pandoc Markdown Reader before insertion into the document.

See example.md and the rendered pdf version in the Examples folder for more details on usage.

Configuration String

A configuration string lets you specify

  • Type of the table
  • Column alignments
  • Whether to treat the first line of the CSV file as header or not

It is included right before the closing square bracket without any space in between, as shown in the example below.

![Another table. mylrcd](table.csv)

mylrcd is the configuration string. This will be rendered as a multiline table with a header with first column left-aligned, second right-aligned, third center-aligned, and the fourth one having default alignment. The config string will be removed from the caption after being processed.

The config string can contain following letters:

  • s for simple table
  • m for multiline table
  • g for grid table
  • p for pipe table
  • y (from yes) when you want the first row of CSV file to be the header.
  • n (from no) when you want to omit the header.
  • l for left alignment of the column
  • r for right alignment of the column
  • c for ccenter alignment of the column
  • d for default alignment of the column

You can specify l r c d for each column in a series. The extra letters will be ignored if they exceed the number of columns in the CSV file.

License

Copyright © 2015 Wasif Hasan Baig

Source code is released under the Terms and Conditions of MIT License.

Please refer to the License file in the project's root directory.

  • Installation

  • Dependencies (0)

  • Dependents (0)