[Feature] Bullet character: --bullet *|-|+
まだ誰も着手していません。
評価
調査の方向性
Start with flag handling in cmd/gh-md-toc/config.go, then follow the configuration into coretoc.Config and Renderer.Render in internal/core/toc/renderer.go. Check the existing flag and renderer tests, and README.md for documentation conventions. Done means --bullet accepts *, - or + across the stated input modes, rejects invalid combinations, and keeps the default output unchanged.
索引モデルが issue の本文から書いたものです。
説明
Is your feature request related to a problem? Please describe.
Every TOC entry starts with *, and there is no way to use another bullet, for example
a dash. The marker is hardcoded in internal/core/toc/renderer.go
(indent+"* ["+text+"]("+link+")"). The same request for the Bash version is
ekalinin/github-markdown-toc#71, and it is implemented there in
ekalinin/github-markdown-toc#182.
Describe the solution you'd like
The same option as in the Bash version: --bullet <CHAR> with *, - or + (the
three bullet markers of CommonMark), which starts every entry with that character:
- [Title one](#title-one)
- [Section](#section)
- [Title two](#title-two)
Behavior in the Bash version:
- The default stays
*, so without--bulletthe output does not change. - The bullet applies to stdin, local files, remote URLs, several inputs and
--insert. - An unknown character is an error with exit code 1, before any network call.
--bulletwith--numbered listis an error: an ordered list has no bullet.
With--numbered outlinethe bullet replaces*:- [2.1. Section](#section).
Describe alternatives you've considered
- Replace the marker after generation:
gh-md-toc README.md | sed 's/^\( *\)\* \[/\1- [/'. It does not work with
--insert, which writes the TOC into the file directly.
Additional context
--numberedis not implemented here yet (#92). The two--numberedrules above apply
to whichever of the two options lands second.- Places to change, as for the other flags: the flag in
cmd/gh-md-toc/config.go, a new
field incoretoc.Config(default*), and the marker inRenderer.Render. Plus
tests andREADME.md.
- 主要言語
- Go
- スター
- 525
- フォーク
- 89
- 平均マージ
- 6分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ekalinin/github-markdown-toc.go のほかの issue
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 62/100
-
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時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
router-for-me/CLIProxyAPI#7330 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug os:ios
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
hajimehoshi/ebiten#4039 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 9 日以内に返信