# maths-inliner

> Inlines MathJax, selected scripts and images.

Latest version **0.0.9** (published 2019-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install maths-inliner
pnpm add maths-inliner
yarn add maths-inliner
bun add maths-inliner
```

Provides the command `minliner`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.9 |
| Published | 2019-01-18 |
| First published | 2017-01-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 1.6 MB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Matthew Burke |
| Maintainers | mwpb |
| Keywords | mathjax, inline, svg, images, scripts |

## Links

- npm: https://www.npmjs.com/package/maths-inliner
- Repository: https://github.com/mwpb/maths-inliner
- Homepage: https://github.com/mwpb/maths-inliner#readme
- Issues: https://github.com/mwpb/maths-inliner/issues
- npm.io page: https://npm.io/package/maths-inliner

## Dependencies (3)

- [fs](https://npm.io/package/fs.md) latest
- [cheerio](https://npm.io/package/cheerio.md) latest
- [mathjax-node](https://npm.io/package/mathjax-node.md) ^2.1.1

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 0.0.9 (latest) — 2019-01-18
- 0.0.8 — 2019-01-18
- 0.0.7 — 2019-01-17
- 0.0.6 — 2019-01-17
- 0.0.5 — 2019-01-17
- 0.0.4 — 2019-01-17
- 0.0.3 — 2019-01-17
- 0.0.2 — 2017-01-08
- 0.0.1 — 2017-01-08

## README

# Maths-inliner

Finds all MathJax inline and display formulas in an html file and replaces them with inline SVG images.

Useful when you want to display mathematics fast and/or when using an embedded webview (e.g. Xamarin HybridWebView).

Allows the user to specify certain script tags (using the class="inline") to inline these scripts.
Similarly the attribute class="inline" will inline images.
(Tested only with SVG images at present.)

## Prerequistes

* cheerio
* fs
* mathjax-node

## Installation

```
npm install maths-inliner
```

of to install globally:

```
npm install -g maths-inliner
```

## Basic Usage

The exposed node script is called 'minliner'.
It requires 2 arguments: the infile and the outfile.

```
minliner infile.html outfile.html
```

In `infile.html` decorate the scripts and SVG images you would like to inline with `class="inline"` and those you would like to ignore with `class="hide"`.
(For instance if you have scripts calling MathJax it is best to hide these as the inliner doesn't use them.)

## Example

There is an example showing basic usage [here](test/inscribed.html).

## Implementation

Uses regex to locate inline and display mathematics.
Now uses mathjax-node to replace them with SVG code.
Uses Promises for everything async.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

---
_Source: https://npm.io/package/maths-inliner · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
