1TEXT-VIMCOLOR(1) User Contributed Perl Documentation TEXT-VIMCOLOR(1)
2
3
4
6 text-vimcolor - command-line program to syntax color a file in HTML,
7 XML or PDF
8
10 $ text-vimcolor --format html --full-page FILENAME > OUTPUT.html
11 $ text-vimcolor --format xml FILENAME > OUTPUT.xml
12 $ text-vimcolor --format pdf FILENAME --output OUTPUT.pdf
13
15 This program uses the Vim text editor to highlight text according to
16 its syntax, and turn the highlighting into HTML, XML or PDF output. It
17 works with any file type which Vim itself can highlight. Usually Vim
18 will be able to autodetect the file format based on the filename (and
19 sometimes the contents of the file).
20
21 Exactly one filename should be given on the command line to name the
22 input file. If none is given input will instead be read from stdin
23 (the standard input).
24
25 If Vim can't guess the file type automatically, it can be specified
26 explicitly using the "--filetype" option. For example:
27
28 $ text-vimcolor --format html --filetype prolog foo.pl > foo.html
29
30 This program is a command line interface to the Perl module
31 Text::VimColor.
32
34 The following options are understood:
35
36 --help
37 Show a summary of the usage, including a list of options.
38
39 --debug
40 Turns on debugging in the underlying Perl module. This makes it
41 print the command used to run Vim.
42
43 --filetype file-type
44 Set the type of the file explicitly. The file-type argument should
45 be something which Vim will recognise when set with its "filetype"
46 option. Examples are "perl", "cpp" (for C++) and "sh" (for Unix
47 shell scripts). These names are case sensitive, and should usually
48 be all-lowercase.
49
50 --format output-format
51 The output format to generate. Must be one of the following:
52
53 html
54 Generate XHTML output, with text marked with "<span>" elements
55 with "class" attributes. A CSS stylesheet should be used to
56 define the coloring, etc., for the output. See the
57 "--full-page" option below.
58
59 xml Output is in a simple XML vocabulary. This can then be used by
60 other software to do further transformations (e.g., using
61 XSLT).
62
63 pdf XML output is generated and fed to the FOP XSL-FO processor,
64 with an appropriate XSL style sheet. The stylesheet uses XSLT
65 to transform the normal XML output into XSL-FO, which is then
66 rendered to PDF. For this to work, the command "fop" must be
67 available. An output file must be specified with "--output"
68 with this format.
69
70 Full details of the HTML and XML output formats can be found in the
71 documentation for Text::VimColor.
72
73 --output output-filename
74 Specifies the name of the output file (which will end up containing
75 either HTML, XML or PDF). If this option is omitted, the output
76 will be sent to stdout (the standard output). This option is
77 required when the output format is PDF (because of limitations in
78 FOP).
79
80 --full-page
81 When the output format is HTML, this option will make the output a
82 complete HTML page, rather than just a fragment of HTML. A CSS
83 stylesheet will be inserted inline into the output, so the output
84 will be useable as it is.
85
86 --no-inline-stylesheet
87 When the output format is HTML and "--fullpage" is given, a
88 stylesheet is normally inserted in-line in the output file. If
89 this option is given it will instead be referenced with a "<link>"
90 element.
91
92 --let name=value
93 When Vim is run the value of name will be set to value using Vim's
94 "let" command. More than one of these options can be set. The
95 value is not quoted or escaped in any way, so it can be an
96 expression. These settings take precedence over "--unlet" options.
97
98 This option corresponds to the "vim_let" setting and method in the
99 Perl module.
100
101 --unlet name
102 Prevent the value of name being set with Vim's "let" command. This
103 can be used to turn off default settings.
104
105 This option corresponds to the "vim_let" setting and method in the
106 Perl module, when used with a value of "undef".
107
109 · The PDF output option often doesn't work, because it is dependent
110 on FOP, which often doesn't work. This is also why it is mind
111 numbingly slow.
112
113 · FOP (0.20.3) seems to ignore the "background-color" property on
114 "<fo:inline>". If that's what it's meant to do, how do you set the
115 background color on part of a line?
116
118 Geoff Richards <qef@laxan.com>
119
121 Copyright 2002-2006, Geoff Richards.
122
123 This program is free software; you can redistribute it and/or modify it
124 under the same terms as Perl.
125
126
127
128perl v5.12.0 2006-02-19 TEXT-VIMCOLOR(1)