the-fair-cookbook icon indicating copy to clipboard operation
the-fair-cookbook copied to clipboard

highlight executable recipes (jupyter notebooks) from the TOC / left menu

Open proccaserra opened this issue 1 year ago • 5 comments

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

proccaserra avatar Jul 28 '22 17:07 proccaserra

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.

terazus avatar Jul 29 '22 14:07 terazus

For now I'd suggest going for the simple option of having something on the card summary.

AlasdairGray avatar Jul 29 '22 14:07 AlasdairGray

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.

AlasdairGray avatar Jul 29 '22 14:07 AlasdairGray

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".

image

terazus avatar Jul 30 '22 13:07 terazus

Depend on issue #489

terazus avatar Aug 10 '22 09:08 terazus