Generate HTML identifier from section title

Aperta
#996 11 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
html
Ambito
web-dev

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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;
    }
Lingua principale
C++
Stelle
5.9k
Fork
499
Merge medio
4h 4m
PR unite (30g)
3

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di pbek/QOwnNotes

Tutte le issue di pbek/QOwnNotes

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.