Replies: 1 comment
-
Someone should write a pluglet with this idea? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Originally started as an issue on the relevant plugin's website (#timvink/mkdocs-table-reader-plugin/57). Please consult this issue for the follow-up.
To get an idea of how this idea could work in practice, I tried the experiment of writing a module that would import the applicable code of
mkdocs-table-reader-plugin
. It was very straightforward.Here is the minimal code for a module (
main.py
in the root directory of the MkDocs project):It does the following: it lists all the readers, which are conveniently listed in
READERS
(['read_csv', 'read_table', 'read_fwf', 'read_excel', 'read_yaml', 'read_json', 'read_feather', 'read_raw']
) and declares them as macros. And voilà they were imported as macros available in every markdown page! Now its even possible to add programming logic (for repetitive actions), etc..I attached the whole Mkdocs test project (mkdocs-tables-module.zip), so that you could reproduce my experiment, if you wish. It only requires a
pip-install mkdocs-macros-plugin
.I just wished to know what you think about it, and if there could be potentially workable ideas there?
Beta Was this translation helpful? Give feedback.
All reactions