summary refs log tree commit diff
path: root/bin/man1/hi.1
blob: 77bb1c46e908272d5b2d7b5745a4ba6eb87a3499 (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
.Dd February 7, 2019
.Dt HI 1
.Os
.
.Sh NAME
.Nm hi
.Nd syntax highlighter
.
.Sh SYNOPSIS
.Nm
.Op Fl f Ar format
.Op Fl l Ar lang
.Op Fl n Ar name
.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.
A maximum of 32K
is read from standard input.
.
.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.
.El
.
.Ss Output Formats
The default output format is
.Cm ansi .
.Bl -tag -width "html-document"
.It Cm ansi
ANSI terminal escape codes.
.It Cm irc
IRC formatting codes.
.It Cm html
HTML fragment.
.It Cm html-document
HTML document.
.El
.
.Ss Input Languages
If no input language is set with
.Fl l ,
it may be inferred from the name set by
.Fl n
or from the provided
.Ar file
name.
.Bl -tag -width "make"
.It Cm c
The C11 language.
.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 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.
.El