Generate HTML identifier from section title

Abierto
#996 11 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
html
Área
web-dev

Línea de trabajo

Start by finding the HTML export code that assigns section identifiers and the tests covering exported sections; compare its current numeric IDs with the title-based behavior described here. Done means exported section IDs reflect their titles and can be used as fragment links, with tests verifying the generated HTML.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Help wanted Scripting Type: Feature
Expected behaviour

I can link to a specific section in a exported HTML document using an identifier generated from its title.

eg. <h4 id="my-section">My section</h4> in generated html, in order to be able to use my_note.html#my-section to access "My section"

Actual behaviour

The identifier for sections exist, but are numerically incremented, and do not reflect the title of the section.

example: <h4 id="toc_6">My section</h4>

Possible implementation

This is how it's done in the insert-toc script, in order to work well with GitHub flavored Markdown:

    function extractLink(title) {
        var lowercase = title.toLowerCase()
        var spaceReplaced = lowercase.replace(/ /g, "-")
        var invalidCharsRemoved = spaceReplaced.replace(/[^A-Za-zÀ-ÿ-_]/g, "")
        return invalidCharsRemoved;
    }
Lenguaje dominante
C++
Estrellas
5.9k
Forks
499
Merge medio
4 h 4 min
PR fusionados (30 d)
3

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de pbek/QOwnNotes

Todos los issues de pbek/QOwnNotes

Issues similares

Más issues de C++

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.