.\" Automatically generated by Pod::Man 2.22 (Pod::Simple 3.13) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "TEXT-VIMCOLOR 1p" .TH TEXT-VIMCOLOR 1p "2006-02-19" "perl v5.10.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" text\-vimcolor \- command\-line program to syntax color a file in HTML, XML or PDF .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& $ text\-vimcolor \-\-format html \-\-full\-page FILENAME > OUTPUT.html \& $ text\-vimcolor \-\-format xml FILENAME > OUTPUT.xml \& $ text\-vimcolor \-\-format pdf FILENAME \-\-output OUTPUT.pdf .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This program uses the Vim text editor to highlight text according to its syntax, and turn the highlighting into \s-1HTML\s0, \s-1XML\s0 or \s-1PDF\s0 output. It works with any file type which Vim itself can highlight. Usually Vim will be able to autodetect the file format based on the filename (and sometimes the contents of the file). .PP Exactly one filename should be given on the command line to name the input file. If none is given input will instead be read from stdin (the standard input). .PP If Vim can't guess the file type automatically, it can be specified explicitly using the \f(CW\*(C`\-\-filetype\*(C'\fR option. For example: .PP .Vb 1 \& $ text\-vimcolor \-\-format html \-\-filetype prolog foo.pl > foo.html .Ve .PP This program is a command line interface to the Perl module Text::VimColor. .SH "OPTIONS" .IX Header "OPTIONS" The following options are understood: .IP "\-\-help" 4 .IX Item "--help" Show a summary of the usage, including a list of options. .IP "\-\-debug" 4 .IX Item "--debug" Turns on debugging in the underlying Perl module. This makes it print the command used to run Vim. .IP "\-\-filetype \fIfile-type\fR" 4 .IX Item "--filetype file-type" Set the type of the file explicitly. The \fIfile-type\fR argument should be something which Vim will recognise when set with its \f(CW\*(C`filetype\*(C'\fR option. Examples are \f(CW\*(C`perl\*(C'\fR, \f(CW\*(C`cpp\*(C'\fR (for \*(C+) and \f(CW\*(C`sh\*(C'\fR (for Unix shell scripts). These names are case sensitive, and should usually be all-lowercase. .IP "\-\-format \fIoutput-format\fR" 4 .IX Item "--format output-format" The output format to generate. Must be one of the following: .RS 4 .IP "html" 4 .IX Item "html" Generate \s-1XHTML\s0 output, with text marked with \f(CW\*(C`\*(C'\fR elements with \f(CW\*(C`class\*(C'\fR attributes. A \s-1CSS\s0 stylesheet should be used to define the coloring, etc., for the output. See the \f(CW\*(C`\-\-full\-page\*(C'\fR option below. .IP "xml" 4 .IX Item "xml" Output is in a simple \s-1XML\s0 vocabulary. This can then be used by other software to do further transformations (e.g., using \s-1XSLT\s0). .IP "pdf" 4 .IX Item "pdf" \&\s-1XML\s0 output is generated and fed to the \s-1FOP\s0 XSL-FO processor, with an appropriate \s-1XSL\s0 style sheet. The stylesheet uses \s-1XSLT\s0 to transform the normal \s-1XML\s0 output into XSL-FO, which is then rendered to \s-1PDF\s0. For this to work, the command \f(CW\*(C`fop\*(C'\fR must be available. An output file must be specified with \f(CW\*(C`\-\-output\*(C'\fR with this format. .RE .RS 4 .Sp Full details of the \s-1HTML\s0 and \s-1XML\s0 output formats can be found in the documentation for Text::VimColor. .RE .IP "\-\-output \fIoutput-filename\fR" 4 .IX Item "--output output-filename" Specifies the name of the output file (which will end up containing either \&\s-1HTML\s0, \s-1XML\s0 or \s-1PDF\s0). If this option is omitted, the output will be sent to stdout (the standard output). This option is required when the output format is \s-1PDF\s0 (because of limitations in \s-1FOP\s0). .IP "\-\-full\-page" 4 .IX Item "--full-page" When the output format is \s-1HTML\s0, this option will make the output a complete \&\s-1HTML\s0 page, rather than just a fragment of \s-1HTML\s0. A \s-1CSS\s0 stylesheet will be inserted inline into the output, so the output will be useable as it is. .IP "\-\-no\-inline\-stylesheet" 4 .IX Item "--no-inline-stylesheet" When the output format is \s-1HTML\s0 and \f(CW\*(C`\-\-fullpage\*(C'\fR is given, a stylesheet is normally inserted in-line in the output file. If this option is given it will instead be referenced with a \f(CW\*(C`\*(C'\fR element. .IP "\-\-let \fIname\fR=\fIvalue\fR" 4 .IX Item "--let name=value" When Vim is run the value of \fIname\fR will be set to \fIvalue\fR using Vim's \f(CW\*(C`let\*(C'\fR command. More than one of these options can be set. The value is not quoted or escaped in any way, so it can be an expression. These settings take precedence over \f(CW\*(C`\-\-unlet\*(C'\fR options. .Sp This option corresponds to the \f(CW\*(C`vim_let\*(C'\fR setting and method in the Perl module. .IP "\-\-unlet \fIname\fR" 4 .IX Item "--unlet name" Prevent the value of \fIname\fR being set with Vim's \f(CW\*(C`let\*(C'\fR command. This can be used to turn off default settings. .Sp This option corresponds to the \f(CW\*(C`vim_let\*(C'\fR setting and method in the Perl module, when used with a value of \f(CW\*(C`undef\*(C'\fR. .SH "BUGS" .IX Header "BUGS" .IP "\(bu" 4 The \s-1PDF\s0 output option often doesn't work, because it is dependent on \s-1FOP\s0, which often doesn't work. This is also why it is mind numbingly slow. .IP "\(bu" 4 \&\s-1FOP\s0 (0.20.3) seems to ignore the \f(CW\*(C`background\-color\*(C'\fR property on \&\f(CW\*(C`\*(C'\fR. If that's what it's meant to do, how do you set the background color on part of a line? .SH "AUTHOR" .IX Header "AUTHOR" Geoff Richards .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright 2002\-2006, Geoff Richards. .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl.