Skip to content
Browse files

0.4.0 release

  • Loading branch information...
1 parent aa82f53 commit 124eeac2e24adf7cb973971e1a30f994c63c8e18 @rtomayko committed Jun 23, 2010
Showing with 194 additions and 4 deletions.
  1. +2 −0 .gitignore
  2. +8 −3 bcat.gemspec
  3. +1 −1 lib/bcat.rb
  4. +55 −0 man/a2h.1
  5. +64 −0 man/bcat.1
  6. +64 −0 man/btee.1
View
2 .gitignore
@@ -4,3 +4,5 @@ btee.1
btee.1.html
a2h.1
a2h.1.html
+bcat-modules.7
+bcat-modules.7.html
View
11 bcat.gemspec
@@ -1,7 +1,7 @@
Gem::Specification.new do |s|
s.name = 'bcat'
- s.version = '0.3.0'
- s.date = '2010-06-21'
+ s.version = '0.4.0'
+ s.date = '2010-06-23'
s.summary = "browser cat"
s.description =
@@ -19,16 +19,21 @@ Gem::Specification.new do |s|
README
Rakefile
bcat.gemspec
+ bin/a2h
bin/bcat
- bin/bcat-encodehtml
bin/btee
lib/bcat.rb
+ lib/bcat/ansi.rb
lib/bcat/browser.rb
lib/bcat/html.rb
lib/bcat/kidgloves.rb
lib/bcat/reader.rb
+ man/a2h.1.ronn
man/bcat.1.ronn
man/btee.1.ronn
+ test/test_bcat_a2h.rb
+ test/test_bcat_ansi.rb
+ test/test_bcat_browser.rb
test/test_bcat_head_parser.rb
]
# = MANIFEST =
View
2 lib/bcat.rb
@@ -6,7 +6,7 @@
require 'bcat/browser'
class Bcat
- VERSION = '0.3.0'
+ VERSION = '0.4.0'
include Rack::Utils
attr_reader :format
View
55 man/a2h.1
@@ -0,0 +1,55 @@
+.\" generated with Ronn/v0.6.42
+.\" http://github.com/rtomayko/ronn/tree/0.6.6-36-gb67d494
+.
+.TH "A2H" "1" "June 2010" "Ryan Tomayko" "Bcat 0.4.0"
+.
+.SH "NAME"
+\fBa2h\fR \- convert ANSI/VT100 escape sequences to HTML
+.
+.SH "SYNOPSIS"
+\fBa2h\fR [\-] [\fIfile\fR\.\.\.]
+.
+.SH "DESCRIPTION"
+The \fBa2h\fR utility reads from standard input, or one or more \fIfile\fRs, and converts ANSI/VT100 escape sequences to inline HTML\.
+.
+.SH "ESCAPE SEQUENCES"
+The following escape sequences are supported:
+.
+.TP
+\fB<ESC>[0m\fR
+Resets all attributes / closes all HTML tags\.
+.
+.TP
+\fB<ESC>[1m\fR=\fB<b>\fR
+Bold\.
+.
+.TP
+\fB<ESC>[4m\fR=\fB<u>\fR
+Underscore\.
+.
+.TP
+\fB<ESC>[5m\fR=\fB<blink>\fR
+Blink\. Really\.
+.
+.TP
+\fB<ESC>[8m\fR=\fB<span style=\'display:none\'>\fR
+Hidden\.
+.
+.TP
+\fB<ESC>[30\-37m\fR=\fB<span style=\'color:\fR\fIcolor\fR\fB>\fR
+Foreground color\.
+.
+.TP
+\fB<ESC>[40\-47m\fR=\fB<span style=\'background\-color:\fR\fIcolor\fR\fB>\fR
+Background color\.
+.
+.TP
+\fB<ESC>[90\-97m\fR=\fB<span style=\'color:\fR\fIcolor\fR\fB>\fR
+Light foreground colors\.
+.
+.TP
+\fB<ESC>[100\-107m\fR=\fB<span style=\'background\-color:\fR\fIcolor\fR\fB>\fR
+Light background color\.
+.
+.SH "SEE ALSO"
+ansi2html\.sh \fIhttp://code\.google\.com/p/wrdese/source/browse/trunk/b/ansi2html\.sh?r=5\fR, HTML::FromANSI \fIhttp://cpansearch\.perl\.org/src/NUFFIN/HTML\-FromANSI\-2\.03/lib/HTML/FromANSI\.pm\fR
View
64 man/bcat.1
@@ -0,0 +1,64 @@
+.\" generated with Ronn/v0.6.42
+.\" http://github.com/rtomayko/ronn/tree/0.6.6-36-gb67d494
+.
+.TH "BCAT" "1" "June 2010" "Ryan Tomayko" "Bcat 0.4.0"
+.
+.SH "NAME"
+\fBbcat\fR \- browser cat
+.
+.SH "SYNOPSIS"
+\fBbcat\fR [\-htad] [\fIfile\fR\.\.\.]
+.
+.br
+\fBbtee\fR [\-htad] [\fIfile\fR\.\.\.]
+.
+.SH "DESCRIPTION"
+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\.
+.
+.P
+When invoked as \fBbtee\fR, all input is written immediately to standard output in addition to being piped into the browser\.
+.
+.SH "OPTIONS"
+\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:
+.
+.IP "\(bu" 4
+\fB\-b\fR, \fB\-\-browser\fR=default|firefox|safari|chrome|opera|\fIother\fR 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\.
+.
+.IP "\(bu" 4
+\fB\-T\fR, \fB\-\-title\fR=\fItext\fR: Use \fItext\fR as the page \fB<title>\fR\. By default, the path to the current working directory is used as the title\.
+.
+.IP "\(bu" 4
+\fB\-a\fR, \fB\-\-ansi\fR: 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\.
+.
+.IP "" 0
+.
+.P
+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:
+.
+.TP
+\fB\-t\fR, \fB\-\-text\fR
+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\.
+.
+.TP
+\fB\-h\fR, \fB\-\-html\fR
+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\.
+.
+.P
+Miscellaneous options:
+.
+.TP
+\fB\-d\fR, \fB\-\-debug\fR
+Turn on verbose debug logging to standard error\. Include this output when reporting defects if applicable\.
+.
+.SH "ENVIRONMENT"
+.
+.TP
+\fBBCAT_BROWSER\fR=default|firefox|safari|chrome|opera|\fIother\fR
+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\.
+.
+.TP
+\fBBCAT_COMMAND\fR=\fIcommand\fR
+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\.
+.
+.SH "SEE ALSO"
+cat(1), tee(1), open(1)
View
64 man/btee.1
@@ -0,0 +1,64 @@
+.\" generated with Ronn/v0.6.42
+.\" http://github.com/rtomayko/ronn/tree/0.6.6-36-gb67d494
+.
+.TH "BCAT" "1" "June 2010" "Ryan Tomayko" "Bcat 0.4.0"
+.
+.SH "NAME"
+\fBbcat\fR \- browser cat
+.
+.SH "SYNOPSIS"
+\fBbcat\fR [\-htad] [\fIfile\fR\.\.\.]
+.
+.br
+\fBbtee\fR [\-htad] [\fIfile\fR\.\.\.]
+.
+.SH "DESCRIPTION"
+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\.
+.
+.P
+When invoked as \fBbtee\fR, all input is written immediately to standard output in addition to being piped into the browser\.
+.
+.SH "OPTIONS"
+\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:
+.
+.IP "\(bu" 4
+\fB\-b\fR, \fB\-\-browser\fR=default|firefox|safari|chrome|opera|\fIother\fR 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\.
+.
+.IP "\(bu" 4
+\fB\-T\fR, \fB\-\-title\fR=\fItext\fR: Use \fItext\fR as the page \fB<title>\fR\. By default, the path to the current working directory is used as the title\.
+.
+.IP "\(bu" 4
+\fB\-a\fR, \fB\-\-ansi\fR: 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\.
+.
+.IP "" 0
+.
+.P
+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:
+.
+.TP
+\fB\-t\fR, \fB\-\-text\fR
+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\.
+.
+.TP
+\fB\-h\fR, \fB\-\-html\fR
+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\.
+.
+.P
+Miscellaneous options:
+.
+.TP
+\fB\-d\fR, \fB\-\-debug\fR
+Turn on verbose debug logging to standard error\. Include this output when reporting defects if applicable\.
+.
+.SH "ENVIRONMENT"
+.
+.TP
+\fBBCAT_BROWSER\fR=default|firefox|safari|chrome|opera|\fIother\fR
+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\.
+.
+.TP
+\fBBCAT_COMMAND\fR=\fIcommand\fR
+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\.
+.
+.SH "SEE ALSO"
+cat(1), tee(1), open(1)

0 comments on commit 124eeac

Please sign in to comment.
Something went wrong with that request. Please try again.