mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-26 16:18:43 -05:00
fc7ee1ca45
* The code snippets in the docs consist of CMake code mixed with syntax definition punctuation like < > [ ] ... Therefore a pure CMake lexer is inadequate. Here it is replaced by a CMake syntax definition parser. * Fixed syntax definition snippets in FindPkgConfig.cmake to make best use of syntax highlighting. This source file is the hardest to support because it contains comparison operators <= = >=, which need special attention to avoid confusion with the placeholder indicators <...>. * Fixed syntax in execute_process.rst (there were unbalanced brackets). * Disabled syntax highlighting for long string examples in cmake-language.7.rst. * No highlighting of removed syntax in CMP0049 * To inspect the outcome of this patch, see e.g. the pages * manual/cmake-buildsystem.7.html * module/ExternalProject.html * module/FindPkgConfig.html which are particularly rich in complex code snippets.
30 lines
1.2 KiB
Python
30 lines
1.2 KiB
Python
# -*- coding: utf-8 -*-
|
|
|
|
from pygments.style import Style
|
|
from pygments.token import Name, Comment, String, Number, Operator, Whitespace
|
|
|
|
class CMakeTemplateStyle(Style):
|
|
"""
|
|
for more token names, see pygments/styles.default
|
|
"""
|
|
|
|
background_color = "#f8f8f8"
|
|
default_style = ""
|
|
|
|
styles = {
|
|
Whitespace: "#bbbbbb",
|
|
Comment: "italic #408080",
|
|
Operator: "bold #000000",
|
|
String: "#217A21",
|
|
Number: "#105030",
|
|
Name.Builtin: "#400080", # anything lowercase
|
|
Name.Function: "bold #1010A0", # function
|
|
Name.Variable: "#1080B0", # <..>
|
|
Name.Tag: "#19177C", # ${..}
|
|
Name.Constant: "#6020E0", # uppercase only
|
|
Name.Entity: "italic #70A020", # @..@
|
|
Name.Attribute: "#906060", # paths, URLs
|
|
Name.Label: "#A0A000", # anything left over
|
|
Name.Exception: "bold #FF0000", # for debugging only
|
|
}
|