aslakhellesoy-bcat 0.6.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,55 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "A2H" "1" "June 2010" "Ryan Tomayko" "Bcat 0.5.0"
5
+ .
6
+ .SH "NAME"
7
+ \fBa2h\fR \- convert ANSI/VT100 escape sequences to HTML
8
+ .
9
+ .SH "SYNOPSIS"
10
+ \fBa2h\fR [\-] [\fIfile\fR\.\.\.]
11
+ .
12
+ .SH "DESCRIPTION"
13
+ The \fBa2h\fR utility reads from standard input, or one or more \fIfile\fRs, and converts ANSI/VT100 escape sequences to inline HTML\.
14
+ .
15
+ .SH "ESCAPE SEQUENCES"
16
+ The following escape sequences are supported:
17
+ .
18
+ .TP
19
+ \fB<ESC>[0m\fR
20
+ Resets all attributes / closes all HTML tags\.
21
+ .
22
+ .TP
23
+ \fB<ESC>[1m\fR=\fB<b>\fR
24
+ Bold\.
25
+ .
26
+ .TP
27
+ \fB<ESC>[4m\fR=\fB<u>\fR
28
+ Underscore\.
29
+ .
30
+ .TP
31
+ \fB<ESC>[5m\fR=\fB<blink>\fR
32
+ Blink\. Really\.
33
+ .
34
+ .TP
35
+ \fB<ESC>[8m\fR=\fB<span style=\'display:none\'>\fR
36
+ Hidden\.
37
+ .
38
+ .TP
39
+ \fB<ESC>[30\-37m\fR=\fB<span style=\'color:\fR\fIcolor\fR\fB>\fR
40
+ Foreground color\.
41
+ .
42
+ .TP
43
+ \fB<ESC>[40\-47m\fR=\fB<span style=\'background\-color:\fR\fIcolor\fR\fB>\fR
44
+ Background color\.
45
+ .
46
+ .TP
47
+ \fB<ESC>[90\-97m\fR=\fB<span style=\'color:\fR\fIcolor\fR\fB>\fR
48
+ Light foreground colors\.
49
+ .
50
+ .TP
51
+ \fB<ESC>[100\-107m\fR=\fB<span style=\'background\-color:\fR\fIcolor\fR\fB>\fR
52
+ Light background color\.
53
+ .
54
+ .SH "SEE ALSO"
55
+ ansi2html\.sh \fIhttp://github\.com/pixelb/scripts/blob/master/scripts/ansi2html\.sh\fR, HTML::FromANSI \fIhttp://cpansearch\.perl\.org/src/NUFFIN/HTML\-FromANSI\-2\.03/lib/HTML/FromANSI\.pm\fR
@@ -0,0 +1,39 @@
1
+ a2h(1) -- convert ANSI/VT100 escape sequences to HTML
2
+ =====================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `a2h` [-] [<file>...]
7
+
8
+ ## DESCRIPTION
9
+
10
+ The `a2h` utility reads from standard input, or one or more <file>s, and
11
+ converts ANSI/VT100 escape sequences to inline HTML.
12
+
13
+ ## ESCAPE SEQUENCES
14
+
15
+ The following escape sequences are supported:
16
+
17
+ * `<ESC>[0m`:
18
+ Resets all attributes / closes all HTML tags.
19
+ * `<ESC>[1m`=`<b>`:
20
+ Bold.
21
+ * `<ESC>[4m`=`<u>`:
22
+ Underscore.
23
+ * `<ESC>[5m`=`<blink>`:
24
+ Blink. Really.
25
+ * `<ESC>[8m`=`<span style='display:none'>`:
26
+ Hidden.
27
+ * `<ESC>[30-37m`=`<span style='color:`<color>`>`:
28
+ Foreground color.
29
+ * `<ESC>[40-47m`=`<span style='background-color:`<color>`>`:
30
+ Background color.
31
+ * `<ESC>[90-97m`=`<span style='color:`<color>`>`:
32
+ Light foreground colors.
33
+ * `<ESC>[100-107m`=`<span style='background-color:`<color>`>`:
34
+ Light background color.
35
+
36
+ ## SEE ALSO
37
+
38
+ [ansi2html.sh](http://github.com/pixelb/scripts/blob/master/scripts/ansi2html.sh),
39
+ [HTML::FromANSI](http://cpansearch.perl.org/src/NUFFIN/HTML-FromANSI-2.03/lib/HTML/FromANSI.pm)
@@ -0,0 +1,226 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "BCAT" "1" "July 2010" "Ryan Tomayko" "Bcat 0.5.0"
5
+ .
6
+ .SH "NAME"
7
+ \fBbcat\fR \- browser cat
8
+ .
9
+ .SH "SYNOPSIS"
10
+ \fBbcat\fR [\-htad] [\fIfile\fR\.\.\.]
11
+ .
12
+ .br
13
+ \fBbtee\fR [\-htad] [\fIfile\fR\.\.\.]
14
+ .
15
+ .SH "DESCRIPTION"
16
+ The \fBbcat\fR utility reads from standard input, or one or more \fIfile\fRs, and pipes output into a web browser\. \fIfile\fR may be \'\-\', in which case standard input is concatenated at that position\.
17
+ .
18
+ .P
19
+ When invoked as \fBbtee\fR, all input is written immediately to standard output in addition to being piped into the browser\.
20
+ .
21
+ .SH "OPTIONS"
22
+ \fBbcat\fR opens a simple, undecorated page with the system default web browser and immediately begins streaming input\. The following options control the browser display:
23
+ .
24
+ .TP
25
+ \fB\-b\fR, \fB\-\-browser\fR=default|firefox|safari|chrome|opera|\fIother\fR
26
+ The name of the browser application\. Defaults to the value of the \fBBCAT_BROWSER\fR environment variable, or the system default browser when no \fBBCAT_BROWSER\fR is defined\.
27
+ .
28
+ .TP
29
+ \fB\-T\fR, \fB\-\-title\fR=\fItext\fR
30
+ Use \fItext\fR as the page \fB<title>\fR\. By default, the path to the current working directory is used as the title\.
31
+ .
32
+ .TP
33
+ \fB\-a\fR, \fB\-\-ansi\fR
34
+ Turns on VT100/ANSI escape sequence conversion\. This causes all input to be piped through a2h(1), replacing ANSI escape sequences with HTML for things like bold, underline, and colors\. On by default when the input is text; use the \fB\-a\fR option to turn it on when the input is HTML\.
35
+ .
36
+ .P
37
+ By default, \fBbcat\fR attempts to detect whether input is HTML or plain text using a simple heuristic, but you can force input to be treated as one or the other with these options:
38
+ .
39
+ .TP
40
+ \fB\-t\fR, \fB\-\-text\fR
41
+ The input is non\-HTML encoded text\. All bare \fB<\fR and \fB&\fR characters are entity encoded, end\-of\-line characters are converted to \fB<br>\fR, and the entire output is wrapped in a \fB<pre>\fR\.
42
+ .
43
+ .TP
44
+ \fB\-h\fR, \fB\-\-html\fR
45
+ The input is already HTML encoded\. Under this mode, bcat passes input through to the browser mostly unmodified\. The input may be a full HTML document, or it may be an HTML fragment\. \fBbcat\fR outputs \fB<html>\fR, \fB<head>\fR, and \fB<body>\fR elements even if they are not included in the input\.
46
+ .
47
+ .P
48
+ Miscellaneous options:
49
+ .
50
+ .TP
51
+ \fB\-d\fR, \fB\-\-debug\fR
52
+ Turn on verbose debug logging to standard error\. Include this output when reporting defects if applicable\.
53
+ .
54
+ .SH "ENVIRONMENT"
55
+ .
56
+ .TP
57
+ \fBBCAT_BROWSER\fR=default|firefox|safari|chrome|opera|\fIother\fR
58
+ The name of the browser to use by default\. \fBbcat\fR maps this to an actual browser command based on the current platform\. The special value "default" maps to the system default browser\.
59
+ .
60
+ .TP
61
+ \fBBCAT_COMMAND\fR=\fIcommand\fR
62
+ The entire browser command line (to be executed by \fB/bin/sh\fR)\. This overrides the \fBBCAT_BROWSER\fR environment variable and makes the \fB\-\-browser\fR (\fB\-b\fR) option a no\-op\. This should only be necessary when running a browser unknown to bcat or in order to pass special arguments\.
63
+ .
64
+ .SH "EXAMPLES"
65
+ .
66
+ .SS "Basic Shell Examples"
67
+ With build tools:
68
+ .
69
+ .IP "" 4
70
+ .
71
+ .nf
72
+
73
+ make test |bcat
74
+ rake test |bcat
75
+ .
76
+ .fi
77
+ .
78
+ .IP "" 0
79
+ .
80
+ .P
81
+ As a clipboard viewer:
82
+ .
83
+ .IP "" 4
84
+ .
85
+ .nf
86
+
87
+ pbpaste |bcat # mac
88
+ xclip \-o |bcat # X11
89
+ .
90
+ .fi
91
+ .
92
+ .IP "" 0
93
+ .
94
+ .P
95
+ For previewing HTML:
96
+ .
97
+ .IP "" 4
98
+ .
99
+ .nf
100
+
101
+ markdown README\.md |bcat
102
+ redcloth README\.textile |bcat
103
+ erb \-T \- template\.erb |bcat
104
+ mustache < template\.mustache |bcat
105
+ pygmentize \-Ofull,style=colorful \-f html main\.c |bcat
106
+ .
107
+ .fi
108
+ .
109
+ .IP "" 0
110
+ .
111
+ .P
112
+ As a simple man pager:
113
+ .
114
+ .IP "" 4
115
+ .
116
+ .nf
117
+
118
+ export MANPAGER=\'col \-b |bcat\'
119
+ man grep
120
+ .
121
+ .fi
122
+ .
123
+ .IP "" 0
124
+ .
125
+ .P
126
+ With git, selectively:
127
+ .
128
+ .IP "" 4
129
+ .
130
+ .nf
131
+
132
+ git log \-p \-\-color |bcat
133
+ git diff \-\-color HEAD@{5d} HEAD |bcat
134
+ .
135
+ .fi
136
+ .
137
+ .IP "" 0
138
+ .
139
+ .P
140
+ With git, as the default PAGER:
141
+ .
142
+ .IP "" 4
143
+ .
144
+ .nf
145
+
146
+ export GIT_PAGER=bcat
147
+
148
+ git log \-p
149
+ git diff HEAD@{5d} HEAD
150
+ .
151
+ .fi
152
+ .
153
+ .IP "" 0
154
+ .
155
+ .P
156
+ As a log viewer:
157
+ .
158
+ .IP "" 4
159
+ .
160
+ .nf
161
+
162
+ tail \-n 1000 \-f /var/log/messages |bcat
163
+ tail \-f $RAILS_ROOT/log/development\.log |bcat
164
+ .
165
+ .fi
166
+ .
167
+ .IP "" 0
168
+ .
169
+ .P
170
+ Or, a remote log viewer:
171
+ .
172
+ .IP "" 4
173
+ .
174
+ .nf
175
+
176
+ ssh example\.org \'tail \-n 1000 \-f /var/log/syslog\' |bcat
177
+ .
178
+ .fi
179
+ .
180
+ .IP "" 0
181
+ .
182
+ .SS "Vim and vi Examples"
183
+ Preview current buffer as HTML:
184
+ .
185
+ .IP "" 4
186
+ .
187
+ .nf
188
+
189
+ :!markdown % |bcat
190
+ :!ronn \-5 \-\-pipe % |bcat
191
+ .
192
+ .fi
193
+ .
194
+ .IP "" 0
195
+ .
196
+ .P
197
+ Create keymappings:
198
+ .
199
+ .IP "" 4
200
+ .
201
+ .nf
202
+
203
+ map ,pm :!markdown % \e|bcat
204
+ map ,pp :!pygmentize \-Ofull,style=colorful \-f html % \e|bcat
205
+ .
206
+ .fi
207
+ .
208
+ .IP "" 0
209
+ .
210
+ .P
211
+ Use with \fBmakeprg\fR:
212
+ .
213
+ .IP "" 4
214
+ .
215
+ .nf
216
+
217
+ set makeprg=make\e \e\e\e|bcat
218
+ set makeprg=markdown\e %\e \e\e\e|bcat
219
+ set makeprg=testrb\e %\e \e\e\e|bcat
220
+ .
221
+ .fi
222
+ .
223
+ .IP "" 0
224
+ .
225
+ .SH "SEE ALSO"
226
+ cat(1), tee(1), open(1)
@@ -0,0 +1,159 @@
1
+ bcat(1) -- browser cat
2
+ ======================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bcat` [-htapd] [<file>...]<br>
7
+ `bcat` [-htapd] -c <command>...<br>
8
+ `btee` [-htad] [<file>...]
9
+
10
+ ## DESCRIPTION
11
+
12
+ The `bcat` utility reads from standard input, or one or more <file>s, and pipes
13
+ output into a web browser. <file> may be '-', in which case standard input is
14
+ concatenated at that position.
15
+
16
+ When invoked as `btee`, all input is written immediately to standard output in
17
+ addition to being piped into the browser.
18
+
19
+ ## OPTIONS
20
+
21
+ `bcat` opens a simple, undecorated page with the system default web browser and
22
+ immediately begins streaming input. The following options control the browser
23
+ display:
24
+
25
+ * `-b`, `--browser`=default|firefox|safari|chrome|opera|<other>:
26
+ The name of the browser application. Defaults to the value of the
27
+ `BCAT_BROWSER` environment variable, or the system default browser when
28
+ no `BCAT_BROWSER` is defined.
29
+
30
+ * `-T`, `--title`=<text>:
31
+ Use <text> as the page `<title>`. By default, the path to the current working
32
+ directory is used as the title.
33
+
34
+ * `-a`, `--ansi`:
35
+ Turns on VT100/ANSI escape sequence conversion. This causes all input to be
36
+ piped through a2h(1), replacing ANSI escape sequences with HTML for things
37
+ like bold, underline, and colors. On by default when the input is text; use
38
+ the `-a` option to turn it on when the input is HTML.
39
+
40
+ By default, `bcat` attempts to detect whether input is HTML or plain text using
41
+ a simple heuristic, but you can force input to be treated as one or the other
42
+ with these options:
43
+
44
+ * `-t`, `--text`:
45
+ The input is non-HTML encoded text. All bare `<` and `&` characters are
46
+ entity encoded, end-of-line characters are converted to `<br>`, and the
47
+ entire output is wrapped in a `<pre>`.
48
+
49
+ * `-h`, `--html`:
50
+ The input is already HTML encoded. Under this mode, `bcat` passes input
51
+ through to the browser mostly unmodified. The input may be a full HTML
52
+ document, or it may be an HTML fragment. `bcat` outputs `<html>`, `<head>`,
53
+ and `<body>` elements even if they are not included in the input.
54
+
55
+ Miscellaneous options:
56
+
57
+ * `-c`, `--command`:
58
+ Interpret the remaining options as a command to be run whose output should
59
+ be piped into the web browser.
60
+
61
+ * `-p`, `--persist`:
62
+ Have `bcat` serve requests until it is interrupted. Reloading the page
63
+ in the browser will cause `bcat` to re-read the files (or re-run the command
64
+ if used with the `--command` option). Standard input can only be read once
65
+ and will produce no content on subsequent requests.
66
+
67
+ * `-d`, `--debug`:
68
+ Turn on verbose debug logging to standard error. Include this output when
69
+ reporting defects if applicable.
70
+
71
+ ## ENVIRONMENT
72
+
73
+ * `BCAT_BROWSER`=default|firefox|safari|chrome|opera|<other>:
74
+ The name of the browser to use by default. `bcat` maps this to an
75
+ actual browser command based on the current platform. The special
76
+ value "default" maps to the system default browser.
77
+
78
+ * `BCAT_COMMAND`=<command>:
79
+ The entire browser command line (to be executed by `/bin/sh`). This
80
+ overrides the `BCAT_BROWSER` environment variable and makes the `--browser`
81
+ (`-b`) option a no-op. This should only be necessary when running a
82
+ browser unknown to bcat or in order to pass special arguments.
83
+
84
+ ## EXAMPLES
85
+
86
+ ### Basic Shell Examples
87
+
88
+ With build tools:
89
+
90
+ make test |bcat
91
+ rake test |bcat
92
+
93
+ As a clipboard viewer:
94
+
95
+ pbpaste |bcat # mac
96
+ xclip -o |bcat # X11
97
+
98
+ For previewing HTML:
99
+
100
+ markdown README.md |bcat
101
+ redcloth README.textile |bcat
102
+ erb -T - template.erb |bcat
103
+ mustache < template.mustache |bcat
104
+ pygmentize -Ofull,style=colorful -f html main.c |bcat
105
+
106
+ Regenerate the content each time the page is reloaded:
107
+
108
+ bcat -pc markdown README.md
109
+
110
+ As a simple man pager:
111
+
112
+ export MANPAGER='col -b |bcat'
113
+ man grep
114
+
115
+ With git, selectively:
116
+
117
+ git log -p --color |bcat
118
+ git diff --color HEAD@{5d} HEAD |bcat
119
+
120
+ With git, as the default PAGER:
121
+
122
+ export GIT_PAGER=bcat
123
+
124
+ git log -p
125
+ git diff HEAD@{5d} HEAD
126
+
127
+ As a log viewer:
128
+
129
+ tail -n 1000 -f /var/log/messages |bcat
130
+ tail -f $RAILS_ROOT/log/development.log |bcat
131
+
132
+ Or, a remote log viewer:
133
+
134
+ ssh example.org 'tail -n 1000 -f /var/log/syslog' |bcat
135
+
136
+ ### Vim and vi Examples
137
+
138
+ Preview current buffer as HTML:
139
+
140
+ :!markdown % |bcat
141
+ :!ronn -5 --pipe % |bcat
142
+
143
+ Create keymappings:
144
+
145
+ map ,pm :!markdown % \|bcat
146
+ map ,pp :!pygmentize -Ofull,style=colorful -f html % \|bcat
147
+
148
+ Use with `makeprg`:
149
+
150
+ set makeprg=make\ \\\|bcat
151
+ set makeprg=markdown\ %\ \\\|bcat
152
+ set makeprg=testrb\ %\ \\\|bcat
153
+
154
+ (Note that you may need to escape the `%` character with quotes if there's
155
+ spaces in the pathname. For example: `!markdown '%' |bcat`.)
156
+
157
+ ## SEE ALSO
158
+
159
+ cat(1), tee(1), open(1)