MacDownApp / MacDownApp/macdown

TOC-Tag for specified levels

Open
#910 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rich Text Format
Stars
9.8k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

In one of my longer documents I'm using all six levels of headers (h1-h6) and the TOC becomes really huge. It would be nice to be able to specify which header levels to include in the TOC. For example:

[TOC 3]

would only include h1-h3.

And because I normally use h1 and h2 as sort of a title for my documents and don't use them anywhere else, it would be even nicer if I could also specify a start level, so

[TOC 3-4]

would only include the header levels h3 and h4 in the TOC.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by locating the code that parses [TOC] markers and builds the table of contents, then inspect how heading levels are collected. Done means supporting [TOC 3] as h1-h3 and [TOC 3-4] as h3-h4, with tests covering both forms.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown
Domain
desktop
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.