Use case
I use R and Knitr a lot to produce long html reports. The reports contain headers by using the markdown #
syntax. These headers give good orientation for the reader's navigation...
Problem
... but the reports sometimes get very long. Scrolling from beginning to the end take very long time. Readers of the reports get annoyed seeing all the report content before reaching the relevant parts.
Question
Is there a way to implement in Knitr a collapsing and expanding header element?
Requirements
- By default the header shall be collapsed. Only by clicking the contents below the header shall expand. This would tremendously help to keep the reports small in appearance and facilitate easy and fast navigation.
- In order to give the reader feedback of the state the header it shall represent it's state. I recommend something along the mechanism used in Wikipedia (see image above).