<commit_before># 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 [<NAME>'s EPUB Adaptive Layout implementation](https://github.com/sorotokin/adaptive-layout) (licensed under Apache License 2.0).

## Try Vivliostyle.js

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

## Bug reports & feature requests

Please send them to

- [GitHub Issues](https://github.com/vivliostyle/vivliostyle.js/issues)
- Mailing list ([Japanese](https://groups.google.com/forum/?hl=ja#!forum/vivliostyle-ja))

## Using Vivliostyle.js viewer

To run the viewer, you need to generate CSS files using [Compass](http://compass-style.org):

```sh
# 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](https://developers.google.com/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

```sh
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).<commit_msg>Update README [ci skip]<commit_after># Vivliostyle.js

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

## Try Vivliostyle.js

http://vivliostyle.com/en/sample/

## Bug reports & feature requests

Please send them to

- [GitHub Issues](https://github.com/vivliostyle/vivliostyle.js/issues)
- Mailing list ([English](https://groups.google.com/forum/?hl=ja#!forum/vivliostyle), [Japanese](https://groups.google.com/forum/?hl=ja#!forum/vivliostyle-ja))

## Using Vivliostyle.js

### Using Vivliostyle.js Viewer

Download a release package from <http://vivliostyle.com/en/sample/> and follow the instruction inside.

See <https://github.com/vivliostyle/vivliostyle-js-viewer> for source code of the Viewer.

### Integrating Vivliostyle.js into web sites

Vivliostyle.js can be installed from [npm](https://www.npmjs.com/package/vivliostyle):

```
npm install vivliostyle
```

Developer API documents are coming soon.

## License

Licensed under [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0).

Vivliostyle.js is implemented based on [<NAME>'s EPUB Adaptive Layout implementation](https://github.com/sorotokin/adaptive-layout).
{'fraction_non_alphanumeric': 0.09482758620689655, 'fraction_numerical': 0.002281947261663286, 'mean_word_length': 4.717391304347826, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1705481', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1166, 'n_words': 440}