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

vivliostyle

Package Overview
Dependencies
Maintainers
1
Versions
431
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vivliostyle

Library for web sites with rich paged viewing and EPUB support, shared with Vivliostyle Formatter & Browser

  • 0.2.0-pre.20150914025033
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
53
decreased by-55.46%
Maintainers
1
Weekly downloads
 
Created
Source

Vivliostyle.js

JavaScript library for web sites with rich paged viewing and EPUB support, shared with Vivliostyle Formatter & Browser. Vivliostyle.js is implemented based on Peter Sorotokin's EPUB Adaptive Layout implementation (licensed under Apache License 2.0).

Try Vivliostyle.js

http://vivliostyle.github.io/vivliostyle.js/

Bug reports & feature requests

Please send them to

Using Vivliostyle.js viewer

To run the viewer, you need to generate CSS files using Compass:

# Ensure Ruby and Node.js is installed in your system
gem install compass
npm install
npm run build-css

Then you need a web server that can serve the following resources:

  • src directory (contains core JavaScript files and resources)
  • viewer directory (contains viewer resources like HTML/CSS/web fonts)
  • Content files you want to view in the viewer (see below)

The viewer can display HTML files, as well as unpackaged EPUB and FB2 publications. Note that the viewer may not be able to display contents on servers different from one hosting the viewer files due to security restriction on cross-origin resources.

To display the content, a URL should be constructed in the following way: start by creating a URL that references vivliostyle-viewer.html. Then append '#' and one of the following parameters (x for HTML/FB2, b for EPUB's OPF file).

  • x=[path-to-html-or-fb2-content]
  • b=[path-to-opf-file]

Path could either be absolute in the server context (starting with /) or relative to vivliostyle-viewer.html file.

MathML support

Vivliostyle viewer can utilize MathJax to render MathML content in modern browsers. To use MathJax, ensure that the path to MathJax script is correct in vivliostyle-viewer.html.

Compiling JavaScript using Google Closure compiler

Google Closure compiler can be used to make the code faster and much more compact. Use of the Closure compiler for web apps is optional.

Closure compiler can be installed via npm. To compile JavaScipt, run

npm install
npm run build

Then the compiled JavaScript file appears at lib/vivliostyle.min.js. Modify vivliostyle-viewer.html to reference only vivliostyle-viewer.min.js (goog/base.js is not needed, but MathJax-related files can be kept if desired). You might need to modify uaRoot parameter in vivliostyle-viewer.html to point the location of user agent resources (user-agent-* and validation.txt files).

FAQs

Package last updated on 14 Sep 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