[Feature] Bullet character: --bullet *|-|+
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 76/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Go
- Estrellas
- 525
- Forks
- 89
- Merge medio
- 6 min
- PR fusionados (30 d)
- 1
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ekalinin/github-markdown-toc.go
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 62/100
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 58/100
-
[Feature] Usage as a libraryAbiertoenhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
-
[BUG] TOC picks up YAMLAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 45/100
Todos los issues de ekalinin/github-markdown-toc.go
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
router-for-me/CLIProxyAPI#7330 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug os:ios
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
hajimehoshi/ebiten#4039 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 9 días