Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

htmlbook

Package Overview
Dependencies
Maintainers
2
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htmlbook

Markdown to HTMLBook converter

  • 0.1.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by18.18%
Maintainers
2
Weekly downloads
 
Created
Source

htmlbook.js

Converts Markdown to HTMLBook.

Installation

Install with npm: npm install -g htmlbook

Usage

Node.js

Within Node, htmlbook.js works on strings.

var htmlbook = require('htmlbook');
var htmlbook_output = htmlbook("source content").parse();

To use htmlbook.js with a file, in Node.js do the following:

var fs = require('fs');
var htmlbook = require('htmlbook');

var htmlbook_output;

fs.readFile('path/to/file.md', 'utf-8', function (error, data) {
  if (error)
    return error;

  htmlbook_output = htmlbook(data).parse();
})

Command Line

$ htmlbook -s SOURCE_FILE -o OUTPUT_FILE

Additionally, type $ htmlbook --help for all options.

Options

Below is a list of available options, default value is emphasized.

  • fragment: false or true
  • level: chapter or book
  • debug: boolean -- default for command line is 'false'

Testing

There are two suites of tests for this repository. The first is spec/htmlbook_spec.js and tests the package for expected output. Run this test with the following:

$ jasmine-node spec/htmlbook_spec.js

The second test suite checks to be sure that the file being tested in htmlbook_spec are in fact being output to valid HTMLBook. It's no use writing tests that pass unless they pass on valid output. These tests are separated because the validation takes longer.

$ jasmine-node spec/validation_spec.js

Keywords

FAQs

Package last updated on 30 Apr 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc