Skip to main content

MkDocs plugin to directly insert tables from files into markdown.

Project description

mkdocs-git-authors-plugin

MkDocs plugin that adds a read_csv(path) markdown tag to directly insert CSV files in a page.

This will aid building with reproducible sites. For more complex use cases, consider pheasant or nbconvert.

Setup

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 your project's root.

Under the hood this is basically:

import pandas as pd
df = pd.read_csv(path)
df.to_markdown(showindex=False)

Which means you can pass all parameters of pandas.read_csv().

Available readers

Table reader functions implemented from pandas:

Contributing

Very much open to contributions! Please read CONTRIBUTING.md before putting in any work.

Project details


Release history Release notifications

This version

0.1.0

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mkdocs-table-reader-plugin, version 0.1.0
Filename, size File type Python version Upload date Hashes
Filename, size mkdocs_table_reader_plugin-0.1.0-py3-none-any.whl (4.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size mkdocs-table-reader-plugin-0.1.0.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page