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 thesearch
plugin. MkDocs enables it by default if there is noplugins
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
:
{{ read_csv() }}
passed to pandas.read_csv().{{ read_table() }}
passed to pandas.read_table()`.{{ read_fwf() }}
passed to pandas.read_fwf().{{ read_excel() }}
passed to pandas.read_excel().
Contributing
Very much open to contributions! Please read CONTRIBUTING.md before putting in any work.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mkdocs-table-reader-plugin-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c28cb1f34de3831eb2f6333e1fdfd743a1ecb959e85e43572d3ec1ca1734c65c |
|
MD5 | ec33c8c6ddce95aef6ffb91cd4e71a4d |
|
BLAKE2b-256 | fed90296b80c066a7841f4d8bf3505ea0f7ce236f80e57ad8be29cef854614cd |
Hashes for mkdocs_table_reader_plugin-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e3fd88563ec6eaf554df55a90d6ff20eb4060b20df4e70df4b8cd62c51fa8d1 |
|
MD5 | 0f2fb01c86dc4b3aa38893c242b165d6 |
|
BLAKE2b-256 | 9ed20efde258e98e557f41b82e87b2d2257c0620a1aa5157a0a626f02ed3b57b |