pandoc-csv2table: Convert CSV to Pandoc Table Markdown

[ library, mit, program, text ] [ Propose Tags ]

A Pandoc filter that replaces image inline or fenced code blocks with pandoc markdown tables.

Image links must have a "csv" extension. Include the csv file in markdown as

![This is the table caption.](table.csv)

You can also use fenced code blocks to reference an external CSV file using the "source" attribute.

```{.table caption="This is the **caption**" source="table.csv"}
```

You can include the CSV contents inside fenced code blocks and omit the source attribute.

```{.table caption="This is the **caption**"}
Fruit, Quantity, Price
apples, 15, 3.24
oranges, 12, 2.22
```

CSV contents will be parsed by the pandoc markdown reader.

You can see a rendered PDF file with tables generated from CSV files at Example.

For more information, see README at project's source repository.


[Skip to Readme]

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.6, 1.0.7, 1.0.8, 1.0.9
Dependencies base (>=4.7 && <4.9), csv (>=0.1.2), pandoc (>=1.13.0.0), pandoc-csv2table (>=1.0.0), pandoc-types (>=1.12.0.0), text (>=0.11 && <1.3) [details]
License MIT
Copyright (c) 2015 Wasif Hasan Baig
Author Wasif Hasan Baig <pr.wasif@gmail.com>
Maintainer Wasif Hasan Baig <pr.wasif@gmail.com>
Revised Revision 1 made by baig at 2015-05-17T02:31:11Z
Category Text
Home page https://github.com/baig/pandoc-csv2table-filter
Bug tracker https://github.com/baig/pandoc-csv2table-filter/issues
Source repo head: git clone git://github.com/baig/pandoc-csv2table-filter.git
Uploaded by baig at 2015-05-16T06:17:03Z
Distributions
Executables pandoc-csv2table
Downloads 6844 total (34 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-05-20 [all 1 reports]

Readme for pandoc-csv2table-1.0.0

[back to package description]

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.