Skip to content

Custom syntax highlighting & clickable keywords #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

FileEX
Copy link
Collaborator

@FileEX FileEX commented May 24, 2025

This PR adds custom syntax highlighting for Lua examples on the pages. The highlighting supports client, server, shared functions, and any other code elements. More details: https://discord.com/channels/801330706252038164/1292848627659571273/1375686575127793725

image

image

Maybe someone will be willing to polish those styles because I just used the default one from Visual Studio. The light theme definitely needs improvement, but developing it is beyond me. My eyes can’t handle it, and on top of that, for some reason, some colors in the light theme appear darker than the actual hex codes used.

It works simply — after adding a new function or editing its side (client, shared, server), just run this CMD file, and everything will be generated automatically in the right places
image

This PR also adds the ability to click on function names and special keywords (e.g., string, float, player, vehicle, element) just like on the old wiki.

@Fernando-A-Rocha
Copy link
Collaborator

The concept is very good. To save effort, maybe you can make the generate script run with npm run dev and build, so it runs those 2 ways (for local dev and also build deployment), this way you can make them build fail if that script errors.

@FileEX
Copy link
Collaborator Author

FileEX commented May 24, 2025

The concept is very good. To save effort, maybe you can make the generate script run with npm run dev and build, so it runs those 2 ways (for local dev and also build deployment), this way you can make them build fail if that script errors.

Done

@FileEX FileEX changed the title Custom syntax highlighting Custom syntax highlighting & clickable keywords May 24, 2025
Copy link
Collaborator

@Nico8340 Nico8340 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Nico8340 Nico8340 requested a review from Fernando-A-Rocha May 24, 2025 22:33
@Nico8340 Nico8340 added enhancement New feature or request javascript Pull requests that update javascript code labels May 24, 2025
@Fernando-A-Rocha Fernando-A-Rocha merged commit 3264f8c into multitheftauto:main May 25, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request javascript Pull requests that update javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants