summary refs log tree commit diff
path: root/bin/man1/hilex.1
blob: aec578602ec9851319088328f3817ab96ce73f2d (plain) (blame)
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
.Dd January 12, 2021
.Dt HILEX 1
.Os
.
.Sh NAME
.Nm hilex
.Nd syntax highlighter
.
.Sh SYNOPSIS
.Nm
.Op Fl t
.Op Fl f Ar format
.Op Fl l Ar lexer
.Op Fl n Ar name
.Op Fl o Ar opts
.Op Ar file
.
.Sh DESCRIPTION
The
.Nm
utility
syntax highlights
the contents of
.Ar file
or standard input
and formats it on standard output.
.
.Pp
The arguments are as follows:
.Bl -tag -width "-f format"
.It Fl f Ar format
Set the output format.
See
.Sx Output Formats .
The default format is
.Cm ansi .
.
.It Fl l Ar lexer
Set the input lexer.
See
.Sx Input Lexers .
The default input lexer is inferred from
.Ar name .
.
.It Fl n Ar name
Set the name used to infer the input lexer.
The default is the final component of
.Ar file .
.
.It Fl o Ar opts
Set output format options.
.Ar opts
is a comma-separated list of options.
Options for each output format are documented in
.Sx Output Formats .
.
.It Fl t
Default to the
.Cm text
input lexer if one cannot be inferred.
.El
.
.Ss Output Formats
.Bl -tag -width Ds
.It Cm ansi
Output ANSI terminal control sequences.
.
.It Cm html
Output HTML
.Sy span
elements.
Each element has the classes
.Sy hilex
and one of the following:
.Sy Operator ,
.Sy Number ,
.Sy Keyword ,
.Sy Identifier ,
.Sy Macro ,
.Sy Comment ,
.Sy String ,
.Sy StringEscape ,
.Sy StringFormat ,
.Sy Interpolation .
.
.Pp
The options are as follows:
.Bl -tag -width "title=..."
.It Cm document
Output an HTML document containing a
.Sy pre
element.
.It Cm inline
Output inline style attributes
rather than classes.
.It Cm pre
Wrap the output in a
.Sy pre
element with the class
.Sy hilex .
.It Cm style Ns = Ns Ar url
With
.Cm document ,
use the external stylesheet
.Ar url .
If unset,
default styles are included in a
.Sy style
element.
.It Cm tab Ns = Ns Ar n
With
.Cm document ,
.Cm inline
or
.Cm pre ,
set the
.Sy tab-size
property to
.Ar n .
.It Cm title Ns = Ns Ar ...
With
.Cm document ,
set the
.Sy title
element text.
The default title is the same as
.Ar name .
.El
.
.It Cm irc
Output IRC formatting codes.
The options are as follows:
.Bl -tag -width "monospace"
.It Cm monospace
Use the IRCCloud monospace formatting code.
.El
.El
.
.Ss Input Lexers
.Bl -tag -width Ds
.It Cm c
The C11 language,
with minimal support for
.Xr lex 1 ,
.Xr yacc 1
and Objective-C input.
Inferred for
.Pa *.[chlmy]
files.
.
.It Cm make
The portable subset of
.Xr make 1 .
Inferred for
.Pa *.mk
and
.Pa Makefile
files.
.
.It Cm mdoc
The
.Xr mdoc 7
language.
Inferred for
.Pa *.[1-9]
files.
.
.It Cm text
Plain text.
Inferred for
.Pa *.txt
files.
.El