├── src ├── notebookjs │ ├── .gitignore │ ├── .npmignore │ ├── Makefile │ ├── bin │ │ └── cli-render.js │ ├── package.json │ ├── bower.json │ ├── LICENSE.txt │ ├── mathjaxutils.min.js │ ├── README.md │ ├── notebook.min.js │ ├── mathjaxutils.js │ └── notebook.js └── extension.js ├── images ├── jupyter.png └── sample.PNG ├── .vscode ├── settings.json ├── extensions.json └── launch.json ├── static ├── fonts │ ├── KaTeX_Main-Bold.eot │ ├── KaTeX_Main-Bold.ttf │ ├── KaTeX_Main-Bold.woff │ ├── KaTeX_AMS-Regular.eot │ ├── KaTeX_AMS-Regular.ttf │ ├── KaTeX_AMS-Regular.woff │ ├── KaTeX_AMS-Regular.woff2 │ ├── KaTeX_Fraktur-Bold.eot │ ├── KaTeX_Fraktur-Bold.ttf │ ├── KaTeX_Fraktur-Bold.woff │ ├── KaTeX_Main-Bold.woff2 │ ├── KaTeX_Main-Italic.eot │ ├── KaTeX_Main-Italic.ttf │ ├── KaTeX_Main-Italic.woff │ ├── KaTeX_Main-Italic.woff2 │ ├── KaTeX_Main-Regular.eot │ ├── KaTeX_Main-Regular.ttf │ ├── KaTeX_Main-Regular.woff │ ├── KaTeX_Math-Italic.eot │ ├── KaTeX_Math-Italic.ttf │ ├── KaTeX_Math-Italic.woff │ ├── KaTeX_Math-Italic.woff2 │ ├── KaTeX_Math-Regular.eot │ ├── KaTeX_Math-Regular.ttf │ ├── KaTeX_Math-Regular.woff │ ├── KaTeX_Size1-Regular.eot │ ├── KaTeX_Size1-Regular.ttf │ ├── KaTeX_Size2-Regular.eot │ ├── KaTeX_Size2-Regular.ttf │ ├── KaTeX_Size3-Regular.eot │ ├── KaTeX_Size3-Regular.ttf │ ├── KaTeX_Size4-Regular.eot │ ├── KaTeX_Size4-Regular.ttf │ ├── KaTeX_Fraktur-Bold.woff2 │ ├── KaTeX_Fraktur-Regular.eot │ ├── KaTeX_Fraktur-Regular.ttf │ ├── KaTeX_Main-Regular.woff2 │ ├── KaTeX_Math-BoldItalic.eot │ ├── KaTeX_Math-BoldItalic.ttf │ ├── KaTeX_Math-Regular.woff2 │ ├── KaTeX_SansSerif-Bold.eot │ ├── KaTeX_SansSerif-Bold.ttf │ ├── KaTeX_SansSerif-Bold.woff │ ├── KaTeX_Script-Regular.eot │ ├── KaTeX_Script-Regular.ttf │ ├── KaTeX_Script-Regular.woff │ ├── KaTeX_Size1-Regular.woff │ ├── KaTeX_Size1-Regular.woff2 │ ├── KaTeX_Size2-Regular.woff │ ├── KaTeX_Size2-Regular.woff2 │ ├── KaTeX_Size3-Regular.woff │ ├── KaTeX_Size3-Regular.woff2 │ ├── KaTeX_Size4-Regular.woff │ ├── KaTeX_Size4-Regular.woff2 │ ├── KaTeX_Caligraphic-Bold.eot │ ├── KaTeX_Caligraphic-Bold.ttf │ ├── KaTeX_Caligraphic-Bold.woff │ ├── KaTeX_Caligraphic-Bold.woff2 │ ├── KaTeX_Fraktur-Regular.woff │ ├── KaTeX_Fraktur-Regular.woff2 │ ├── KaTeX_Math-BoldItalic.woff │ ├── KaTeX_Math-BoldItalic.woff2 │ ├── KaTeX_SansSerif-Bold.woff2 │ ├── KaTeX_SansSerif-Italic.eot │ ├── KaTeX_SansSerif-Italic.ttf │ ├── KaTeX_SansSerif-Italic.woff │ ├── KaTeX_SansSerif-Italic.woff2 │ ├── KaTeX_SansSerif-Regular.eot │ ├── KaTeX_SansSerif-Regular.ttf │ ├── KaTeX_SansSerif-Regular.woff │ ├── KaTeX_Script-Regular.woff2 │ ├── KaTeX_Typewriter-Regular.eot │ ├── KaTeX_Typewriter-Regular.ttf │ ├── KaTeX_Caligraphic-Regular.eot │ ├── KaTeX_Caligraphic-Regular.ttf │ ├── KaTeX_Caligraphic-Regular.woff │ ├── KaTeX_SansSerif-Regular.woff2 │ ├── KaTeX_Typewriter-Regular.woff │ ├── KaTeX_Typewriter-Regular.woff2 │ └── KaTeX_Caligraphic-Regular.woff2 ├── custom.js ├── custom.css ├── prism.css ├── notebook.css ├── auto-render.min.js ├── require.js └── katex.min.css ├── .vscodeignore ├── jsconfig.json ├── CHANGELOG.md ├── language-configuration.json ├── .eslintrc.json ├── README.md ├── test ├── extension.test.js └── index.js ├── .github └── ISSUE_TEMPLATE │ └── bug_report.md ├── LICENSE ├── .gitignore ├── vsc-extension-quickstart.md └── package.json /src/notebookjs/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /src/notebookjs/.npmignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /src/notebookjs/Makefile: -------------------------------------------------------------------------------- 1 | notebook.min.js: notebook.js 2 | uglifyjs < notebook.js > $@ 3 | -------------------------------------------------------------------------------- /images/jupyter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/images/jupyter.png -------------------------------------------------------------------------------- /images/sample.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/images/sample.PNG -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | } -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Main-Bold.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_AMS-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_AMS-Regular.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Fraktur-Bold.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Fraktur-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Main-Italic.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Main-Regular.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Math-Italic.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Math-Regular.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Math-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Math-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size1-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size1-Regular.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size2-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size2-Regular.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size3-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size3-Regular.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size4-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size4-Regular.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Fraktur-Regular.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Fraktur-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-BoldItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Math-BoldItalic.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Math-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_SansSerif-Bold.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_SansSerif-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Script-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Script-Regular.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Script-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Script-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | test/** 4 | .gitignore 5 | jsconfig.json 6 | vsc-extension-quickstart.md 7 | .eslintrc.json 8 | -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Caligraphic-Bold.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Caligraphic-Bold.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_SansSerif-Italic.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_SansSerif-Italic.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_SansSerif-Regular.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_SansSerif-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Typewriter-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Typewriter-Regular.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Typewriter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Typewriter-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Caligraphic-Regular.eot -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Caligraphic-Regular.ttf -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /static/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /static/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jithurjacob/vscode-nbpreviewer/HEAD/static/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "dbaeumer.vscode-eslint" 6 | ] 7 | } -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es6", 5 | "lib": [ 6 | "es6" 7 | ] 8 | }, 9 | "exclude": [ 10 | "node_modules" 11 | ] 12 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to the "nbpreviewer" extension will be documented in this file. 3 | 4 | Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file. 5 | 6 | ## [Unreleased] 7 | - Initial release -------------------------------------------------------------------------------- /src/notebookjs/bin/cli-render.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env iojs 2 | // Reads a notebook from stdin, prints the rendered HTML to stdout 3 | var fs = require("fs"); 4 | var nb = require("../notebook.js"); 5 | var ipynb = JSON.parse(fs.readFileSync("/dev/stdin")); 6 | var notebook = nb.parse(ipynb); 7 | console.log(notebook.render().outerHTML); 8 | -------------------------------------------------------------------------------- /static/custom.js: -------------------------------------------------------------------------------- 1 | function renderKatex() { 2 | renderMathInElement(document.body, { 3 | delimiters: [ 4 | { left: "$", right: "$", display: true }, 5 | { left: "$$", right: "$$", display: true }, 6 | { left: "\\(", right: "\\)", display: false }, 7 | { left: "\\[", right: "\\]", display: true } 8 | ] 9 | }); 10 | } 11 | window.onload = renderKatex(); -------------------------------------------------------------------------------- /static/custom.css: -------------------------------------------------------------------------------- 1 | body.vscode-dark, body.vscode-dark>.nb-notebook { 2 | background-color: rgb(51, 51, 51)!important; 3 | } 4 | 5 | body.vscode-dark .nb-input:before, body.vscode-dark .nb-output:before{ 6 | color:#fff; 7 | } 8 | 9 | body.vscode-dark .nb-output{ 10 | background: #dadada; 11 | } 12 | 13 | body.vscode-dark .nb-markdown-cell{ 14 | color: #ccc; 15 | } 16 | 17 | body.vscode-dark table{ 18 | background: #ccc!important; 19 | } -------------------------------------------------------------------------------- /language-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | "lineComment": "//", 4 | "blockComment": [ "/*", "*/" ] 5 | }, 6 | "brackets": [ 7 | ["{", "}"], 8 | ["[", "]"] 9 | ], 10 | "autoClosingPairs": [ 11 | { "open": "{", "close": "}", "notIn": ["string"] }, 12 | { "open": "[", "close": "]", "notIn": ["string"] }, 13 | { "open": "(", "close": ")", "notIn": ["string"] }, 14 | { "open": "'", "close": "'", "notIn": ["string"] }, 15 | { "open": "\"", "close": "\"", "notIn": ["string", "comment"] }, 16 | { "open": "`", "close": "`", "notIn": ["string", "comment"] } 17 | ] 18 | } -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": false, 4 | "commonjs": true, 5 | "es6": true, 6 | "node": true 7 | }, 8 | "parserOptions": { 9 | "ecmaFeatures": { 10 | "jsx": true 11 | }, 12 | "sourceType": "module" 13 | }, 14 | "rules": { 15 | "no-const-assign": "warn", 16 | "no-this-before-super": "warn", 17 | "no-undef": "warn", 18 | "no-unreachable": "warn", 19 | "no-unused-vars": "warn", 20 | "constructor-super": "warn", 21 | "valid-typeof": "warn" 22 | } 23 | } -------------------------------------------------------------------------------- /src/notebookjs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "notebookjs", 3 | "version" : "0.2.7", 4 | "description" : "Parse and render IPython/Jupyter notebooks.", 5 | "main" : "notebook.js", 6 | "homepage" : "https://github.com/jsvine/notebookjs", 7 | "keywords" : [ "ipython", "jupyter" ], 8 | "author" : "Jeremy Singer-Vine ", 9 | "contributors" : [], 10 | "license": "MIT", 11 | "dependencies" : { 12 | "jsdom": ">=4.0.0", 13 | "marked": ">=0.3.3", 14 | "ansi_up": ">=1.1.3" 15 | }, 16 | "repository" : {"type": "git", "url": "git://github.com/jsvine/notebookjs.git"} 17 | } 18 | -------------------------------------------------------------------------------- /src/notebookjs/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "notebookjs", 3 | "version": "0.2.6", 4 | "description": "Parse and render IPython/Jupyter notebooks.", 5 | "main": "notebook.js", 6 | "authors": [ 7 | "Jeremy Singer-Vine " 8 | ], 9 | "license": "MIT", 10 | "keywords": [ 11 | "ipython", 12 | "jupyter" 13 | ], 14 | "homepage": "https://github.com/jsvine/notebookjs", 15 | "ignore": [ 16 | "**/.*", 17 | "node_modules", 18 | "bower_components", 19 | "test", 20 | "tests" 21 | ], 22 | "dependencies" : { 23 | "jsdom": ">=4.0.0", 24 | "marked": ">=0.3.3", 25 | "ansi_up": ">=1.1.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vscode-nbpreviewer 2 | An extension for supercharging your Data Science workflow by previewing Jupyter Notebook within VS Code. View graphs and interact with Plotly visualizations from within VS Code. 3 | 4 |

