1TEXT-VIMCOLOR(1)      User Contributed Perl Documentation     TEXT-VIMCOLOR(1)
2
3
4

NAME

6       text-vimcolor - Use Text:VimColor from the command line
7

VERSION

9       version 0.29
10

SYNOPSIS

12          $ text-vimcolor FILENAME
13            # (like a colored "cat" (same as "text-vimcolor --format ansi FILENAME"))
14          $ text-vimcolor --format html --full-page FILENAME > OUTPUT.html
15          $ text-vimcolor --format xml FILENAME > OUTPUT.xml
16          $ text-vimcolor --format pdf FILENAME --output OUTPUT.pdf
17

DESCRIPTION

19       This program uses the Vim text editor to highlight text according to
20       its syntax, and turn the highlighting into ANSI, HTML, XML or PDF
21       output.  It works with any file type which Vim itself can highlight.
22       Usually Vim will be able to auto-detect the file format based on the
23       filename (and sometimes the contents of the file).
24
25       Exactly one filename should be given on the command line to name the
26       input file.  If none is given input will instead be read from "STDIN".
27
28       If Vim can't guess the file type automatically, it can be specified
29       explicitly using the "--filetype" option.  For example:
30
31          $ text-vimcolor --format html --filetype prolog foo.pl > foo.html
32
33       This program is a command line interface to the Perl module
34       Text::VimColor.
35

OPTIONS

37       The following options are understood:
38
39       --help
40           Show a summary of the usage, including a list of options.
41
42       --debug
43           Turns on debugging in the underlying Perl module.  This makes it
44           print the command used to run Vim.
45
46       --all-syntax-groups
47           Enables additional syntax groups instead of just the primary ones.
48           See "all_syntax_groups" in Text::VimColor for more information.
49
50       --filetype file-type
51           Set the type of the file explicitly.  The file-type argument should
52           be something which Vim will recognize when set with its "filetype"
53           option.  Examples are "perl", "cpp" (for C++) and "sh" (for Unix
54           shell scripts).  These names are case sensitive, and should usually
55           be all-lowercase.
56
57       --format output-format
58           The output format to generate.  Must be one of the following:
59
60           ansi
61               Output text marked up with ANSI escape sequences (using
62               Term::ANSIColor).  This is like a colorized version of cat(1).
63
64               You can alter the color scheme using the "TEXT_VIMCOLOR_ANSI"
65               environment variable in the format of "SynGroup=color;".  For
66               example:
67
68                  TEXT_VIMCOLOR_ANSI='Comment=green;Statement = magenta; '
69
70               On windows the script will attempt to load Win32::Console::ANSI
71               if the output is to STDOUT in an attempt to make the output
72               more useful.  You can disable this by setting
73               "TEXT_VIMCOLOR_NO_WIN32_ANSI=1".
74
75           html
76               Generate XHTML output, with text marked with "<span>" elements
77               with "class" attributes.  A CSS stylesheet should be used to
78               define the coloring, etc., for the output.  See the
79               "--full-page" option below.
80
81           xml Output is in a simple XML vocabulary.  This can then be used by
82               other software to do further transformations (e.g., using
83               XSLT).
84
85           pdf XML output is generated and fed to the FOP XSL-FO processor,
86               with an appropriate XSL style sheet.  The stylesheet uses XSLT
87               to transform the normal XML output into XSL-FO, which is then
88               rendered to PDF.  For this to work, the command "fop" must be
89               available.  An output file must be specified with "--output"
90               with this format.
91
92           Full details of the HTML and XML output formats can be found in the
93           documentation for Text::VimColor.
94
95       --output output-filename
96           Specifies the name of the output file.  If this option is omitted,
97           the output will be sent to <STDOUT>.  This option is required when
98           the output format is PDF (because of limitations in FOP).
99
100       --full-page
101           When the output format is HTML, this option will make the output a
102           complete HTML page, rather than just a fragment of HTML.  A CSS
103           stylesheet will be inserted inline into the output, so the output
104           will be usable as it is.
105
106       --no-inline-stylesheet
107           When the output format is HTML and "--fullpage" is given, a
108           stylesheet is normally inserted in-line in the output file.  If
109           this option is given it will instead be referenced with a "<link>"
110           element.
111
112       --let name=value
113           When Vim is run the value of name will be set to value using Vim's
114           "let" command.  More than one of these options can be set.  The
115           value is not quoted or escaped in any way, so it can be an
116           expression.  These settings take precedence over "--unlet" options.
117
118           This option corresponds to the "vim_let" setting and method in the
119           Perl module.
120
121       --unlet name
122           Prevent the value of name being set with Vim's "let" command.  This
123           can be used to turn off default settings.
124
125           This option corresponds to the "vim_let" setting and method in the
126           Perl module, when used with a value of "undef".
127

BUGS

129       •   The PDF output option often doesn't work, because it is dependent
130           on FOP, which often doesn't work.  This is also why it is mind
131           numbingly slow.
132
133       •   FOP (0.20.3) seems to ignore the "background-color" property on
134           "<fo:inline>".  If that's what it's meant to do, how do you set the
135           background color on part of a line?
136

SEE ALSO

138       •   Text::VimColor
139

AUTHORS

141       •   Geoff Richards <qef@laxan.com>
142
143       •   Randy Stauner <rwstauner@cpan.org>
144
146       This software is copyright (c) 2002-2006 by Geoff Richards.
147
148       This software is copyright (c) 2011 by Randy Stauner.
149
150       This is free software; you can redistribute it and/or modify it under
151       the same terms as the Perl 5 programming language system itself.
152
153
154
155perl v5.36.0                      2022-07-22                  TEXT-VIMCOLOR(1)
Impressum