Feature Request: Scripting hooks for adding language support and stylsheets to code highlighting.

Aperta
#1,527 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
22/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
cpp

Direzione di ricerca

This is an open-ended request for new scripting hooks, not a localized fix. Start from the existing custom-stylesheet hook in the scripting docs and the highlighting path around src/entities/note.cpp (the linked line). Decide how language definitions (JSON/regex) and per-language stylesheets would plug into that pipeline. Done means documented, testable hooks that let a script add a language and its colors without core changes; expect design and maintainer buy-in first.

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

Descrizione

Importance: Low Type: Improvement

I understand that code highlighting is early in it's making right now, but here's a preliminary feature request.

In a similar vein to the hook for adding a custom stylesheet it would be a good idea to have a hooks for adding both:

  1. Support for languages;
    Perhaps a JSON file or similar, with explicitly typed keywords, types, 'other's, the start and end of a comment, etc.
    Bonus points if it support regex so that people can basically copy the regex from highligh.js for the slightly more convoluted languages.

  2. Custom language highlighting stylsheets; Extra bonus points for being able to define which code the specific sheet applies to, so that you can have, for example, Java keywords highlighted in one set of colors, but C++ in another.

Would make your job a lot easier if people just added the languages they need themselves as there are billions of them (and I wanna add taggerscript which is always going to be way too low on the priority list). Perhaps you can then assimilate the scripts into the base program or so with an eventual update, if necessary.

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.