EU Parliament Monitor — API Documentation - v0.9.24
    Preparing search index...

    Function buildArticleToc

    • Build the article-level Table of Contents nav. Renders a labelled <nav class="article-toc"> with one <a> per H2 section, keyed by the stable fragment ids produced by the aggregator. The containing <aside> is styled as a sticky, full-height sidebar on wide viewports and collapses into a <details> disclosure on narrow viewports via styles.css. Each entry is prefixed with a contextual emoji icon so readers can scan the navigation visually as well as textually.

      Returns an empty string when entries is empty so low-signal ANALYSIS_ONLY articles (few sections, no value in a TOC) stay compact.

      Parameters

      Returns string

      HTML fragment for the sidebar, or "" when no TOC is needed