NAME
IO::Factotum::skylighting - syntax highlight by skylighting
SYNOPSIS
perl -MIO::Factotum::skylighting -ne 'print' file.c
ansicolumn --factotum=skylighting file.c file.h
DESCRIPTION
This module registers a converter of IO::Factotum which colors source files by the skylighting command, the syntax highlighter of pandoc:
skylighting -f ansi -r -C 16 -S pygments FILE
The language is told by skylighting from the name of the file. When the name does not tell it, as that of a script without an extension, the interpreter on the first line does (#!/usr/bin/env perl, #!/bin/bash). A file whose language is not known is read as it is, and so are a file which has an escape character already, an empty file, and a file larger than $IO::Factotum::skylighting::MAX_SIZE bytes (256 KB by default, 0 for no limit): the colored text is many times larger than the file and takes time to process.
The pygments style, the default of pandoc, has no background color, and -C 16 uses the 16 colors of the terminal, so that the colors go with those of the terminal.
The sequences which do nothing in the output of skylighting, as ESC[22;23;24m after every reset, are taken away.
Loaded by use or -M, it also ties ARGV (IO::Factotum::tie_argv), and a program which reads by <> gets the colored text. setup only registers the converter.
INSTALL
skylighting is in Homebrew and in the packages of the Linux distributions:
brew install skylighting
SEE ALSO
IO::Factotum, IO::Factotum::sourcehighlight, Getopt::EX::Factotum