Skip to main content

MkDocs plugin to directly insert tables from files into markdown.

Project description

Actions Status PyPI - Python Version PyPI PyPI - Downloads codecov GitHub contributors PyPI - License

mkdocs-table-reader-plugin

MkDocs plugin that enables a markdown tag like {{ read_csv('table.csv') }} to directly insert various table formats into a page.

For a workflow with other plugins see the blogpost building reproducible reports with MkDocs

Installation

Install the plugin using pip:

pip install mkdocs-table-reader-plugin

Next, add the following lines to your mkdocs.yml:

plugins:
  - search
  - table-reader

If you have no plugins entry in your config file yet, you'll likely also want to add the search plugin. MkDocs enables it by default if there is no plugins entry set.

Usage

In your markdown documents you can now use:

{{ read_csv('path_to_table.csv') }}

Where the path is relative to the location of your project's mkdocs.yml file (although you can change that to be relative to your docs/ directory).

  • There are readers for .csv, .fwf, .json, .xlsx, .yaml and .tsv. There is also the read_raw() reader that will allow you to insert tables (or other content) already in markdown format.

Documentation and how-to guides

See timvink.github.io/mkdocs-table-reader-plugin/

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

mkdocs-table-reader-plugin-2.1.0.tar.gz (10.1 kB view hashes)

Uploaded Source

Built Distribution

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