Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H1 Headings are not included in the automatic Table of Contents on Bloom Docs #104

Open
jamespostsil opened this issue May 23, 2024 · 4 comments

Comments

@jamespostsil
Copy link

jamespostsil commented May 23, 2024

Describe the bug
When a block is marked as Heading 1, it is not included in the TOC on the right-hand side of the page.

URL of a source Notion page that, when docu-notion accesses or converts it, shows the problem:

Small example: https://www.notion.so/hattonjohn/Is-Bloom-right-for-my-project-58be5d048c7f4fd0aa827dda09c4d345?pvs=4
Large example: https://www.notion.so/hattonjohn/Older-Release-Notes-e24605986bcc4957afb33d02b4cb56e3?pvs=4

Expected behavior
H1s should be included in the TOC, or never used in Docu-Notion (not recommended, it would be difficult to remember/implement consistently).

Screenshots
If applicable, add screenshots to help explain your problem.

image

Below:

  • Left-side: The Notion version of the TOC from the Older Release Notes page (I added it temporarily, to compare). Missing H1 items are in orange.
  • Right-side: The automatic TOC on Bloom Docs.

image

@andrew-polk
Copy link
Contributor

See https://docusaurus.io/docs/next/markdown-features/toc#table-of-contents-heading-level for how this can be configured in docusaurus at the page level or for all pages.
(The default is only H2 and H3.)

@jamespostsil
Copy link
Author

I have made made a mistake, but I tried to implement this on my local version and got an error:

[ERROR] ValidationError: "tableOfContents.minHeadingLevel" must be greater than or equal to 2

My mod is at the bottom of the themeConfig: section of docusaurus.config.js:

themeConfig:
    /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
    ({
      metadata: [
        {
          name: "keywords",
          content: "Bloom, SIL, documentation, help, training",
        },
      ],
      sitemap: {
        // https://www.sitemaps.org/protocol.html#xmlTagDefinitions
        changefreq: "weekly",
        priority: 0.5,
        ignorePatterns: [],
      },
      navbar: {
        title: "Bloom Docs",
        logo: {
          alt: "Bloom Site Logo",
          src: "img/logo.svg",
        },

        items: [
          {
            type: "doc",
            label: "PDF Downloads",
            position: "right",
            docId: "downloads",
          },
          // As of Aug 2023, we don't really have enough translation done to warrant having a locale chooser.
          // {
          //   type: "localeDropdown",
          //   position: "right",
          // },
        ],
      },

      prism: {
        theme: lightCodeTheme,
        darkTheme: darkCodeTheme,
      },

      tableOfContents: {
        minHeadingLevel: 1,
        maxHeadingLevel: 3,
      },
    }),

@hatton
Copy link
Member

hatton commented May 23, 2024

Yup, two is the minimum: https://docusaurus.io/docs/api/themes/configuration

@jamespostsil
Copy link
Author

jamespostsil commented May 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants