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

Optionally add table metadata #67

Open mihaigalos opened 1 month ago

mihaigalos commented 1 month ago

I'm using this plugin to read data from csv and then js to modify a table matching specific criteria (i.e.: containing Name, Email and Team) to dynamically generate data and append it to the table (i.e.: the team logo). This then gets nicely rendered in mkdocs.

I however am aware that any table matching these criteria will be modified, not just the one I'm reading from CSV.

Any way to add metadata in the read_csv("data.csv", class="foo") call to generate a <table class=foo/>?

This might be fiddly since markdown is generated in between and that then gets rendered, I guess.

timvink commented 3 weeks ago

You can actually write HTML inside markdown. Try something like:

<div class="foo">

insert table here

</div>

Now in your CSS you can style foo.table.