Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/drulac/rehype-lo-math
Transforms math nodes with LibreOffice (writer) math syntax (simplier than AsciiMath)
https://github.com/drulac/rehype-lo-math
Last synced: about 15 hours ago
JSON representation
Transforms math nodes with LibreOffice (writer) math syntax (simplier than AsciiMath)
- Host: GitHub
- URL: https://github.com/drulac/rehype-lo-math
- Owner: Drulac
- License: gpl-3.0
- Created: 2020-07-10T08:09:30.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-09-06T19:10:21.000Z (about 4 years ago)
- Last Synced: 2024-11-06T07:05:17.943Z (11 days ago)
- Language: JavaScript
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# rehype-lo-math
Transforms math nodes with LibreOffice (writer) math syntax (simplier than AsciiMath)## install
```sh
npm install --save rehype-lo-math
```## usage
same as [rehype-katex](https://www.npmjs.com/package/rehype-katex) or [rehype-mathjax](https://www.npmjs.com/package/rehype-mathjax) :
Say we have the following file, `example.html`:
```html
Lift(L) can be determined by Lift Coefficient
(C_L) like the following equation.
L = {1} over {2} * rho v^2 S C_L
```And our script, `example.js`, looks as follows:
```js
const vfile = require('to-vfile')
const unified = require('unified')
const parse = require('rehype-parse')
const loMath = require('rehype-lo-math')
const stringify = require('rehype-stringify')unified()
.use(parse, {fragment: true})
.use(loMath)
.use(stringify)
.process(vfile.readSync('example.html'), function (err, file) {
if (err) throw err
console.log(String(file))
})
```Now, run `node example`