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 files 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, or your project's docs/ directory, or the location of your markdown source file (all 3 possible locations will be searched, in that order).

  • There are readers available for many common table formats, like .csv, .fwf, .json, .xls, .xlsx, .yaml, .feather and .tsv. There is also the read_raw() reader that will allow you to insert tables (or other content) already in markdown format.
  • table-reader is compatible with mkdocs-macros-plugin. This enables further automation like filtering tables or inserting directories of tables. See the documentation on compatibility with macros plugin for more examples.

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-3.1.0.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

mkdocs_table_reader_plugin-3.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file mkdocs_table_reader_plugin-3.1.0.tar.gz.

File metadata

File hashes

Hashes for mkdocs_table_reader_plugin-3.1.0.tar.gz
Algorithm Hash digest
SHA256 eb15688ee8c0cd1a842f506f18973b87be22bd7baa5e2e551089de6b7f9ec25b
MD5 fd6e8341d6d3cca3fc8b7c9ca99d83d3
BLAKE2b-256 a11bca35e4b51a1814924153f7c8afa5a9c2f961688a9c275fa9f4afe7f5083a

See more details on using hashes here.

File details

Details for the file mkdocs_table_reader_plugin-3.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocs_table_reader_plugin-3.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 50a1302661c14d96b90ba0434ae96110441e0c653ce23559e3c6911fe79e7bd2
MD5 9ee9a7f367e9e29fdb8a65c7d1d5957d
BLAKE2b-256 b36fdcc966874f74f8580b99d2ffecbdc85dfd00c4a5039fedbee4ddd7fc8c7f

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