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 table inside content tab #19

Closed tescrihuela closed 3 years ago

tescrihuela commented 3 years ago

First thanks for the great work. I am a very beginner and i like these kind of plugins which enhances user experience. I would like to know if there was a clue to load a csv file with read_csv inside a content tab ?

I did not manage to work them together in my project. I tried to build a minimal reproducible example in my github to reproduce what happens : image

Thanks !

timvink commented 3 years ago

Kudos on the reproducable example! I will look into it once I find some time.

timvink commented 3 years ago

The root cause is that when the markdown table is inserted, the indentation is lost for any second rows:

image

I managed to update the regex and add the indentation if necessary. Released in 0.6, so pip install --upgrade to try it out.

timvink commented 3 years ago

Some unit tests failing, will fix and deploy shortly..

tescrihuela commented 3 years ago

tried it out and it works like a charm ! 👏 Thanks @timvink 🙏