beyond-all-reason / beyond-all-reason/RecoilEngine

Improve syntax highlight for short function signature block on api docs

Open
#2,475 0 comments 0 reactions 0 assignees View on GitHub
area: documentation enhancement
Dominant language
C++
Stars
683
Forks
293
Avg merge
3d 2h
Merged PRs (30d)
40

Description

From @sprunk:
> Syntax coloring is somewhat poor:
>
> * the `nil` return is colored but the `boolean` or `string` returns are not (I guess it's because it's implicit? Shouldn't matter though)
> * most words are still white, harder to tell the function name and the args apart
> * the `?` is a bit hard to see. This is on light mode, it gets a bit better with dark mode
>
>
> image

Note currently we use the `lua` syntax highlighting for the "short signature" codeblock, we're free to devise the format of the block and the syntax highlighting language as we want to improve this. See [templating](https://github.com/beyond-all-reason/RecoilEngine/blob/9edb166/doc/site/docgen/templates.rb#L51-L54)

Ideas:

- Consider trying a different language codeblock, e.g. `typescript`?

Contributor guide

Open the contributing guide

Research direction

Start in doc/site/docgen/templates.rb at the short-signature template and inspect how its Lua code block is generated. Compare the current highlighting with the suggested TypeScript alternative, then verify that return types, function names, arguments, and the question mark are distinguishable in light mode. Done means the API short-signature block has clearer syntax coloring.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua, ruby, typescript
Domain
documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.