[Feature] Numbered TOC: --numbered list|outline
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 62/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Go
- Stelle
- 525
- Fork
- 89
- Merge medio
- 6g 19h
- PR unite (30g)
- 3
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ekalinin/github-markdown-toc.go
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
-
[Feature] Usage as a libraryApertaenhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
[BUG] TOC picks up YAMLApertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 45/100
Tutte le issue di ekalinin/github-markdown-toc.go
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
oasdiff/oasdiff#1337 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
dataiku/kiji-proxy#635 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
hyperledger-firefly/signer#126 ·
-
agent-review-finding chore
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
jordansmall/spindrift#5748 ·
I maintainer di solito rispondono entro 1 giorno