Skip to content

Commit 1659718

Browse files
authored
doc: generates docs after xterm feature (#156)
1 parent 2a21d52 commit 1659718

20 files changed

+224
-21
lines changed

doc/colorizer.txt

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,7 @@ user_default_options *colorizer.config.user_default_options*
551551
hooks - table: Table of hook functions
552552
{disable_line_highlight} - function: Returns boolean which controls if
553553
line should be parsed for highlights
554+
{xterm} - boolean: Enables xterm 256-color codes (#xNN, \e[38;5;NNNm)
554555

555556

556557

@@ -1010,6 +1011,46 @@ parser({line}, {i}, {opts}) *colorizer.parser.rgb.parser*
10101011

10111012

10121013

1014+
==============================================================================
1015+
XTERM *colorizer.parser.xterm-introduction*
1016+
1017+
This module provides a parser for identifying and converting xterm color codes
1018+
to RGB hexadecimal format.
1019+
1020+
It supports both #xNN format (decimal, 0-255) and ANSI escape sequences
1021+
\e[38;5;NNNm for xterm 256-color palette.
1022+
The function reads the color code and returns the corresponding RGB hex string
1023+
from the xterm color palette.
1024+
1025+
==============================================================================
1026+
LUA API *colorizer.parser.xterm-lua-api*
1027+
1028+
Functions: ~
1029+
|parser| - Parses xterm color codes and converts them to RGB hex format.
1030+
1031+
1032+
parser({line}, {i}) *colorizer.parser.xterm.parser*
1033+
Parses xterm color codes and converts them to RGB hex format.
1034+
1035+
This function matches both #xNN format (decimal, 0-255) and ANSI escape
1036+
sequences \e[38;5;NNNm
1037+
for xterm 256-color palette. It returns the corresponding RGB hex string
1038+
from the xterm color palette.
1039+
1040+
1041+
Parameters: ~
1042+
{line} - string: The line of text to parse for xterm color codes
1043+
{i} - number: The starting index within the line where parsing should
1044+
begin
1045+
1046+
returns:~
1047+
number or nil: The end index of the parsed xterm color code within the
1048+
line, or `nil` if parsing failed
1049+
string or nil: The RGB hexadecimal color from the xterm palette, or
1050+
`nil` if parsing failed
1051+
1052+
1053+
10131054
==============================================================================
10141055
SASS *colorizer.sass-introduction*
10151056

doc/index.html

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ <h2>Modules</h2>
4343
<li><a href="modules/colorizer.parser.names.html">parser.names</a></li>
4444
<li><a href="modules/colorizer.parser.rgb.html">parser.rgb</a></li>
4545
<li><a href="modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
46+
<li><a href="modules/colorizer.parser.xterm.html">parser.xterm</a></li>
4647
<li><a href="modules/colorizer.sass.html">sass</a></li>
4748
<li><a href="modules/colorizer.tailwind.html">tailwind</a></li>
4849
<li><a href="modules/trie.html">trie</a></li>
@@ -102,6 +103,10 @@ <h2>Modules</h2>
102103
<td class="name" nowrap><a href="modules/colorizer.parser.rgba_hex.html">colorizer.parser.rgba_hex</a></td>
103104
<td class="summary">This module provides a parser for identifying and converting `#RRGGBBAA` hexadecimal color values to RGB hexadecimal format.</td>
104105
</tr>
106+
<tr>
107+
<td class="name" nowrap><a href="modules/colorizer.parser.xterm.html">colorizer.parser.xterm</a></td>
108+
<td class="summary">This module provides a parser for identifying and converting xterm color codes to RGB hexadecimal format.</td>
109+
</tr>
105110
<tr>
106111
<td class="name" nowrap><a href="modules/colorizer.sass.html">colorizer.sass</a></td>
107112
<td class="summary">Manages Sass variable parsing and color detection for buffers.</td>
@@ -128,7 +133,7 @@ <h2>Modules</h2>
128133
</div> <!-- id="main" -->
129134
<div id="about">
130135
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
131-
<i style="float:right;">Last updated - January </i>
136+
<i style="float:right;">Last updated - July </i>
132137
</div> <!-- id="about" -->
133138
</div> <!-- id="container" -->
134139
</body>

doc/modules/colorizer.buffer.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ <h2>Modules</h2>
5050
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
5151
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
5252
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
53+
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
5354
<li><a href="../modules/colorizer.sass.html">sass</a></li>
5455
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
5556
<li><a href="../modules/trie.html">trie</a></li>
@@ -233,7 +234,7 @@ <h3>Returns:</h3>
233234
</div> <!-- id="main" -->
234235
<div id="about">
235236
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
236-
<i style="float:right;">Last updated - January </i>
237+
<i style="float:right;">Last updated - July </i>
237238
</div> <!-- id="about" -->
238239
</div> <!-- id="container" -->
239240
</body>

doc/modules/colorizer.color.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ <h2>Modules</h2>
5050
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
5151
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
5252
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
53+
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
5354
<li><a href="../modules/colorizer.sass.html">sass</a></li>
5455
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
5556
<li><a href="../modules/trie.html">trie</a></li>
@@ -202,7 +203,7 @@ <h3>Returns:</h3>
202203
</div> <!-- id="main" -->
203204
<div id="about">
204205
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
205-
<i style="float:right;">Last updated - January </i>
206+
<i style="float:right;">Last updated - July </i>
206207
</div> <!-- id="about" -->
207208
</div> <!-- id="container" -->
208209
</body>

doc/modules/colorizer.config.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ <h2>Modules</h2>
5151
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
5252
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
5353
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
54+
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
5455
<li><a href="../modules/colorizer.sass.html">sass</a></li>
5556
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
5657
<li><a href="../modules/trie.html">trie</a></li>
@@ -335,6 +336,9 @@ <h3>Fields:</h3>
335336
function: Returns boolean which controls if line should be parsed for highlights
336337
</li>
337338
</li></ul>
339+
<li><span class="parameter">xterm</span>
340+
boolean: Enables xterm 256-color codes (#xNN, \e[38;5;NNNm)
341+
</li>
338342
</ul>
339343

340344

@@ -456,7 +460,7 @@ <h3>Fields:</h3>
456460
</div> <!-- id="main" -->
457461
<div id="about">
458462
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
459-
<i style="float:right;">Last updated - January </i>
463+
<i style="float:right;">Last updated - July </i>
460464
</div> <!-- id="about" -->
461465
</div> <!-- id="container" -->
462466
</body>

doc/modules/colorizer.constants.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ <h2>Modules</h2>
5050
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
5151
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
5252
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
53+
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
5354
<li><a href="../modules/colorizer.sass.html">sass</a></li>
5455
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
5556
<li><a href="../modules/trie.html">trie</a></li>
@@ -226,7 +227,7 @@ <h3>Fields:</h3>
226227
</div> <!-- id="main" -->
227228
<div id="about">
228229
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
229-
<i style="float:right;">Last updated - January </i>
230+
<i style="float:right;">Last updated - July </i>
230231
</div> <!-- id="about" -->
231232
</div> <!-- id="container" -->
232233
</body>

doc/modules/colorizer.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ <h2>Modules</h2>
5050
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
5151
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
5252
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
53+
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
5354
<li><a href="../modules/colorizer.sass.html">sass</a></li>
5455
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
5556
<li><a href="../modules/trie.html">trie</a></li>
@@ -449,7 +450,7 @@ <h3>Usage:</h3>
449450
</div> <!-- id="main" -->
450451
<div id="about">
451452
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
452-
<i style="float:right;">Last updated - January </i>
453+
<i style="float:right;">Last updated - July </i>
453454
</div> <!-- id="about" -->
454455
</div> <!-- id="container" -->
455456
</body>

doc/modules/colorizer.matcher.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ <h2>Modules</h2>
5050
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
5151
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
5252
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
53+
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
5354
<li><a href="../modules/colorizer.sass.html">sass</a></li>
5455
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
5556
<li><a href="../modules/trie.html">trie</a></li>
@@ -138,7 +139,7 @@ <h3>Returns:</h3>
138139
</div> <!-- id="main" -->
139140
<div id="about">
140141
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
141-
<i style="float:right;">Last updated - January </i>
142+
<i style="float:right;">Last updated - July </i>
142143
</div> <!-- id="about" -->
143144
</div> <!-- id="container" -->
144145
</body>

doc/modules/colorizer.parser.hsl.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ <h2>Modules</h2>
5050
<li><a href="../modules/colorizer.parser.names.html">parser.names</a></li>
5151
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
5252
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
53+
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
5354
<li><a href="../modules/colorizer.sass.html">sass</a></li>
5455
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
5556
<li><a href="../modules/trie.html">trie</a></li>
@@ -126,7 +127,7 @@ <h3>Returns:</h3>
126127
</div> <!-- id="main" -->
127128
<div id="about">
128129
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
129-
<i style="float:right;">Last updated - January </i>
130+
<i style="float:right;">Last updated - July </i>
130131
</div> <!-- id="about" -->
131132
</div> <!-- id="container" -->
132133
</body>

doc/modules/colorizer.parser.names.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ <h2>Modules</h2>
5050
<li><strong>parser.names</strong></li>
5151
<li><a href="../modules/colorizer.parser.rgb.html">parser.rgb</a></li>
5252
<li><a href="../modules/colorizer.parser.rgba_hex.html">parser.rgba_hex</a></li>
53+
<li><a href="../modules/colorizer.parser.xterm.html">parser.xterm</a></li>
5354
<li><a href="../modules/colorizer.sass.html">sass</a></li>
5455
<li><a href="../modules/colorizer.tailwind.html">tailwind</a></li>
5556
<li><a href="../modules/trie.html">trie</a></li>
@@ -181,7 +182,7 @@ <h3>Returns:</h3>
181182
</div> <!-- id="main" -->
182183
<div id="about">
183184
<i>generated by <a href="http://github.com/lunarmodules/LDoc">LDoc 1.5.0</a></i>
184-
<i style="float:right;">Last updated - January </i>
185+
<i style="float:right;">Last updated - July </i>
185186
</div> <!-- id="about" -->
186187
</div> <!-- id="container" -->
187188
</body>

0 commit comments

Comments
 (0)