porcupine icon indicating copy to clipboard operation
porcupine copied to clipboard

Documenting syntax-highlighting

Open Akuli opened this issue 3 years ago • 0 comments

The existing documentation in porcupine/plugins/highlight/tree-sitter-token-mappings/README.md and default_filetypes.toml doesn't seem to be enough. It's still easy to get confused about a lot of things:

  • Why does Porcupine support both pygments and tree-sitter?
  • Why is it impossible (or at least, very hard) to make an efficient pygments highlighter that always works correctly?
  • What are tree-sitter, py-tree-sitter, py-tree-sitter-languages and py-tree-sitter-builds?
  • Where does Porcupine get the tree-sitter .so file it uses for syntax highlighting?
  • What languages are included in the .so file?
  • What are tree-sitter token mappings?
  • Why is there not a token mapping for every language included in the .so file?

Recently Moosems has been confused about tree-sitter. I don't blame Moosems: this is confusing and I have documented it poorly :)

Akuli avatar Apr 17 '23 20:04 Akuli