the-fair-cookbook
the-fair-cookbook copied to clipboard
highlight executable recipes (jupyter notebooks) from the TOC / left menu
suggestion / request from @AlasdairGray during 2022.07.27 book dash.
-[ ] check if possible to include an icon -[ ] check if possible to color code .md vs .ipynb
This is very hard as far as I know. It requires to modify the python function that generates the tree of content HTML from the toc file, which itself requires us to create a custom theme.
For now I'd suggest going for the simple option of having something on the card summary.
An option could be that we put a *
on the end of the title of recipes that have a notebook. That would then appear in the TOC without any scripting.
I've been able to find a way to inject content in the HTML of the navigation content. Using the cards for each recipe, I can create a data structure consumable by the JavaScript module that can then map the names of each link and the title of each card. This is something i've used to create an alternative search page for the recipes (see https://faircookbookdev.netlify.app/content/search-wizard.html, warning: it's work in progress)
Unfortunatly, some cards don't have the same title as the page title in the toc. Thus, these recipes can't be mapped and are ignored. Below is an example where the recipe "Clinical Genetic Information as FHIR JSON" (the last one) should have executable code but doesn't show the icon because the corresponding card title is "File conversion, VCF to FHIR".
Depend on issue #489