Skip to content

Help: Lay foundations for uniform syntax highlighting throughout the docs

Joachim Wuttke requested to merge jwuttke/cmake:code-colors into master

While some of the code snippets and syntax definitions in the html docs use syntax highlighting, many others don't. I propose to work towards uniform syntax highlighting throughout the docs.

To get started, I propose to overwrite much of the pygments CMake lexer. This is necessary because many code snippets in the CMake docs are not simply CMake code. They are CMake code mixed with syntax-defining punctuation like < > [ ] ...

As soon as this punctuation is supported, most instances of "::" can be replaced by ".. code-block:: cmake ". This is carried out exemplarily for the first (in alphabet) ten modules. If this proposal is accepted, all other doc pages should be adapted in similar way.

Color codes are set indirectly: A pygments style file assigns colors to token names like "Text" or "Name.Builtin". The lexer refers to these names. Right now, neither the chosen token names nor the colors make particular sense. This can be improved anytime; it is completely independent of work on the doc pages.

Topic-rename: help-syntax-highlighting

Edited by Craig Scott

Merge request reports