[Feature] Warn about headings that skip a level
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
調査の方向性
Read the TOC generation and filtering paths for --depth and --start-depth, along with the implementation of --numbered outline referenced in the issue. Decide whether to warn for every skipped level or only cases affected by indentation, and what link the warning should use. Done means warnings go to stderr for the retained entries, with each input checked independently and the TOC output and exit code unchanged.
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
When a heading skips a level (# Title followed by ### Skipped), GitHub can render its
TOC entry as text of the parent entry, on one line. The TOC is built without any notice.
The same request for the Bash version is ekalinin/github-markdown-toc#75, and it is
implemented there in ekalinin/github-markdown-toc#187.
Here it depends on the indent. TOCs rendered by the GitHub Markdown API:
| Headings | Indent | Rendered |
|---|---|---|
# Title two, then ### Skipped |
2 (default) | a nested list, as expected |
# Title two, then ### Skipped |
3 | one item: Title two * Skipped |
# Title, then #### Deep |
2 (default) | one item: Title * Deep |
Describe the solution you'd like
The same warning as in the Bash version. For every TOC entry whose heading level is
greater than the level of its parent plus 1, print to stderr:
Warning: heading 'Skipped' (level 3) skips a level after 'Title two' (level 1), see https://github.com/ekalinin/github-markdown-toc/issues/75
Behavior in the Bash version:
- The TOC does not change: on stdout and in the file with
--insert. The warning never
goes to stdout or into the file, and the exit code stays the same. - The parent of an entry is the nearest previous TOC entry with a lower level, as for
--numbered outline(#92). - One line per such entry, in document order. An entry without a parent gets no warning.
- It applies to every input. With several inputs each document is checked on its own,
and each line starts with the input as given on the command line, followed by:. - With
--depth, only the entries kept by--depthare checked, and the parent is taken
among them.
Additional context
- Here entries are also dropped by
--start-depth. The check should use only the entries
that stay in the TOC, as with--depth. - To decide: warn on every skipped level, as the Bash version does, or only when the
indent makes GitHub render the entry as text (see the table above). - To decide: the link in the message points to the issue of the Bash version.
- 主要言語
- Go
- スター
- 525
- フォーク
- 89
- 平均マージ
- 6分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ekalinin/github-markdown-toc.go のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
-
enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
ekalinin/github-markdown-toc.go の issue をすべて見る
似ている issue
-
/shutdown/ready can fail to return an HTTP response when readiness takes longer than the server write timeout対応中かも @floriankoch が今日担当しました。 オープンtriage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
envoyproxy/gateway#10562 ·
メンテナーはふだん 1 日以内に返信
-
Adding an LDAP group reports every search failure as "LDAP Group DN is not found"対応中かも @Daksha1611 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
[Bug] K8s reconcile still resets explicit 0 to defaults for response_api, memory and flow state対応中かも @Bevisy が今日担当しました。 オープンneeds-acceptance
難易度 2/5 1〜3時間 初心者へのやさしさ 87/100
vllm-project/semantic-router#5998 ·
メンテナーはふだん 2 日以内に返信