Skip to content

better code highlighting #14

Open
Open
@Qubus0

Description

@Qubus0

code highlighting looks merely passable right now

<- engine |vs| docs ->

Image

This is mostly down to the Pygments lexer for gdscript being outdated, since that is what mkdocs material uses.

Pygments allows to add custom lexers https://pygments.org/docs/lexerdevelopment/, so we could update the current one and load it instead (since we don't really have time for that change to propagate through both pygments and mkdocs material)

we have these css classes available to use https://github.com/squidfunk/mkdocs-material/blob/master/src/templates/assets/stylesheets/main/extensions/pymdownx/_highlight.scss

the glaring issues right now are

  • function definitions (.kd perhaps)
  • function calls (.nf)
  • classes both custom and native (they use different colors, .nc and .nb perhaps)
  • types (fixed already)

less noticeable are

  • control flow keywords (could use .kr)
  • @ globalscope methods like print (.nn, far fetched)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

4.xThis issue relates to Godot 4.xenhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions