summary refs log tree commit diff
path: root/bin/man1/hi.1
blob: 517fbab9f32c3ea288acd32a608e389bf13e3d3a (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 December 15, 2019
.Dt HI 1
.Os
.
.Sh NAME
.Nm hi
.Nd syntax highlighter
.
.Sh SYNOPSIS
.Nm
.Op Fl t
.Op Fl f Ar format
.Op Fl l Ar lang
.Op Fl n Ar name
.Op Fl o Ar opts
.Op Ar file
.Nm
.Fl c
.
.Sh DESCRIPTION
.Nm
highlights the contents of a
.Ar file
or standard input
and formats it
on standard output.
.
.Pp
The arguments are as follows:
.Bl -tag -width "-f format"
.It Fl c
Compile all regular expressions and exit.
.It Fl f Ar format
Set the output format.
.It Fl l Ar lang
Set the input language.
.It Fl n Ar name
Override the name used
to infer the input language.
.It Fl o Ar opts
Set output format options.
.Ar opts
is a comma-separated list of options.
.It Fl t
Default to
.Cm text
if the input language cannot be inferred.
.El
.
.Ss Output Formats
The default output format is
.Cm ansi .
.
.Bl -tag -width Ds
.It Cm ansi
Output ANSI terminal escape codes.
.
.It Cm irc
Output IRC formatting codes.
.Pp
The options are as follows:
.Bl -tag -width "monospace"
.It Cm monospace
Use the monospace formatting code
introduced by IRCCloud.
.El
.
.It Cm html
Output HTML
.Sy <pre>
with
.Sy <span>
classes.
.
.Pp
The options are as follows:
.Bl -tag -width "title=..."
.It Cm anchor
Output tags
(top-level definition names)
as anchor links.
.
.It Cm css Ns = Ns Ar url
With
.Cm document ,
output a
.Sy <link>
element for the external stylesheet
.Ar url .
If unset,
output default styles in a
.Sy <style>
element.
.
.It Cm document
Output an HTML document.
.
.It Cm inline
Output inline
.Sy style
attributes rather than classes.
.
.It Cm tab Ns = Ns Ar n
With
.Cm document
or
.Cm inline ,
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
.Ar file
name.
.El
.El
.
.Ss Input Languages
If no input language is set with
.Fl l ,
it may be inferred from the name set by
.Fl m
or from the provided
.Ar file
name.
.
.Bl -tag -width Ds
.It Cm c
The C11 language.
.
.It Cm diff
The output of
.Xr diff 1
with the
.Fl u
flag.
.
.It Cm make
The portable subset of
.Xr make 1 .
Variable substitution supports
one level of nesting with the same delimiter.
.
.It Cm mdoc
The
.Xr mdoc 7
language.
.
.It Cm rust
The Rust 2018 language.
Nested raw strings and block comments
are not highlighted correctly.
.
.It Cm sh
The POSIX
.Xr sh 1
language.
Here-documents are correctly highlighted
only with a delimiter of
.Ql EOF .
Arbitrarily nested strings and command substitutions
are not highlighted correctly.
.
.It Cm text
Plain text.
.El
s='logsubject'>Replace htagml regex with strncmpJune McEnroe Since ctags only ever produces regular expressions of the form /^re$/ or /^re/ with no other special characters, instead unescape the pattern and simply use strncmp. Running on a sqlite3.c amalgamation, the regex version takes ~37s while the strncmp version takes ~1s, producing identical output. Big win! 2021-09-11Also defer printing comment for lone close-parensJune McEnroe 2021-09-10Publish "git-comment"June McEnroe 2021-09-10Add git comment --pretty optionJune McEnroe 2021-09-08Defer printing comment if line is blank or closing braceJune McEnroe This fixes badly indented comments. 2021-09-08Up default min-repeat to 30 linesJune McEnroe 2021-09-08Handle dirty lines in git-commentJune McEnroe 2021-09-08Document and install git-commentJune McEnroe 2021-09-08Add repeat and all options to git-commentJune McEnroe 2021-09-08Add group threshold to git-commentJune McEnroe