[Feature] Numbered TOC: --numbered list|outline
まだ誰も着手していません。
評価
調査の方向性
Trace the CLI option parsing and TOC-generation entry points, then compare their depth, start-depth, indent, and multi-input behavior with the requested numbered modes. Done means both list and outline numbering work as specified, default output is unchanged, invalid combinations return exit code 1, and skipped entries are not numbered.
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
The TOC is always a bullet list (* [...]), and there is no way to get a numbered TOC.
The same request for the Bash version was ekalinin/github-markdown-toc#26, and it is
implemented there in ekalinin/github-markdown-toc#177.
Describe the solution you'd like
The same option as in the Bash version: --numbered <TYPE> with two types.
-
list: a markdown ordered list, every marker is1.. GitHub numbers the items
itself, and shows nested lists asi., thena.:1. [Title one](#title-one) 1. [Section](#section) 1. [Title two](#title-two) -
outline: bullets with a hierarchical number at the start of the link text:* [1. Title one](#title-one) * [1.1. Section](#section) * [2. Title two](#title-two)The number follows the heading tree: the parent of an entry is the nearest previous
entry with a lower level. So a skipped level does not add a part:#then###
gives1.and1.1., not1.0.1..
Behavior in the Bash version:
- Without
--numberedthe output does not change. - Only the entries kept by
--depthare numbered. - With several inputs, the numbers of each document start from
1.. - An unknown type is an error with exit code 1.
--numbered listwith--indentless than 3 is an error: a child of1.is nested
only when it is indented 3 to 6 spaces more than the parent, otherwise GitHub renders
one flat list.
Describe alternatives you've considered
- Real counters in
list(1.,2.,3.): GitHub uses only the first number of a
list, and a two-digit marker (10.) needs an indent of 4 for its children. - A number before the link (
* 2.1. [Section](#section)): GitHub parses2.1.as an
ordered list marker inside the bullet. - One counter per heading level instead of the tree: it gives the same number twice for
#,###,##(1.1.and1.1.).
Additional context
Differences from the Bash version to decide on:
- The default
--indenthere is 2, so the Bash rule above would make
--numbered listfail without an explicit--indent 3. - Entries here are indented relative to the top level of the document and to
--start-depth. Entries skipped by--start-depthshould not be numbered either.
- 主要言語
- Go
- スター
- 525
- フォーク
- 89
- 平均マージ
- 6日 19時間
- マージ済み PR(30日)
- 3
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ekalinin/github-markdown-toc.go のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
ekalinin/github-markdown-toc.go の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
apache/rocketmq-dashboard#7243 ·
メンテナーはふだん 3 日以内に返信
-
Missing example coverage: getClock対応中かも @camunda-sdk-automation が今日担当しました。 オープンnew-operations
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
camunda/orchestration-cluster-api-go#75 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
[schema-coverage] elasticstack_kibana_security_entity_store_status対応中かも @github-actions が今日担当しました。 オープンacceptance-tests phase-coding schema-coverage testing triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
elastic/terraform-provider-elasticstack#5396 ·
メンテナーはふだん 1 日以内に返信
-
Go device SDK: Whisper transcriber keeps buffering and transcribing audio appended after Stop()対応中かも @apoorvdarshan が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
BasedHardware/omi#22770 ·
メンテナーはふだん 1 日以内に返信
-
Bug v3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信