Under the Table of Contents (TOC) tab in the Settings page, you can enable a table of contents in your knowledge base docs and fine tune the behavior.
BasePress can automatically generate a table of content for the articles in your KB; according to the headings (h1, h2, h3, etc.) used in the content. You can display the Table of Content at the top of the article and/or in the sidebar with the dedicated widget.
- Show Table of Content on articles:It allows you to enable or disable the automatic table of content in the article’s body. If you want to add the table of content on the sidebar you can use the dedicated widget. The widget works even if you don’t enable this option.
- Table of content title: This is the title that comes on top of the Table of Content. This doesn’t apply to the widget title as that can be set from the widget directly.
- Show numbers on list items: This lets you choose if you want the Table of Content list to be numbered or not. This option applies to the widget as well.
- Show Back to top link: Adds a link to go back to the top of the page. The link appears after each portion of your content, before a new heading.
- Back to top link text: This is the text used for the link.
- Show links to copy headings anchor URL to clipboard: When enabled a link would be added next to the post content headings to allow users to copy a direct link to the heading to the clipboard.
- Tooltip text for “Copy Link”: This can be used to customize the tooltip text that appears when hovering the headings link.
- Tooltip text for “Link Copied”: This can be used to customize the tooltip text that appears after clicking on the link and the link is copied to the clipboard.
It is important to remember: Every article has a title heading which renders with a h1 element. Therefore the content in your documentation should not contain another h1 heading for SEO purposes.