JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q41346F
  • License MIT

generate markup for highlight.js file viewer

Package Exports

  • hifile

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hifile) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

hifile

Generate file viewer markup for highlighted strings from highlight.js

hifile output

Live demo of example output available on rawgit.com.

Usage

var hifile = require('hifile');

var str = fs.readFileSync(path.join(__dirname, 'example.js'), 'utf8');
var markup = hifile(str, 'js');

Presentation and behaviour are provided via:

  • assets/css/hifile.css
  • assets/js/hifile.js with
  • assets/css/hljs-theme-*.css for highlight theming

When served to the browser with the markup, line numbers and line highlighting will be available.