vim2html

Create syntax-highlighted HTML from source code using Vim's 2html script

Usage no npm install needed!

<script type="module">
  import vim2html from 'https://cdn.skypack.dev/vim2html';
</script>

README

vim2html

Build Status

Create syntax-highlighted HTML from source code using Vim's 2html script

vim2html = require 'vim2html'
opts = {
    syntax: 'coffee'
    colorscheme: 'jellybeans'
    number_lines: 0
    use_css: 0
    pre_only: 1
}

# highlight some string, write result to result.html
vim2html.highlightString "var x={() ==> ERRo'neous';function <3", 'result.html', opts, (err, asFilename) -> ...

# highlight the file containing the following statement
vim2html.highlightFile __filename, null, opts, (err, asString) -> ...