Comparing version 0.1.3 to 0.2.0
@@ -7,3 +7,2 @@ var parse = require('./lib/parse') | ||
var hermit = module.exports = function hermit(html, opts, cb) { | ||
console.log('running hermit'); | ||
if (!cb) { | ||
@@ -10,0 +9,0 @@ cb = opts; |
@@ -7,3 +7,3 @@ 'use strict'; | ||
[ 'p', 'dl', 'dt', 'dd', 'ol', 'ul', 'li', 'address', 'blockquote', 'center', 'del', 'div', 'hr', 'pre' ] | ||
[ 'p', 'dl', 'dt', 'dd', 'ol', 'ul', 'li', 'address', 'blockquote', 'center', 'del', 'div', 'hr', 'pre', 'tr' ] | ||
.forEach(function (k) { blocks[k] = { prefix: '\n', suffix: '\n' }; }); | ||
@@ -20,3 +20,3 @@ | ||
opts.listIndent = opts.listIndent || ' '; | ||
opts.listStyle = opts.listStyle || colors.red('\u25b8 '); | ||
opts.listStyle = opts.listStyle || colors.red('\u25aa '); | ||
@@ -23,0 +23,0 @@ function processNode(node) { |
{ | ||
"name": "hermit", | ||
"version": "0.1.3", | ||
"version": "0.2.0", | ||
"description": "Prints html in the terminal using colors and simple layout to reflect the document structure.", | ||
"main": "hermit.js", | ||
"bin": { | ||
"hermit": "./bin/hermit.js" | ||
}, | ||
"scripts": { | ||
@@ -7,0 +10,0 @@ "test": "node test/runner.js" |
@@ -5,2 +5,10 @@ # hermit [![build status](https://secure.travis-ci.org/thlorenz/hermit.png)](http://next.travis-ci.org/thlorenz/hermit) | ||
## Objective | ||
Provide a simple tool to render html in the terminal in a readable format. It is not supposed to replace your browser. | ||
The main indended use is to render html snippets, e.g., the ones contained in the descriptions of the [json version of | ||
the nodejs documentation](http://nodejs.org/api/assert.json). | ||
If you want a terminal browser, try [lynx](http://lynx.browser.org/) instead. | ||
## Installation | ||
@@ -12,4 +20,22 @@ | ||
### As Library | ||
### From the Command Line | ||
To use hermit from the command line, you should install it globally: | ||
npm -g install hermit | ||
#### Rendering a File | ||
hermit filename.html | ||
#### Piping an Html String | ||
You can pipe the output of any program that produces an html string into hermit. | ||
**Example:** | ||
curl http://nodejs.org/api/assert.html | hermit | ||
### From Your Code | ||
```js | ||
@@ -16,0 +42,0 @@ var hermit = require('hermit'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37559
19
616
74
3