Comparing version 1.13.0 to 1.13.1
{ | ||
"name": "lowlight", | ||
"version": "1.13.0", | ||
"version": "1.13.1", | ||
"description": "Virtual syntax highlighting for virtual DOMs and non-HTML things", | ||
@@ -17,2 +17,6 @@ "license": "MIT", | ||
"bugs": "https://github.com/wooorm/lowlight/issues", | ||
"funding": { | ||
"type": "github", | ||
"url": "https://github.com/sponsors/wooorm" | ||
}, | ||
"author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)", | ||
@@ -29,3 +33,3 @@ "contributors": [ | ||
"dependencies": { | ||
"fault": "^1.0.2", | ||
"fault": "^1.0.0", | ||
"highlight.js": "~9.16.0" | ||
@@ -36,4 +40,4 @@ }, | ||
"chalk": "^3.0.0", | ||
"nyc": "^14.0.0", | ||
"prettier": "^1.12.0", | ||
"nyc": "^15.0.0", | ||
"prettier": "^1.0.0", | ||
"rehype": "^9.0.0", | ||
@@ -43,3 +47,3 @@ "remark-cli": "^7.0.0", | ||
"tape": "^4.0.0", | ||
"tinyify": "^2.4.3", | ||
"tinyify": "^2.0.0", | ||
"unist-util-remove-position": "^2.0.0", | ||
@@ -79,3 +83,9 @@ "xo": "^0.25.0" | ||
"plugins": [ | ||
"preset-wooorm" | ||
"preset-wooorm", | ||
[ | ||
"toc", | ||
{ | ||
"heading": "contents" | ||
} | ||
] | ||
] | ||
@@ -82,0 +92,0 @@ }, |
@@ -8,4 +8,4 @@ # lowlight | ||
Virtual syntax highlighting for virtual DOMs and non-HTML things, | ||
with language auto-detection. | ||
Virtual syntax highlighting for virtual DOMs and non-HTML things, with language | ||
auto-detection. | ||
Perfect for [React][], [VDOM][], and others. | ||
@@ -16,8 +16,9 @@ | ||
Want to use [Prism][] instead? Try [`refractor`][refractor]! | ||
Want to use [Prism][] instead? | ||
Try [`refractor`][refractor]! | ||
## Table of Contents | ||
## Contents | ||
* [Installation](#installation) | ||
* [Usage](#usage) | ||
* [Install](#install) | ||
* [Use](#use) | ||
* [API](#api) | ||
@@ -35,7 +36,7 @@ * [`low.highlight(language, value[, options])`](#lowhighlightlanguage-value-options) | ||
## Installation | ||
## Install | ||
[npm][]: | ||
```bash | ||
```sh | ||
npm install lowlight | ||
@@ -46,7 +47,7 @@ ``` | ||
## Usage | ||
## Use | ||
Highlight: | ||
```javascript | ||
```js | ||
var low = require('lowlight') | ||
@@ -68,3 +69,3 @@ var tree = low.highlight('js', '"use strict";').value | ||
Or, stringified with [rehype][]: | ||
Or, serialized with [rehype][]: | ||
@@ -86,4 +87,4 @@ ```js | ||
> **Tip**: Use [`hast-to-hyperscript`][to-hyperscript] to transform | ||
> to other virtual DOMs, or DIY. | ||
> **Tip**: Use [`hast-to-hyperscript`][to-hyperscript] to transform to other | ||
> virtual DOMs, or DIY. | ||
@@ -144,6 +145,8 @@ ## API | ||
```js | ||
{ relevance: 3, | ||
{ | ||
relevance: 3, | ||
language: 'applescript', | ||
value: [Array], | ||
secondBest: { relevance: 3, language: 'basic', value: [Array] } } | ||
secondBest: {relevance: 3, language: 'basic', value: [Array]} | ||
} | ||
``` | ||
@@ -158,4 +161,3 @@ | ||
* `relevance` (`number`) | ||
— Integer representing how sure **low** is the given code is in the given | ||
language | ||
— How sure **low** is that the given code is in the found language | ||
* `language` (`string`) | ||
@@ -188,3 +190,3 @@ — The detected `language` | ||
```js | ||
{ relevance: 2, language: 'html', value: [Array] } | ||
{relevance: 2, language: 'html', value: [Array]} | ||
``` | ||
@@ -216,2 +218,3 @@ | ||
low.registerLanguage('markdown', md) | ||
// low.highlight('mdown', '<em>Emphasis</em>') | ||
@@ -248,7 +251,6 @@ // ^ would throw: Error: Unknown language: `mdown` is not registered | ||
It is not suggested to use the pre-built files or requiring `lowlight` in | ||
the browser as that would include 838kB (241kB GZipped) of code. | ||
It is not suggested to use the pre-built files or requiring `lowlight` in the | ||
browser as that would include 838kB (241kB GZipped) of code. | ||
Instead, require `lowlight/lib/core`, and include only the used | ||
highlighters. | ||
Instead, require `lowlight/lib/core`, and include only the used highlighters. | ||
For example: | ||
@@ -266,4 +268,4 @@ | ||
…when using [browserify][] and minifying with [tinyify][] this results in | ||
just 18kB of code (7kB with GZip). | ||
…when using [browserify][] and minifying with [tinyify][] this results in just | ||
18kB of code (7kB with GZip). | ||
@@ -286,2 +288,5 @@ ## Related | ||
— Syntax highlighting in [**remark**](https://github.com/remarkjs/remark) | ||
* [`jstransformer-lowlight`](https://github.com/ai/jstransformer-lowlight) | ||
— Syntax highlighting for [JSTransformers](https://github.com/jstransformers) | ||
and [Pug](https://pugjs.org/language/filters.html) | ||
@@ -288,0 +293,0 @@ ## License |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46697
335
Updatedfault@^1.0.0