File: css-classes-reference.rst

package info (click to toggle)
highlight.js 10.7.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,332 kB
  • sloc: javascript: 41,059; makefile: 157; python: 29; sh: 20
file content (183 lines) | stat: -rw-r--r-- 12,046 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
CSS classes reference
=====================


Stylable classes
----------------

The general purpose classes are intended to be used for any language, but the
other classes may also be used when they are semantically correct.  For example
if you had a general purpose language that allowed inline URLs:

::

  var GOOGLE = https://www.google.com/


It would be wholly reasonable to use the ``link`` class for this, even though
your language is not considered a "Markup" language.

+------------------------------------------------------------------------------+
| **General purpose**                                                          |
+--------------------------+---------------------------------------------------+
| keyword                  | keyword in a regular Algol-style language         |
+--------------------------+---------------------------------------------------+
| built_in                 | built-in or library object (constant, class,      |
|                          | function)                                         |
+--------------------------+---------------------------------------------------+
| type                     | data type (in a language with syntactically       |
|                          | significant types) (``string``, ``int``,          |
|                          | ``array``, etc.)                                  |
+--------------------------+---------------------------------------------------+
| literal                  | special identifier for a built-in value           |
|                          | (``true``, ``false``, ``null``, etc.)             |
+--------------------------+---------------------------------------------------+
| number                   | number, including units and modifiers, if any.    |
+--------------------------+---------------------------------------------------+
| operator                 | operators: ``+``, ``-``, ``>>``, ``|``, ``==``    |
+--------------------------+---------------------------------------------------+
| punctuation              | aux. punctuation that should be subtly highlighted|
|                          | (parentheses, brackets, etc.)                     |
+--------------------------+---------------------------------------------------+
| regexp                   | literal regular expression                        |
+--------------------------+---------------------------------------------------+
| string                   | literal string, character                         |
+--------------------------+---------------------------------------------------+
| subst                    | parsed section inside a literal string            |
+--------------------------+---------------------------------------------------+
| symbol                   | symbolic constant, interned string, goto label    |
+--------------------------+---------------------------------------------------+
| class                    | class or class-level declaration (interfaces,     |
|                          | traits, modules, etc), typically includes a       |
|                          | ``title`` submode                                 |
+--------------------------+---------------------------------------------------+
| function                 | function or method declaration                    |
+--------------------------+---------------------------------------------------+
| variable                 | variables                                         |
+--------------------------+---------------------------------------------------+
| title                    | name of a class or a function at the place of     |
|                          | declaration                                       |
+--------------------------+---------------------------------------------------+
| params                   | block of function arguments (parameters) at the   |
|                          | place of declaration                              |
+--------------------------+---------------------------------------------------+
| comment                  | comments                                          |
+--------------------------+---------------------------------------------------+
| doctag                   | documentation markup within comments              |
+--------------------------+---------------------------------------------------+
| **Meta**                                                                     |
+--------------------------+---------------------------------------------------+
| meta                     | flags, modifiers, annotations, processing         |
|                          | instructions, preprocessor directives, etc        |
+--------------------------+---------------------------------------------------+
| meta-keyword             | keyword or built-in within meta construct         |
+--------------------------+---------------------------------------------------+
| meta-string              | string within meta construct                      |
+--------------------------+---------------------------------------------------+
| **Tags, attributes, configs**                                                |
+--------------------------+---------------------------------------------------+
| section                  | heading of a section in a config file, heading in |
|                          | text markup                                       |
+--------------------------+---------------------------------------------------+
| tag                      | XML/HTML tag                                      |
+--------------------------+---------------------------------------------------+
| name                     | name of an XML tag, the first word in an          |
|                          | s-expression                                      |
+--------------------------+---------------------------------------------------+
| builtin-name             | s-expression name from the language standard      |
|                          | library                                           |
+--------------------------+---------------------------------------------------+
| attr                     | name of an attribute with no language defined     |
|                          | semantics (keys in JSON, setting names in .ini),  |
|                          | also sub-attribute within another highlighted     |
|                          | object, like XML tag                              |
+--------------------------+---------------------------------------------------+
| attribute                | name of an attribute followed by a structured     |
|                          | value part, like CSS properties                   |
+--------------------------+---------------------------------------------------+
| **Text Markup**                                                              |
+--------------------------+---------------------------------------------------+
| bullet                   | list item bullet                                  |
+--------------------------+---------------------------------------------------+
| code                     | code block                                        |
+--------------------------+---------------------------------------------------+
| emphasis                 | emphasis                                          |
+--------------------------+---------------------------------------------------+
| strong                   | strong emphasis                                   |
+--------------------------+---------------------------------------------------+
| formula                  | mathematical formula                              |
+--------------------------+---------------------------------------------------+
| link                     | hyperlink                                         |
+--------------------------+---------------------------------------------------+
| quote                    | quotation or blockquote                           |
+--------------------------+---------------------------------------------------+
| **CSS**                                                                      |
+--------------------------+---------------------------------------------------+
| selector-tag             | tag selector                                      |
+--------------------------+---------------------------------------------------+
| selector-id              | #id selector                                      |
+--------------------------+---------------------------------------------------+
| selector-class           | .class selector                                   |
+--------------------------+---------------------------------------------------+
| selector-attr            | [attr] selector                                   |
+--------------------------+---------------------------------------------------+
| selector-pseudo          | :pseudo selector                                  |
+--------------------------+---------------------------------------------------+
| **Templates**                                                                |
+--------------------------+---------------------------------------------------+
| template-tag             | tag of a template language                        |
+--------------------------+---------------------------------------------------+
| template-variable        | variable in a template language                   |
+--------------------------+---------------------------------------------------+
| **diff**                                                                     |
+--------------------------+---------------------------------------------------+
| addition                 | added or changed line                             |
+--------------------------+---------------------------------------------------+
| deletion                 | deleted line                                      |
+--------------------------+---------------------------------------------------+

A note on newer classes
^^^^^^^^^^^^^^^^^^^^^^^

Some classes have been added more recently and do not enjoy universal theme
support.  For themes without support, these items will simply not be
highlighted.  This doesn't mean not to use them, only that they will be
highlighted better as support improves over time.

A list of these classes:

- operator
- punctuation


Reserved classes
^^^^^^^^^^^^^^^^

The below classes (ReasonML) are left here for documentation purposes but may
not be used in other grammars because they are very poorly supported by all
themes.

If you'd like to help out with the larger issue here:

- https://github.com/highlightjs/highlight.js/issues/2521
- https://github.com/highlightjs/highlight.js/issues/2500

+--------------------------+---------------------------------------------------+
| **ReasonML**                                                                 |
+--------------------------+---------------------------------------------------+
| pattern-match            | pattern matching matchers                         |
+--------------------------+---------------------------------------------------+
| typing                   | type signatures on function parameters            |
+--------------------------+---------------------------------------------------+
| constructor              | type constructors                                 |
+--------------------------+---------------------------------------------------+
| module-access            | scope access into a module                        |
+--------------------------+---------------------------------------------------+
| module                   | module reference within scope access              |
+--------------------------+---------------------------------------------------+


Language names and aliases
--------------------------

The language names and aliases table has moved to `SUPPORTED_LANGUAGES.md <https://github.com/highlightjs/highlight.js/blob/main/SUPPORTED_LANGUAGES.md>`_.