timvink / 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
https://timvink.github.io/mkdocs-table-reader-plugin/
MIT License
111 stars 18 forks source link

Add howto guide on alternatives for this plugin #50

Closed timvink closed 9 months ago

timvink commented 1 year ago

There are other patterns that might fit a use-case better than using this plugin. Let's describe when those might be more suited.

For example, you could write markdown tables into separate .md files somewhere, and load them where you need them using the snippets extension. Easy, fast, low on dependencies and great when seeing changes in version control. But not as flexible, does not supports CSVs and other formats, if you move the table you have to update the path all the time, etc.

timvink commented 10 months ago

Another alternative to document (and give pros and cons) is to use https://pypi.org/project/markdown-exec/ like this:

```python exec="true"
import pandas as pd

file_path = "path/to/file/from/project/root"
print(pd.read_csv(file_path).to_markdown(index=False, disable_numparse=True))