hifile

2.1.1 • Public • Published

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
2.1.11latest

Version History

VersionDownloads (Last 7 Days)Published
2.1.11
2.1.00
2.0.00
1.4.00
1.1.20
1.0.10
1.0.00
0.0.40
0.0.30
0.0.20
0.0.10

Package Sidebar

Install

npm i hifile

Weekly Downloads

1

Version

2.1.1

License

MIT

Last publish

Collaborators

  • matthewhadley