5 |

6 | logo 7 |

8 | 9 | ## Preview 10 | 11 | >![nbpreviewer demo](https://thumbs.gfycat.com/FarawayTerrificChameleon-max-14mb.gif) 12 | 13 | ## Quick Start 14 | * Install the extension 15 | * Open a Jupyter Notebook 16 | * Click Show Preview menu button from Editor/Title Menu 17 | 18 | 19 | >![nbpreviewer quick start](https://thumbs.gfycat.com/ImaginativeCooperativeDogwoodtwigborer-max-14mb.gif) 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that launches the extension inside a new window 2 | { 3 | "version": "0.1.0", 4 | "configurations": [ 5 | { 6 | "name": "Extension", 7 | "type": "extensionHost", 8 | "request": "launch", 9 | "runtimeExecutable": "${execPath}", 10 | "args": ["--extensionDevelopmentPath=${workspaceRoot}" ], 11 | "stopOnEntry": false 12 | }, 13 | { 14 | "name": "Extension Tests", 15 | "type": "extensionHost", 16 | "request": "launch", 17 | "runtimeExecutable": "${execPath}", 18 | "args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/test" ], 19 | "stopOnEntry": false 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /test/extension.test.js: -------------------------------------------------------------------------------- 1 | /* global suite, test */ 2 | 3 | // 4 | // Note: This example test is leveraging the Mocha test framework. 5 | // Please refer to their documentation on https://mochajs.org/ for help. 6 | // 7 | 8 | // The module 'assert' provides assertion methods from node 9 | const assert = require('assert'); 10 | 11 | // You can import and use all API from the 'vscode' module 12 | // as well as import your extension to test it 13 | const vscode = require('vscode'); 14 | const myExtension = require('../extension'); 15 | 16 | // Defines a Mocha test suite to group tests of similar kind together 17 | suite("Extension Tests", function() { 18 | 19 | // Defines a Mocha unit test 20 | test("Something 1", function() { 21 | assert.equal(-1, [1, 2, 3].indexOf(5)); 22 | assert.equal(-1, [1, 2, 3].indexOf(0)); 23 | }); 24 | }); -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | Please provide a screen shot with your developer console open. Please follow the below steps. 23 | 24 | 1. Click Help > Toggle Developer Tools 25 | 2. Open a Jupyter notebook 26 | 27 | **Desktop (please complete the following information):** 28 | - OS: [e.g. iOS] 29 | - Version [e.g. 22] 30 | 31 | 32 | **Additional context** 33 | Add any other context about the problem here. 34 | -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | // 2 | // PLEASE DO NOT MODIFY / DELETE UNLESS YOU KNOW WHAT YOU ARE DOING 3 | // 4 | // This file is providing the test runner to use when running extension tests. 5 | // By default the test runner in use is Mocha based. 6 | // 7 | // You can provide your own test runner if you want to override it by exporting 8 | // a function run(testRoot: string, clb: (error:Error) => void) that the extension 9 | // host can call to run the tests. The test runner is expected to use console.log 10 | // to report the results back to the caller. When the tests are finished, return 11 | // a possible error to the callback or null if none. 12 | 13 | const testRunner = require('vscode/lib/testrunner'); 14 | 15 | // You can directly control Mocha options by uncommenting the following lines 16 | // See https://github.com/mochajs/mocha/wiki/Using-mocha-programmatically#set-options for more info 17 | testRunner.configure({ 18 | ui: 'tdd', // the TDD UI is being used in extension.test.js (suite, test, etc.) 19 | useColors: true // colored output from test results 20 | }); 21 | 22 | module.exports = testRunner; -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Jithu R Jacob 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/notebookjs/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014, Jeremy Singer-Vine 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | .vscode-test/ 3 | *.vsix 4 | *.mp4 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | 12 | # Runtime data 13 | pids 14 | *.pid 15 | *.seed 16 | *.pid.lock 17 | 18 | # Directory for instrumented libs generated by jscoverage/JSCover 19 | lib-cov 20 | 21 | # Coverage directory used by tools like istanbul 22 | coverage 23 | 24 | # nyc test coverage 25 | .nyc_output 26 | 27 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 28 | .grunt 29 | 30 | # Bower dependency directory (https://bower.io/) 31 | bower_components 32 | 33 | # node-waf configuration 34 | .lock-wscript 35 | 36 | # Compiled binary addons (http://nodejs.org/api/addons.html) 37 | build/Release 38 | 39 | # Dependency directories 40 | node_modules/ 41 | jspm_packages/ 42 | 43 | # Typescript v1 declaration files 44 | typings/ 45 | 46 | # Optional npm cache directory 47 | .npm 48 | 49 | # Optional eslint cache 50 | .eslintcache 51 | 52 | # Optional REPL history 53 | .node_repl_history 54 | 55 | # Output of 'npm pack' 56 | *.tgz 57 | 58 | # Yarn Integrity file 59 | .yarn-integrity 60 | 61 | # dotenv environment variables file 62 | .env 63 | 64 | -------------------------------------------------------------------------------- /static/prism.css: -------------------------------------------------------------------------------- 1 | code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#a67f59;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.function{color:#DD4A68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help} -------------------------------------------------------------------------------- /src/notebookjs/mathjaxutils.min.js: -------------------------------------------------------------------------------- 1 | (function(){var root=this;if(!root.MathJax){return}MathJax.Hub.Config({tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:true,processEnvironments:true},displayAlign:"center","HTML-CSS":{styles:{".MathJax_Display":{margin:0}},linebreaks:{automatic:true}}});MathJax.Hub.Configured();var inline="$";var MATHSPLIT=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[\\{}$]|[{}]|(?:\n\s*)+|@@\d+@@)/i;var process_math=function(i,j,pre_process,math,blocks){var block=blocks.slice(i,j+1).join("").replace(/&/g,"&").replace(//g,">");while(j>i){blocks[j]="";j--}blocks[i]="@@"+math.length+"@@";if(pre_process){block=pre_process(block)}math.push(block);return blocks};var remove_math=function(text){var math=[];var start;var end;var last;var braces;var hasCodeSpans=/`/.test(text),de_tilde;if(hasCodeSpans){text=text.replace(/~/g,"~T").replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm,function(wholematch){return wholematch.replace(/\$/g,"~D")});de_tilde=function(text){return text.replace(/~([TD])/g,function(wholematch,character){return{T:"~",D:"$"}[character]})}}else{de_tilde=function(text){return text}}var blocks=text.replace(/\r\n?/g,"\n").split(MATHSPLIT);for(var i=1,m=blocks.length;i 15 | ``` 16 | 17 | Then parse, render, and (perhaps) append: 18 | 19 | ``` 20 | var notebook = nb.parse(raw_ipynb_json_string); 21 | var rendered = notebook.render(); 22 | document.body.appendChild(rendered); 23 | ``` 24 | 25 | ### IO.js Usage 26 | 27 | *Note: To take advantage of `jsdom`'s latest features/bugfixes, `notebook.js` now runs on [io.js](https://iojs.org/) instead of Node.js.* 28 | 29 | To install: 30 | 31 | ```sh 32 | npm install notebookjs 33 | ``` 34 | 35 | Then parse, render, and write: 36 | 37 | ```js 38 | var fs = require ("fs"); 39 | var nb = require("notebookjs"); 40 | var ipynb = JSON.parse(fs.readFileSync("path/to/notebook.ipynb")); 41 | var notebook = nb.parse(ipynb); 42 | console.log(notebook.render().outerHTML); 43 | ``` 44 | 45 | ## Markdown and ANSI-coloring 46 | 47 | By default, notebook.js supports [marked](https://github.com/chjj/marked) for Markdown rendering, and [ansi_up](https://github.com/drudru/ansi_up) for ANSI-coloring. It does not, however, ship with those libraries, so you must `'; 84 | data += ''; 85 | data += ''; 86 | 87 | data += "" + notebook_html + ""; 88 | data += ''; 89 | 90 | 91 | } catch (error) { 92 | data = "An error occured while converting Notebook to HTML"; 93 | vscode.window.showErrorMessage("An error occured while converting Notebook to HTML"); 94 | console.error("An error occured while converting Notebook to HTML", error); 95 | } 96 | statusBarItem.hide(); 97 | return data; 98 | } 99 | 100 | function generatePreview(panel) { 101 | var html_body = convertDocToHTML(panel); 102 | return ` 103 | 104 | 105 | 106 | 107 | Preview 108 | `+ html_body + ``; 109 | } 110 | 111 | function generateProgressMessage(message) { 112 | return ` 113 | 114 | 115 | 116 | 117 | Preview 118 | `+ message + ``; 119 | } 120 | 121 | function activate(context) { 122 | // Use the console to output diagnostic information (console.log) and errors (console.error) 123 | // This line of code will only be executed once when your extension is activated 124 | console.log('Congratulations, your extension "nbpreviewer" is now active!'); 125 | // The command has been defined in the package.json file 126 | // Now provide the implementation of the command with registerCommand 127 | // The commandId parameter must match the command field in package.json 128 | let disposable = vscode.commands.registerCommand('jupyter.showPreview', async function (obj) { 129 | // The code you place here will be executed every time your command is executed 130 | try { 131 | 132 | // const success = await vscode.commands.executeCommand('vscode.previewHtml', previewUri, vscode.ViewColumn.Two, 'IPython Notebook Preview'); 133 | // Create and show panel 134 | const panel = vscode.window.createWebviewPanel('nbpreviewer', "Jupyter Notebook Previewer", vscode.ViewColumn.One, { enableScripts: true,retainContextWhenHidden: true }); 135 | panel.webview.html = generateProgressMessage("Starting to render Jupyter Notebook"); 136 | // And set its HTML content 137 | panel.webview.html = generatePreview(panel); 138 | console.log("successfully showed notebook"); 139 | } 140 | catch (reason) { 141 | console.error(reason); 142 | vscode.window.showErrorMessage("An error occured while rendering the Notebook"); 143 | } 144 | }); 145 | 146 | context.subscriptions.push(disposable); 147 | } 148 | exports.activate = activate; 149 | 150 | // this method is called when your extension is deactivated 151 | function deactivate() { 152 | } 153 | exports.deactivate = deactivate; -------------------------------------------------------------------------------- /src/notebookjs/mathjaxutils.js: -------------------------------------------------------------------------------- 1 | // Code and comments below largely copied from 2 | // https://github.com/ipython/ipython/blob/master/IPython/html/static/notebook/js/mathjaxutils.js 3 | (function() { 4 | var root = this; 5 | if (!root.MathJax) { return; } 6 | 7 | MathJax.Hub.Config({ 8 | tex2jax: { 9 | inlineMath: [ ['$','$'], ["\\(","\\)"] ], 10 | displayMath: [ ['$$','$$'], ["\\[","\\]"] ], 11 | processEscapes: true, 12 | processEnvironments: true 13 | }, 14 | // Center justify equations in code and markdown cells. Elsewhere 15 | // we use CSS to left justify single line equations in code cells. 16 | displayAlign: 'center', 17 | "HTML-CSS": { 18 | styles: {'.MathJax_Display': {"margin": 0}}, 19 | linebreaks: { automatic: true } 20 | } 21 | }); 22 | 23 | MathJax.Hub.Configured(); 24 | 25 | // Some magic for deferring mathematical expressions to MathJax 26 | // by hiding them from the Markdown parser. 27 | // Some of the code here is adapted with permission from Davide Cervone 28 | // under the terms of the Apache2 license governing the MathJax project. 29 | // Other minor modifications are also due to StackExchange and are used with 30 | // permission. 31 | 32 | var inline = "$"; // the inline math delimiter 33 | 34 | // MATHSPLIT contains the pattern for math delimiters and special symbols 35 | // needed for searching for math in the text input. 36 | var MATHSPLIT = /(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[\\{}$]|[{}]|(?:\n\s*)+|@@\d+@@)/i; 37 | 38 | // The math is in blocks i through j, so 39 | // collect it into one block and clear the others. 40 | // Replace &, <, and > by named entities. 41 | // For IE, put
at the ends of comments since IE removes \n. 42 | // Clear the current math positions and store the index of the 43 | // math, then push the math string onto the storage array. 44 | // The preProcess function is called on all blocks if it has been passed in 45 | var process_math = function (i, j, pre_process, math, blocks) { 46 | var block = blocks.slice(i, j + 1).join("").replace(/&/g, "&") // use HTML entity for & 47 | .replace(//g, ">") // use HTML entity for > 49 | ; 50 | while (j > i) { 51 | blocks[j] = ""; 52 | j--; 53 | } 54 | blocks[i] = "@@" + math.length + "@@"; // replace the current block text with a unique tag to find later 55 | if (pre_process){ 56 | block = pre_process(block); 57 | } 58 | math.push(block); 59 | return blocks; 60 | }; 61 | 62 | // Break up the text into its component parts and search 63 | // through them for math delimiters, braces, linebreaks, etc. 64 | // Math delimiters must match and braces must balance. 65 | // Don't allow math to pass through a double linebreak 66 | // (which will be a paragraph). 67 | // 68 | var remove_math = function (text) { 69 | var math = []; // stores math strings for later 70 | var start; 71 | var end; 72 | var last; 73 | var braces; 74 | 75 | // Except for extreme edge cases, this should catch precisely those pieces of the markdown 76 | // source that will later be turned into code spans. While MathJax will not TeXify code spans, 77 | // we still have to consider them at this point; the following issue has happened several times: 78 | // 79 | // `$foo` and `$bar` are varibales. --> $foo ` and `$bar are variables. 80 | 81 | var hasCodeSpans = /`/.test(text), 82 | de_tilde; 83 | if (hasCodeSpans) { 84 | text = text.replace(/~/g, "~T").replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm, function (wholematch) { 85 | return wholematch.replace(/\$/g, "~D"); 86 | }); 87 | de_tilde = function (text) { 88 | return text.replace(/~([TD])/g, function (wholematch, character) { 89 | return { T: "~", D: "$" }[character]; 90 | }); 91 | }; 92 | } else { 93 | de_tilde = function (text) { return text; }; 94 | } 95 | 96 | var blocks = text.replace(/\r\n?/g, "\n").split(MATHSPLIT); 97 | 98 | for (var i = 1, m = blocks.length; i < m; i += 2) { 99 | var block = blocks[i]; 100 | if (block.charAt(0) === "@") { 101 | // 102 | // Things that look like our math markers will get 103 | // stored and then retrieved along with the math. 104 | // 105 | blocks[i] = "@@" + math.length + "@@"; 106 | math.push(block); 107 | } 108 | else if (start) { 109 | // 110 | // If we are in math, look for the end delimiter, 111 | // but don't go past double line breaks, and 112 | // and balance braces within the math. 113 | // 114 | if (block === end) { 115 | if (braces) { 116 | last = i; 117 | } 118 | else { 119 | blocks = process_math(start, i, de_tilde, math, blocks); 120 | start = null; 121 | end = null; 122 | last = null; 123 | } 124 | } 125 | else if (block.match(/\n.*\n/)) { 126 | if (last) { 127 | i = last; 128 | blocks = process_math(start, i, de_tilde, math, blocks); 129 | } 130 | start = null; 131 | end = null; 132 | last = null; 133 | braces = 0; 134 | } 135 | else if (block === "{") { 136 | braces++; 137 | } 138 | else if (block === "}" && braces) { 139 | braces--; 140 | } 141 | } 142 | else { 143 | // 144 | // Look for math start delimiters and when 145 | // found, set up the end delimiter. 146 | // 147 | if (block === inline || block === "$$") { 148 | start = i; 149 | end = block; 150 | braces = 0; 151 | } 152 | else if (block.substr(1, 5) === "begin") { 153 | start = i; 154 | end = "\\end" + block.substr(6); 155 | braces = 0; 156 | } 157 | } 158 | } 159 | if (last) { 160 | blocks = process_math(start, last, de_tilde, math, blocks); 161 | start = null; 162 | end = null; 163 | last = null; 164 | } 165 | return [de_tilde(blocks.join("")), math]; 166 | }; 167 | 168 | // 169 | // Put back the math strings that were saved, 170 | // and clear the math array (no need to keep it around). 171 | // 172 | var replace_math = function (text, math) { 173 | text = text.replace(/@@(\d+)@@/g, function (match, n) { 174 | return math[n]; 175 | }); 176 | return text; 177 | }; 178 | 179 | root.mathjaxutils = { 180 | remove_math: remove_math, 181 | replace_math: replace_math 182 | }; 183 | 184 | }).call(this); 185 | -------------------------------------------------------------------------------- /src/notebookjs/notebook.js: -------------------------------------------------------------------------------- 1 | // notebook.js 0.2.7 2 | // http://github.com/jsvine/notebookjs 3 | // notebook.js may be freely distributed under the MIT license. 4 | (function () { 5 | var root = this; 6 | var VERSION = "0.2.7"; 7 | 8 | // Get browser or JSDOM document 9 | // var doc = root.document || require("jsdom").jsdom(); 10 | 11 | // https://github.com/jsvine/notebookjs/issues/13 12 | // Have to use local copy till this is resolved 13 | var jsdom = require('jsdom'); 14 | const { JSDOM } = jsdom; 15 | 16 | const { document } = (new JSDOM('')).window; 17 | var doc = root.document || document; 18 | 19 | // Helper functions 20 | var ident = function (x) { return x; }; 21 | 22 | var makeElement = function (tag, classNames) { 23 | var el = doc.createElement(tag); 24 | el.className = (classNames || []).map(function (cn) { 25 | return nb.prefix + cn; 26 | }).join(" "); 27 | return el; 28 | }; 29 | 30 | var escapeHTML = function (raw) { 31 | var replaced = raw 32 | .replace(//g, ">"); 34 | return replaced; 35 | }; 36 | 37 | var joinText = function (text) { 38 | if (text.join) { 39 | return text.map(joinText).join(""); 40 | } else { 41 | return text; 42 | } 43 | }; 44 | 45 | // Get supporting libraries 46 | var condRequire = function (module_name) { 47 | return typeof require === "function" && require(module_name); 48 | }; 49 | 50 | var getMarkdown = function () { 51 | return root.marked || condRequire("marked"); 52 | }; 53 | 54 | var getAnsi = function () { 55 | var req = condRequire("ansi_up"); 56 | var lib = root.ansi_up || req; 57 | return lib && lib.ansi_to_html; 58 | }; 59 | 60 | // Set up `nb` namespace 61 | var nb = { 62 | prefix: "nb-", 63 | markdown: getMarkdown() || ident, 64 | ansi: getAnsi() || ident, 65 | VERSION: VERSION 66 | }; 67 | 68 | // Inputs 69 | nb.Input = function (raw, cell) { 70 | this.raw = raw; 71 | this.cell = cell; 72 | }; 73 | 74 | nb.Input.prototype.render = function () { 75 | if (!this.raw.length) { return makeElement("div"); } 76 | var holder = makeElement("div", [ "input" ]); 77 | var cell = this.cell; 78 | if (typeof cell.number === "number") { 79 | holder.setAttribute("data-prompt-number", this.cell.number); 80 | } 81 | var pre_el = makeElement("pre"); 82 | var code_el = makeElement("code"); 83 | var notebook = cell.worksheet.notebook; 84 | var m = notebook.metadata; 85 | var lang = "none"; 86 | if (m.language_info !== undefined && this.cell.raw.language !== undefined ) { 87 | lang = this.cell.raw.language || m.language || m.language_info.name || undefined; 88 | } 89 | code_el.setAttribute("data-language", lang); 90 | code_el.className = "lang-" + lang; 91 | code_el.innerHTML = escapeHTML(joinText(this.raw)); 92 | pre_el.appendChild(code_el); 93 | holder.appendChild(pre_el); 94 | this.el = holder; 95 | return holder; 96 | }; 97 | 98 | // Outputs and output-renderers 99 | var imageCreator = function (format) { 100 | return function (data) { 101 | var el = makeElement("img", [ "image-output" ]); 102 | el.src = "data:image/" + format + ";base64," + joinText(data).replace(/\n/g, ""); 103 | return el; 104 | }; 105 | }; 106 | 107 | nb.display = {}; 108 | nb.display.text = function (text) { 109 | var el = makeElement("pre", [ "text-output" ]); 110 | el.innerHTML = escapeHTML(joinText(text)); 111 | return el; 112 | }; 113 | nb.display["text/plain"] = nb.display.text; 114 | 115 | nb.display.html = function (html) { 116 | var el = makeElement("div", [ "html-output" ]); 117 | el.innerHTML = joinText(html); 118 | return el; 119 | }; 120 | nb.display["text/html"] = nb.display.html; 121 | 122 | nb.display.marked = function(md) { 123 | return nb.display.html(nb.markdown(joinText(md))); 124 | }; 125 | nb.display["text/markdown"] = nb.display.marked; 126 | 127 | nb.display.svg = function (svg) { 128 | var el = makeElement("div", [ "svg-output" ]); 129 | el.innerHTML = joinText(svg); 130 | return el; 131 | }; 132 | nb.display["text/svg+xml"] = nb.display.svg; 133 | 134 | nb.display.latex = function (latex) { 135 | var el = makeElement("div", [ "latex-output" ]); 136 | el.innerHTML = joinText(latex); 137 | return el; 138 | }; 139 | nb.display["text/latex"] = nb.display.latex; 140 | 141 | nb.display.javascript = function (js) { 142 | var el = makeElement("script"); 143 | el.innerHTML = joinText(js); 144 | return el; 145 | }; 146 | nb.display["application/javascript"] = nb.display.javascript; 147 | 148 | nb.display.png = imageCreator("png"); 149 | nb.display["image/png"] = nb.display.png; 150 | nb.display.jpeg = imageCreator("jpeg"); 151 | nb.display["image/jpeg"] = nb.display.jpeg; 152 | 153 | nb.display_priority = [ 154 | "png", "image/png", "jpeg", "image/jpeg", 155 | "svg", "text/svg+xml", "html", "text/html", 156 | "text/markdown", "latex", "text/latex", 157 | "javascript", "application/javascript", 158 | "text", "text/plain" 159 | ]; 160 | 161 | var render_display_data = function () { 162 | var o = this; 163 | var formats = nb.display_priority.filter(function (d) { 164 | return o.raw.data ? o.raw.data[d] : o.raw[d]; 165 | }); 166 | var format = formats[0]; 167 | if (format) { 168 | if (nb.display[format]) { 169 | return nb.display[format](o.raw[format] || o.raw.data[format]); 170 | } 171 | } 172 | return makeElement("div", [ "empty-output" ]); 173 | }; 174 | 175 | var render_error = function () { 176 | var el = makeElement("pre", [ "pyerr" ]); 177 | var raw = this.raw.traceback.join("\n"); 178 | el.innerHTML = nb.ansi(escapeHTML(raw)); 179 | return el; 180 | }; 181 | 182 | nb.Output = function (raw, cell) { 183 | this.raw = raw; 184 | this.cell = cell; 185 | this.type = raw.output_type; 186 | }; 187 | 188 | nb.Output.prototype.renderers = { 189 | "display_data": render_display_data, 190 | "execute_result": render_display_data, 191 | "pyout": render_display_data, 192 | "pyerr": render_error, 193 | "error": render_error, 194 | "stream": function () { 195 | var el = makeElement("pre", [ (this.raw.stream || this.raw.name) ]); 196 | var raw = joinText(this.raw.text); 197 | el.innerHTML = nb.ansi(escapeHTML(raw)); 198 | return el; 199 | } 200 | }; 201 | 202 | nb.Output.prototype.render = function () { 203 | var outer = makeElement("div", [ "output" ]); 204 | if (typeof this.cell.number === "number") { 205 | outer.setAttribute("data-prompt-number", this.cell.number); 206 | } 207 | var inner = this.renderers[this.type].call(this); 208 | outer.appendChild(inner); 209 | this.el = outer; 210 | return outer; 211 | }; 212 | 213 | // Post-processing 214 | nb.coalesceStreams = function (outputs) { 215 | if (!outputs.length) { return outputs; } 216 | var last = outputs[0]; 217 | var new_outputs = [ last ]; 218 | outputs.slice(1).forEach(function (o) { 219 | if (o.raw.output_type === "stream" && 220 | last.raw.output_type === "stream" && 221 | o.raw.stream === last.raw.stream) { 222 | last.raw.text = last.raw.text.concat(o.raw.text); 223 | } else { 224 | new_outputs.push(o); 225 | last = o; 226 | } 227 | }); 228 | return new_outputs; 229 | }; 230 | 231 | // Cells 232 | nb.Cell = function (raw, worksheet) { 233 | var cell = this; 234 | cell.raw = raw; 235 | cell.worksheet = worksheet; 236 | cell.type = raw.cell_type; 237 | if (cell.type === "code") { 238 | cell.number = raw.prompt_number > -1 ? raw.prompt_number : raw.execution_count; 239 | var source = raw.input || [ raw.source ]; 240 | cell.input = new nb.Input(source, cell); 241 | var raw_outputs = (cell.raw.outputs || []).map(function (o) { 242 | return new nb.Output(o, cell); 243 | }); 244 | cell.outputs = nb.coalesceStreams(raw_outputs); 245 | } 246 | }; 247 | 248 | nb.Cell.prototype.renderers = { 249 | markdown: function () { 250 | var el = makeElement("div", [ "cell", "markdown-cell" ]); 251 | el.innerHTML = nb.markdown(joinText(this.raw.source)); 252 | return el; 253 | }, 254 | heading: function () { 255 | var el = makeElement("h" + this.raw.level, [ "cell", "heading-cell" ]); 256 | el.innerHTML = joinText(this.raw.source); 257 | return el; 258 | }, 259 | raw: function () { 260 | var el = makeElement("div", [ "cell", "raw-cell" ]); 261 | el.innerHTML = joinText(this.raw.source); 262 | return el; 263 | }, 264 | code: function () { 265 | var cell_el = makeElement("div", [ "cell", "code-cell" ]); 266 | cell_el.appendChild(this.input.render()); 267 | var output_els = this.outputs.forEach(function (o) { 268 | cell_el.appendChild(o.render()); 269 | }); 270 | return cell_el; 271 | } 272 | }; 273 | 274 | nb.Cell.prototype.render = function () { 275 | var el = this.renderers[this.type].call(this); 276 | this.el = el; 277 | return el; 278 | }; 279 | 280 | // Worksheets 281 | nb.Worksheet = function (raw, notebook) { 282 | var worksheet = this; 283 | this.raw = raw; 284 | this.notebook = notebook; 285 | this.cells = raw.cells.map(function (c) { 286 | return new nb.Cell(c, worksheet); 287 | }); 288 | this.render = function () { 289 | var worksheet_el = makeElement("div", [ "worksheet" ]); 290 | worksheet.cells.forEach(function (c) { 291 | worksheet_el.appendChild(c.render()); 292 | }); 293 | this.el = worksheet_el; 294 | return worksheet_el; 295 | }; 296 | }; 297 | 298 | // Notebooks 299 | nb.Notebook = function (raw, config) { 300 | var notebook = this; 301 | this.raw = raw; 302 | this.config = config; 303 | var meta = this.metadata = raw.metadata; 304 | this.title = meta.title || meta.name; 305 | var _worksheets = raw.worksheets || [ { cells: raw.cells } ]; 306 | this.worksheets = _worksheets.map(function (ws) { 307 | return new nb.Worksheet(ws, notebook); 308 | }); 309 | this.sheet = this.worksheets[0]; 310 | }; 311 | 312 | nb.Notebook.prototype.render = function () { 313 | var notebook_el = makeElement("div", [ "notebook" ]); 314 | this.worksheets.forEach(function (w) { 315 | notebook_el.appendChild(w.render()); 316 | }); 317 | this.el = notebook_el; 318 | return notebook_el; 319 | }; 320 | 321 | nb.parse = function (nbjson, config) { 322 | return new nb.Notebook(nbjson, config); 323 | }; 324 | 325 | // Exports 326 | if (typeof define === 'function' && define.amd) { 327 | define(function() { 328 | return nb; 329 | }); 330 | } 331 | if (typeof exports !== 'undefined') { 332 | if (typeof module !== 'undefined' && module.exports) { 333 | exports = module.exports = nb; 334 | } 335 | exports.nb = nb; 336 | } else { 337 | root.nb = nb; 338 | } 339 | 340 | }).call(this); 341 | -------------------------------------------------------------------------------- /static/require.js: -------------------------------------------------------------------------------- 1 | /** vim: et:ts=4:sw=4:sts=4 2 | * @license RequireJS 2.3.5 Copyright jQuery Foundation and other contributors. 3 | * Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE 4 | */ 5 | var requirejs,require,define;!function(global,setTimeout){function commentReplace(e,t){return t||""}function isFunction(e){return"[object Function]"===ostring.call(e)}function isArray(e){return"[object Array]"===ostring.call(e)}function each(e,t){if(e){var i;for(i=0;i-1&&(!e[i]||!t(e[i],i,e));i-=1);}}function hasProp(e,t){return hasOwn.call(e,t)}function getOwn(e,t){return hasProp(e,t)&&e[t]}function eachProp(e,t){var i;for(i in e)if(hasProp(e,i)&&t(e[i],i))break}function mixin(e,t,i,r){return t&&eachProp(t,function(t,n){!i&&hasProp(e,n)||(!r||"object"!=typeof t||!t||isArray(t)||isFunction(t)||t instanceof RegExp?e[n]=t:(e[n]||(e[n]={}),mixin(e[n],t,i,r)))}),e}function bind(e,t){return function(){return t.apply(e,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(e){throw e}function getGlobal(e){if(!e)return e;var t=global;return each(e.split("."),function(e){t=t[e]}),t}function makeError(e,t,i,r){var n=new Error(t+"\nhttp://requirejs.org/docs/errors.html#"+e);return n.requireType=e,n.requireModules=r,i&&(n.originalError=i),n}function newContext(e){function t(e){var t,i;for(t=0;t0&&(e.splice(t-1,2),t-=2)}}function i(e,i,r){var n,o,a,s,u,c,d,p,f,l,h=i&&i.split("/"),m=y.map,g=m&&m["*"];if(e&&(c=(e=e.split("/")).length-1,y.nodeIdCompat&&jsSuffixRegExp.test(e[c])&&(e[c]=e[c].replace(jsSuffixRegExp,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),t(e),e=e.join("/")),r&&m&&(h||g)){e:for(a=(o=e.split("/")).length;a>0;a-=1){if(u=o.slice(0,a).join("/"),h)for(s=h.length;s>0;s-=1)if((n=getOwn(m,h.slice(0,s).join("/")))&&(n=getOwn(n,u))){d=n,p=a;break e}!f&&g&&getOwn(g,u)&&(f=getOwn(g,u),l=a)}!d&&f&&(d=f,p=l),d&&(o.splice(0,p,d),e=o.join("/"))}return getOwn(y.pkgs,e)||e}function r(e){isBrowser&&each(scripts(),function(t){if(t.getAttribute("data-requiremodule")===e&&t.getAttribute("data-requirecontext")===q.contextName)return t.parentNode.removeChild(t),!0})}function n(e){var t=getOwn(y.paths,e);if(t&&isArray(t)&&t.length>1)return t.shift(),q.require.undef(e),q.makeRequire(null,{skipMap:!0})([e]),!0}function o(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function a(e,t,r,n){var a,s,u,c,d=null,p=t?t.name:null,f=e,l=!0,h="";return e||(l=!1,e="_@r"+(T+=1)),c=o(e),d=c[0],e=c[1],d&&(d=i(d,p,n),s=getOwn(j,d)),e&&(d?h=r?e:s&&s.normalize?s.normalize(e,function(e){return i(e,p,n)}):-1===e.indexOf("!")?i(e,p,n):e:(d=(c=o(h=i(e,p,n)))[0],h=c[1],r=!0,a=q.nameToUrl(h))),u=!d||s||r?"":"_unnormalized"+(A+=1),{prefix:d,name:h,parentMap:t,unnormalized:!!u,url:a,originalName:f,isDefine:l,id:(d?d+"!"+h:h)+u}}function s(e){var t=e.id,i=getOwn(S,t);return i||(i=S[t]=new q.Module(e)),i}function u(e,t,i){var r=e.id,n=getOwn(S,r);!hasProp(j,r)||n&&!n.defineEmitComplete?(n=s(e)).error&&"error"===t?i(n.error):n.on(t,i):"defined"===t&&i(j[r])}function c(e,t){var i=e.requireModules,r=!1;t?t(e):(each(i,function(t){var i=getOwn(S,t);i&&(i.error=e,i.events.error&&(r=!0,i.emit("error",e)))}),r||req.onError(e))}function d(){globalDefQueue.length&&(each(globalDefQueue,function(e){var t=e[0];"string"==typeof t&&(q.defQueueMap[t]=!0),O.push(e)}),globalDefQueue=[])}function p(e){delete S[e],delete k[e]}function f(e,t,i){var r=e.map.id;e.error?e.emit("error",e.error):(t[r]=!0,each(e.depMaps,function(r,n){var o=r.id,a=getOwn(S,o);!a||e.depMatched[n]||i[o]||(getOwn(t,o)?(e.defineDep(n,j[o]),e.check()):f(a,t,i))}),i[r]=!0)}function l(){var e,t,i=1e3*y.waitSeconds,o=i&&q.startTime+i<(new Date).getTime(),a=[],s=[],u=!1,d=!0;if(!x){if(x=!0,eachProp(k,function(e){var i=e.map,c=i.id;if(e.enabled&&(i.isDefine||s.push(e),!e.error))if(!e.inited&&o)n(c)?(t=!0,u=!0):(a.push(c),r(c));else if(!e.inited&&e.fetched&&i.isDefine&&(u=!0,!i.prefix))return d=!1}),o&&a.length)return e=makeError("timeout","Load timeout for modules: "+a,null,a),e.contextName=q.contextName,c(e);d&&each(s,function(e){f(e,{},{})}),o&&!t||!u||!isBrowser&&!isWebWorker||w||(w=setTimeout(function(){w=0,l()},50)),x=!1}}function h(e){hasProp(j,e[0])||s(a(e[0],null,!0)).init(e[1],e[2])}function m(e,t,i,r){e.detachEvent&&!isOpera?r&&e.detachEvent(r,t):e.removeEventListener(i,t,!1)}function g(e){var t=e.currentTarget||e.srcElement;return m(t,q.onScriptLoad,"load","onreadystatechange"),m(t,q.onScriptError,"error"),{node:t,id:t&&t.getAttribute("data-requiremodule")}}function v(){var e;for(d();O.length;){if(null===(e=O.shift())[0])return c(makeError("mismatch","Mismatched anonymous define() module: "+e[e.length-1]));h(e)}q.defQueueMap={}}var x,b,q,E,w,y={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},S={},k={},M={},O=[],j={},P={},R={},T=1,A=1;return E={require:function(e){return e.require?e.require:e.require=q.makeRequire(e.map)},exports:function(e){if(e.usingExports=!0,e.map.isDefine)return e.exports?j[e.map.id]=e.exports:e.exports=j[e.map.id]={}},module:function(e){return e.module?e.module:e.module={id:e.map.id,uri:e.map.url,config:function(){return getOwn(y.config,e.map.id)||{}},exports:e.exports||(e.exports={})}}},b=function(e){this.events=getOwn(M,e.id)||{},this.map=e,this.shim=getOwn(y.shim,e.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},b.prototype={init:function(e,t,i,r){r=r||{},this.inited||(this.factory=t,i?this.on("error",i):this.events.error&&(i=bind(this,function(e){this.emit("error",e)})),this.depMaps=e&&e.slice(0),this.errback=i,this.inited=!0,this.ignore=r.ignore,r.enabled||this.enabled?this.enable():this.check())},defineDep:function(e,t){this.depMatched[e]||(this.depMatched[e]=!0,this.depCount-=1,this.depExports[e]=t)},fetch:function(){if(!this.fetched){this.fetched=!0,q.startTime=(new Date).getTime();var e=this.map;if(!this.shim)return e.prefix?this.callPlugin():this.load();q.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return e.prefix?this.callPlugin():this.load()}))}},load:function(){var e=this.map.url;P[e]||(P[e]=!0,q.load(this.map.id,e))},check:function(){if(this.enabled&&!this.enabling){var e,t,i=this.map.id,r=this.depExports,n=this.exports,o=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(o)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{n=q.execCb(i,o,r,n)}catch(t){e=t}else n=q.execCb(i,o,r,n);if(this.map.isDefine&&void 0===n&&((t=this.module)?n=t.exports:this.usingExports&&(n=this.exports)),e)return e.requireMap=this.map,e.requireModules=this.map.isDefine?[this.map.id]:null,e.requireType=this.map.isDefine?"define":"require",c(this.error=e)}else n=o;if(this.exports=n,this.map.isDefine&&!this.ignore&&(j[i]=n,req.onResourceLoad)){var a=[];each(this.depMaps,function(e){a.push(e.normalizedMap||e)}),req.onResourceLoad(q,this.map,a)}p(i),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(q.defQueueMap,i)||this.fetch()}},callPlugin:function(){var e=this.map,t=e.id,r=a(e.prefix);this.depMaps.push(r),u(r,"defined",bind(this,function(r){var n,o,d,f=getOwn(R,this.map.id),l=this.map.name,h=this.map.parentMap?this.map.parentMap.name:null,m=q.makeRequire(e.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(r.normalize&&(l=r.normalize(l,function(e){return i(e,h,!0)})||""),o=a(e.prefix+"!"+l,this.map.parentMap,!0),u(o,"defined",bind(this,function(e){this.map.normalizedMap=o,this.init([],function(){return e},null,{enabled:!0,ignore:!0})})),void((d=getOwn(S,o.id))&&(this.depMaps.push(o),this.events.error&&d.on("error",bind(this,function(e){this.emit("error",e)})),d.enable()))):f?(this.map.url=q.nameToUrl(f),void this.load()):((n=bind(this,function(e){this.init([],function(){return e},null,{enabled:!0})})).error=bind(this,function(e){this.inited=!0,this.error=e,e.requireModules=[t],eachProp(S,function(e){0===e.map.id.indexOf(t+"_unnormalized")&&p(e.map.id)}),c(e)}),n.fromText=bind(this,function(i,r){var o=e.name,u=a(o),d=useInteractive;r&&(i=r),d&&(useInteractive=!1),s(u),hasProp(y.config,t)&&(y.config[o]=y.config[t]);try{req.exec(i)}catch(e){return c(makeError("fromtexteval","fromText eval for "+t+" failed: "+e,e,[t]))}d&&(useInteractive=!0),this.depMaps.push(u),q.completeLoad(o),m([o],n)}),void r.load(e.name,m,n,y))})),q.enable(r,this),this.pluginMaps[r.id]=r},enable:function(){k[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(e,t){var i,r,n;if("string"==typeof e){if(e=a(e,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[t]=e,n=getOwn(E,e.id))return void(this.depExports[t]=n(this));this.depCount+=1,u(e,"defined",bind(this,function(e){this.undefed||(this.defineDep(t,e),this.check())})),this.errback?u(e,"error",bind(this,this.errback)):this.events.error&&u(e,"error",bind(this,function(e){this.emit("error",e)}))}i=e.id,r=S[i],hasProp(E,i)||!r||r.enabled||q.enable(e,this)})),eachProp(this.pluginMaps,bind(this,function(e){var t=getOwn(S,e.id);t&&!t.enabled&&q.enable(e,this)})),this.enabling=!1,this.check()},on:function(e,t){var i=this.events[e];i||(i=this.events[e]=[]),i.push(t)},emit:function(e,t){each(this.events[e],function(e){e(t)}),"error"===e&&delete this.events[e]}},q={config:y,contextName:e,registry:S,defined:j,urlFetched:P,defQueue:O,defQueueMap:{},Module:b,makeModuleMap:a,nextTick:req.nextTick,onError:c,configure:function(e){if(e.baseUrl&&"/"!==e.baseUrl.charAt(e.baseUrl.length-1)&&(e.baseUrl+="/"),"string"==typeof e.urlArgs){var t=e.urlArgs;e.urlArgs=function(e,i){return(-1===i.indexOf("?")?"?":"&")+t}}var i=y.shim,r={paths:!0,bundles:!0,config:!0,map:!0};eachProp(e,function(e,t){r[t]?(y[t]||(y[t]={}),mixin(y[t],e,!0,!0)):y[t]=e}),e.bundles&&eachProp(e.bundles,function(e,t){each(e,function(e){e!==t&&(R[e]=t)})}),e.shim&&(eachProp(e.shim,function(e,t){isArray(e)&&(e={deps:e}),!e.exports&&!e.init||e.exportsFn||(e.exportsFn=q.makeShimExports(e)),i[t]=e}),y.shim=i),e.packages&&each(e.packages,function(e){var t;t=(e="string"==typeof e?{name:e}:e).name,e.location&&(y.paths[t]=e.location),y.pkgs[t]=e.name+"/"+(e.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(S,function(e,t){e.inited||e.map.unnormalized||(e.map=a(t,null,!0))}),(e.deps||e.callback)&&q.require(e.deps||[],e.callback)},makeShimExports:function(e){return function(){var t;return e.init&&(t=e.init.apply(global,arguments)),t||e.exports&&getGlobal(e.exports)}},makeRequire:function(t,n){function o(i,r,u){var d,p,f;return n.enableBuildCallback&&r&&isFunction(r)&&(r.__requireJsBuild=!0),"string"==typeof i?isFunction(r)?c(makeError("requireargs","Invalid require call"),u):t&&hasProp(E,i)?E[i](S[t.id]):req.get?req.get(q,i,t,o):(p=a(i,t,!1,!0),d=p.id,hasProp(j,d)?j[d]:c(makeError("notloaded",'Module name "'+d+'" has not been loaded yet for context: '+e+(t?"":". Use require([])")))):(v(),q.nextTick(function(){v(),(f=s(a(null,t))).skipMap=n.skipMap,f.init(i,r,u,{enabled:!0}),l()}),o)}return n=n||{},mixin(o,{isBrowser:isBrowser,toUrl:function(e){var r,n=e.lastIndexOf("."),o=e.split("/")[0],a="."===o||".."===o;return-1!==n&&(!a||n>1)&&(r=e.substring(n,e.length),e=e.substring(0,n)),q.nameToUrl(i(e,t&&t.id,!0),r,!0)},defined:function(e){return hasProp(j,a(e,t,!1,!0).id)},specified:function(e){return e=a(e,t,!1,!0).id,hasProp(j,e)||hasProp(S,e)}}),t||(o.undef=function(e){d();var i=a(e,t,!0),n=getOwn(S,e);n.undefed=!0,r(e),delete j[e],delete P[i.url],delete M[e],eachReverse(O,function(t,i){t[0]===e&&O.splice(i,1)}),delete q.defQueueMap[e],n&&(n.events.defined&&(M[e]=n.events),p(e))}),o},enable:function(e){getOwn(S,e.id)&&s(e).enable()},completeLoad:function(e){var t,i,r,o=getOwn(y.shim,e)||{},a=o.exports;for(d();O.length;){if(null===(i=O.shift())[0]){if(i[0]=e,t)break;t=!0}else i[0]===e&&(t=!0);h(i)}if(q.defQueueMap={},r=getOwn(S,e),!t&&!hasProp(j,e)&&r&&!r.inited){if(!(!y.enforceDefine||a&&getGlobal(a)))return n(e)?void 0:c(makeError("nodefine","No define call for "+e,null,[e]));h([e,o.deps||[],o.exportsFn])}l()},nameToUrl:function(e,t,i){var r,n,o,a,s,u,c,d=getOwn(y.pkgs,e);if(d&&(e=d),c=getOwn(R,e))return q.nameToUrl(c,t,i);if(req.jsExtRegExp.test(e))s=e+(t||"");else{for(r=y.paths,o=(n=e.split("/")).length;o>0;o-=1)if(a=n.slice(0,o).join("/"),u=getOwn(r,a)){isArray(u)&&(u=u[0]),n.splice(0,o,u);break}s=n.join("/"),s=("/"===(s+=t||(/^data\:|^blob\:|\?/.test(s)||i?"":".js")).charAt(0)||s.match(/^[\w\+\.\-]+:/)?"":y.baseUrl)+s}return y.urlArgs&&!/^blob\:/.test(s)?s+y.urlArgs(e,s):s},load:function(e,t){req.load(q,e,t)},execCb:function(e,t,i,r){return t.apply(r,i)},onScriptLoad:function(e){if("load"===e.type||readyRegExp.test((e.currentTarget||e.srcElement).readyState)){interactiveScript=null;var t=g(e);q.completeLoad(t.id)}},onScriptError:function(e){var t=g(e);if(!n(t.id)){var i=[];return eachProp(S,function(e,r){0!==r.indexOf("_@r")&&each(e.depMaps,function(e){if(e.id===t.id)return i.push(r),!0})}),c(makeError("scripterror",'Script error for "'+t.id+(i.length?'", needed by: '+i.join(", "):'"'),e,[t.id]))}}},q.require=q.makeRequire(),q}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(e){if("interactive"===e.readyState)return interactiveScript=e}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.5",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(e,t,i,r){var n,o,a=defContextName;return isArray(e)||"string"==typeof e||(o=e,isArray(t)?(e=t,t=i,i=r):e=[]),o&&o.context&&(a=o.context),(n=getOwn(contexts,a))||(n=contexts[a]=req.s.newContext(a)),o&&n.configure(o),n.require(e,t,i)},req.config=function(e){return req(e)},req.nextTick=void 0!==setTimeout?function(e){setTimeout(e,4)}:function(e){e()},require||(require=req),req.version=version,req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(e){req[e]=function(){var t=contexts[defContextName];return t.require[e].apply(t,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],(baseElement=document.getElementsByTagName("base")[0])&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(e,t,i){var r=e.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return r.type=e.scriptType||"text/javascript",r.charset="utf-8",r.async=!0,r},req.load=function(e,t,i){var r,n=e&&e.config||{};if(isBrowser)return(r=req.createNode(n,t,i)).setAttribute("data-requirecontext",e.contextName),r.setAttribute("data-requiremodule",t),!r.attachEvent||r.attachEvent.toString&&r.attachEvent.toString().indexOf("[native code")<0||isOpera?(r.addEventListener("load",e.onScriptLoad,!1),r.addEventListener("error",e.onScriptError,!1)):(useInteractive=!0,r.attachEvent("onreadystatechange",e.onScriptLoad)),r.src=i,n.onNodeCreated&&n.onNodeCreated(r,n,t,i),currentlyAddingScript=r,baseElement?head.insertBefore(r,baseElement):head.appendChild(r),currentlyAddingScript=null,r;if(isWebWorker)try{setTimeout(function(){},0),importScripts(i),e.completeLoad(t)}catch(r){e.onError(makeError("importscripts","importScripts failed for "+t+" at "+i,r,[t]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(e){if(head||(head=e.parentNode),dataMain=e.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||-1!==mainScript.indexOf("!")||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(e,t,i){var r,n;"string"!=typeof e&&(i=t,t=e,e=null),isArray(t)||(i=t,t=null),!t&&isFunction(i)&&(t=[],i.length&&(i.toString().replace(commentRegExp,commentReplace).replace(cjsRequireRegExp,function(e,i){t.push(i)}),t=(1===i.length?["require"]:["require","exports","module"]).concat(t))),useInteractive&&(r=currentlyAddingScript||getInteractiveScript())&&(e||(e=r.getAttribute("data-requiremodule")),n=contexts[r.getAttribute("data-requirecontext")]),n?(n.defQueue.push([e,t,i]),n.defQueueMap[e]=!0):globalDefQueue.push([e,t,i])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this,"undefined"==typeof setTimeout?void 0:setTimeout); -------------------------------------------------------------------------------- /static/katex.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important}.katex .katex-mathml{border:0;clip:rect(1px,1px,1px,1px);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathdefault{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer,.katex .sizing{display:inline-block}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .op-limits>.vlist-t{text-align:center}.katex .accent>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{border-right:.05em solid;display:inline-block;margin:0 -.025em;min-width:1px}.katex .mtable .vs-dashed{border-right:.05em dashed}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{display:block;fill:currentColor;fill-opacity:1;fill-rule:nonzero;height:inherit;position:absolute;stroke:currentColor;stroke-dasharray:none;stroke-dashoffset:0;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-width:1;width:100%}.katex svg path{stroke:none}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox{border:.04em solid #000;box-sizing:border-box}.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0} 2 | --------------------------------------------------------------------------------