When HTML pages are extended I find it quite useful to have a TOC (table of Content) available all along with your scrolling.

A good example of an implementation of such a functionality is the Worg webpages (here is an example), which are generated from org files.

So my question is, how is this done? Is it done through a CSS file? If it is, what would the CSS code be?


It's done with a Javascript library called org-info.js, written by Sebastian Rose. See the Javascript support section of the Org mode manual. There is also some additional documentation in Worg.

  • 1
    Hi NickD, are you sure org-info.js handles dynamic TOC? My goal is not to have an Info-like, nor a folding view
    – crocefisso
    Jan 6 '21 at 2:35
  • 1
    Ok, it actually was done through a CSS: orgmode.org/worg/style/worg.css
    – crocefisso
    Jan 6 '21 at 3:02
  • 1
    Oh, I probably conflated the two. Sorry about that.
    – NickD
    Jan 6 '21 at 13:30

Following line has to be put on top of your org file:

#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="https://orgmode.org/worg/style/worg.css"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.