Skip to content
This repository has been archived by the owner on Sep 1, 2019. It is now read-only.

stmuk/p6-Text-VimColour

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

p6-Text-VimColour

Converts language source code into colour syntax HTML using vim.

Idea was shamelessly stolen from the original Perl 5 Text::VimColor

Pull requests welcome.

Installation

To install this module, you'll need vim version at least 7.4.

An optional step for the best syntax colouring results is to also install updated Perl 6 vim syntax files

Synopsis

    use Text::VimColour;
    Text::VimColour.new(
        lang => "perl6",
        in   => "file-to-highlight.p6",
        out  => '/tmp/out.html'
    );

Methods

new

    Text::VimColour.new(
        lang    => 'perl6',
        in      => 'file-to-highlight.p6'
        code    => 'say $foo;',
        out     => '/tmp/out.html',
    );

in

Specifies the input file with the code to highlight. You must specify either in or code.

code

Specifies the code to highlight. You must specify either in or code.

lang

Optional. Specifies the language to use for highlighting. Defaults to c

out

Optional. Specifies the path to a file to output highlighted HTML into

html-full-page

    say Text::VimColour.new( lang => 'perl6', in => 'file-to-highlight.p6')
        .html-full-page;

Takes no arguments. Returns the full HTML page with highlighted code and styling CSS.

html

    say Text::VimColour.new( lang => 'perl6', in => 'file-to-highlight.p6')
        .html;

Same as html-full-page, but returns only the highlighted code HTML.

css

    say Text::VimColour.new( lang => 'perl6', in => 'file-to-highlight.p6')
        .css;

Same as html-full-page, but returns only the styling CSS code.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Other 100.0%