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

✨ feat: overhaul Table of Contents #108

Merged
merged 1 commit into from
Aug 14, 2023
Merged

✨ feat: overhaul Table of Contents #108

merged 1 commit into from
Aug 14, 2023

Conversation

welpo
Copy link
Owner

@welpo welpo commented Aug 14, 2023

Enhance Table of Contents Functionality

TL;DR
  • Added the toc_ignore_pattern option to skip specific headers using regex.
  • Enabled custom ToC placement via a shortcode or <!-- toc --> marker.
  • Extended max ToC depth to 4.
  • Updated associated documentation and refactored ToC generation.

Description

This pull request brings several enhancements to the Table of Contents (ToC), increasing its flexibility and usability.

Changes

  • toc_ignore_pattern: Introduced a new front matter variable that allows users to specify headers they wish to ignore in the ToC based on regex patterns. This can help reduce clutter in articles with many repetitive headers (e.g., multiple figures or tables).

  • Custom ToC Placement: Users now have the flexibility to place the ToC wherever they want in their content using a shortcode or the <!-- toc --> marker, offering greater control over content layout.

  • Increased Depth: The maximum depth for the ToC has been increased from 3 to 4, allowing for a more detailed navigation structure when needed. The default remains 3.

  • Documentation Updates: These features have been documented on the theme's demo to ensure ease of use and clarity.

  • Refactoring: Moved ToC generation logic to a separate macro file for better code organisation and maintainability.

- Introduce `toc_ignore_pattern` to ignore specific headers based on regex.
- Allow custom ToC placement with shortcode or "<!-- toc -->" marker.
- Increase max depth for ToC to 4.
- Update Documentation for the above features.
 - Move ToC generation to a macro file.
@welpo welpo merged commit 0884370 into main Aug 14, 2023
@welpo welpo deleted the feat/overhaul-toc branch August 14, 2023 15:46
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

Successfully merging this pull request may close these issues.

1 participant