JuliaAI / DataScienceTutorials.jl

A set of tutorials to show how to use Julia for data science (DataFrames, MLJ, ...)
https://juliaai.github.io/DataScienceTutorials.jl/
MIT License
115 stars 18 forks source link

Allow sections in tutorials and sidebar to collapse #190

Closed EssamWisam closed 7 months ago

EssamWisam commented 7 months ago

This PR makes use of Franklin's @@ feature and JavaScript to allow markdown files to have collapsable sections. Given any sequence of markdown elements of length two that take the form:

<markdown heading or list item>

<markdown>

Introducing the feature is possible by wrapping the sections with @@ accordingly:

@@dropdown
<markdown heading or list item>
@@
@@dropdown-content
<markdown>
@@

The resulting UI will make it possible to use the heading/list item to show or collapse the markdown in dropdown-content. This is used in the sidebar and all tutorials.

collapse

Thanks for this nice package. Absolutely deserves much wider recognition.

review-notebook-app[bot] commented 7 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

EssamWisam commented 7 months ago

you also need to know the Franklin @@ magic, at least for consistency with existing tutes.

Not really. The script is there for a reason: it loops over all tutorials in the _literate folder and its idempotent. So all that one has to do after running the tutorial is to run the script (which is actually a notebook for better readibility) and the collpase feature will automatically be introduced.

Not only do you need familiarity with markdown and Literate.jl's formatting of markdown

I like that this a concern even if negligble/conditional. This is why I like notebooks more; they are converted to markdown in a single command and are absolutely readable.

ablaom commented 7 months ago

Not really. The script is there for a reason: it loops over all tutorials in the _literate folder and its idempotent. So all that one has to do after running the tutorial is to run the script (which is actually a notebook for better readibility) and the collpase feature will automatically be introduced.

Got it. Can you add instructions in the README.md that explicate this extra step for a maintainer.