rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
https://rust-lang.github.io/mdBook/
Mozilla Public License 2.0
17.26k stars 1.58k forks source link

Add syntax highlighting for gdscript (the scripting language of the Godot engine) #1678

Open astrale-sharp opened 2 years ago

astrale-sharp commented 2 years ago

Hi there!

Is it possible to add support for syntax highlighting for gdscript ? like shown below (supported by github)

func my_func(a,b):
    pass
onready
Input
preload

It would be a great addition to the godot-rust book (and other projects related to godot).

ISSOtm commented 2 years ago

The way we've handled this for Pan Docs and gb-asm-tutorial, since we need to highlight the admittedly niche RGBASM syntax, is to use a custom build of highlight.js (instructions).

I don't think this needs to be handled by mdBook itself? Also, the instructions I linked to are essentially a mix of highlight.js's build instructions and mdBook's theme-overriding instructions, so I don't think any special documentation is required, either.