notebookjs-katex
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -70,12 +70,2 @@ "use strict"; | ||
assert.notEqual(topic[0].indexOf('<span class="katex">'), -1); | ||
}, | ||
'Should contain <math>': function(topic) { | ||
assert.notEqual(topic[0].indexOf('<math>'), -1); | ||
}, | ||
'Should contain math expression': function(topic) { | ||
// This is brittle since it relies on what current Katex rendering style. Better ideas? | ||
// | ||
var expected = 'What is <span class="katex"><span class="katex-mathml"><math><semantics><mrow><mn>1</mn><mo>+</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">1 + 2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="strut" style="height:0.64444em;"></span><span class="strut bottom" style="height:0.72777em;vertical-align:-0.08333em;"></span><span class="base textstyle uncramped"><span class="mord mathrm">1</span><span class="mbin">+</span><span class="mord mathrm">2</span></span></span></span>?'; | ||
assert.equal(topic[0], expected); | ||
} | ||
@@ -128,3 +118,3 @@ }, | ||
}, | ||
'Both $$ and $ spans handled properly': { | ||
@@ -131,0 +121,0 @@ topic: function() { |
{ | ||
"name": "notebookjs-katex", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Process embedded math expressions in IPython Markdown cells.", | ||
@@ -20,7 +20,7 @@ "main": "index.js", | ||
"dependencies": { | ||
"jsonpath": "^0.2.11", | ||
"katex": "^0.7.1" | ||
"jsonpath": "^1.1.1", | ||
"katex": "0" | ||
}, | ||
"devDependencies": { | ||
"vows": "^0.8.1" | ||
"vows": "0" | ||
}, | ||
@@ -27,0 +27,0 @@ "repository": { |
@@ -1,2 +0,3 @@ | ||
[![Build Status](https://travis-ci.org/bradhowes/notebookjs-katex.svg?branch=master)](https://travis-ci.org/bradhowes/notebookjs-katex) | ||
[![CI](https://github.com/bradhowes/notebookjs-katex/workflows/CI/badge.svg)](https://github.com/bradhowes/notebookjs-katex) | ||
[![License: MIT](https://img.shields.io/badge/License-MIT-A31F34.svg)](https://opensource.org/licenses/MIT) | ||
@@ -18,3 +19,3 @@ # Overview | ||
`notebookjs`'s `render` process will properly generate inline and block math HTML expressions using the | ||
[Katex](https://github.com/Khan/KaTeX) package. I use this to perform server-side math expression rendering for | ||
[KaTeX](https://github.com/Khan/KaTeX) package. I use this to perform server-side math expression rendering for | ||
my blog, [Keystroke Countdown](https://keystrokecountdown.com). | ||
@@ -34,4 +35,4 @@ | ||
```javascript | ||
const KatexFilter = require("notebookjs-katex"); | ||
const kf = new KatexFilter(); | ||
var KatexFilter = require("notebookjs-katex"); | ||
var kf = new KatexFilter(); | ||
@@ -47,3 +48,3 @@ var ipynb = JSON.parse(fs.readFileSync('/path/to/notebook.ipynb')); | ||
The `KatexFilter` constructor takes an optional configuration object which will be given to the Katex `render` | ||
The `KatexFilter` constructor takes an optional configuration object which will be given to the KaTeX `render` | ||
method. See the [docs](https://github.com/Khan/KaTeX#rendering-options) for details. Note that `KatexFilter` | ||
@@ -57,3 +58,3 @@ always sets `throwOnError` to `false`, and `displayMode` will be set depending on the delimiters surrounding the | ||
JSON file. | ||
* [katex](https://github.com/Khan/KaTeX) -- performs the rendering of the LaTeX commands. | ||
* [KaTeX](https://github.com/Khan/KaTeX) -- performs the rendering of the LaTeX commands. | ||
@@ -60,0 +61,0 @@ # Tests |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
66
22034
8
261
+ Addedcommander@8.3.0(transitive)
+ Addeddeep-is@0.1.4(transitive)
+ Addedescodegen@1.14.3(transitive)
+ Addedesprima@4.0.1(transitive)
+ Addedestraverse@4.3.0(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedfast-levenshtein@2.0.6(transitive)
+ Addedjsonpath@1.1.1(transitive)
+ Addedkatex@0.16.10(transitive)
+ Addedlevn@0.3.0(transitive)
+ Addedoptionator@0.8.3(transitive)
+ Addedprelude-ls@1.1.2(transitive)
+ Addedsource-map@0.6.1(transitive)
+ Addedstatic-eval@2.0.2(transitive)
+ Addedtype-check@0.3.2(transitive)
+ Addedunderscore@1.12.1(transitive)
+ Addedword-wrap@1.2.5(transitive)
- RemovedJSONSelect@0.4.0(transitive)
- Removedcjson@0.2.1(transitive)
- Removedcolors@0.5.1(transitive)
- Removedebnf-parser@0.1.10(transitive)
- Removedescodegen@0.0.210.0.28(transitive)
- Removedesprima@1.0.4(transitive)
- Removedestraverse@0.0.41.3.2(transitive)
- Removedjison@0.4.13(transitive)
- Removedjison-lex@0.2.1(transitive)
- Removedjsonpath@0.2.12(transitive)
- Removedkatex@0.7.1(transitive)
- Removedlex-parser@0.1.4(transitive)
- Removedmatch-at@0.1.1(transitive)
- Removednomnom@1.5.2(transitive)
- Removedsource-map@0.7.4(transitive)
- Removedstatic-eval@0.2.3(transitive)
- Removedunderscore@1.1.71.7.0(transitive)
Updatedjsonpath@^1.1.1
Updatedkatex@0