├── .babelrc ├── .eslintrc.json ├── .gitignore ├── .jsdoc.json ├── CNAME ├── README.md ├── build ├── coverage │ ├── ast.js.html │ ├── base.css │ ├── block-navigation.js │ ├── doc.js.html │ ├── engine.js.html │ ├── guppy.js.html │ ├── index.html │ ├── keyboard.js.html │ ├── lcov.info │ ├── lib │ │ ├── katex │ │ │ ├── index.html │ │ │ └── katex-modified.min.js.html │ │ └── mousetrap │ │ │ ├── index.html │ │ │ └── mousetrap.min.js.html │ ├── parser.js.html │ ├── prettify.css │ ├── prettify.js │ ├── settings.js.html │ ├── sort-arrow-sprite.png │ ├── sorter.js │ ├── src │ │ ├── ast.js.html │ │ ├── doc.js.html │ │ ├── engine.js.html │ │ ├── guppy.js.html │ │ ├── index.html │ │ ├── keyboard.js.html │ │ ├── parser.js.html │ │ ├── settings.js.html │ │ ├── symbols.js.html │ │ ├── utils.js.html │ │ └── version.js.html │ ├── sym │ │ ├── index.html │ │ └── symbols.json.html │ ├── symbols.js.html │ ├── utils.js.html │ └── version.js.html ├── fonts │ ├── KaTeX_AMS-Regular.eot │ ├── KaTeX_AMS-Regular.ttf │ ├── KaTeX_AMS-Regular.woff │ ├── KaTeX_AMS-Regular.woff2 │ ├── KaTeX_Caligraphic-Bold.eot │ ├── KaTeX_Caligraphic-Bold.ttf │ ├── KaTeX_Caligraphic-Bold.woff │ ├── KaTeX_Caligraphic-Bold.woff2 │ ├── KaTeX_Caligraphic-Regular.eot │ ├── KaTeX_Caligraphic-Regular.ttf │ ├── KaTeX_Caligraphic-Regular.woff │ ├── KaTeX_Caligraphic-Regular.woff2 │ ├── KaTeX_Fraktur-Bold.eot │ ├── KaTeX_Fraktur-Bold.ttf │ ├── KaTeX_Fraktur-Bold.woff │ ├── KaTeX_Fraktur-Bold.woff2 │ ├── KaTeX_Fraktur-Regular.eot │ ├── KaTeX_Fraktur-Regular.ttf │ ├── KaTeX_Fraktur-Regular.woff │ ├── KaTeX_Fraktur-Regular.woff2 │ ├── KaTeX_Main-Bold.eot │ ├── KaTeX_Main-Bold.ttf │ ├── KaTeX_Main-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_Main-Regular.woff2 │ ├── KaTeX_Math-BoldItalic.eot │ ├── KaTeX_Math-BoldItalic.ttf │ ├── KaTeX_Math-BoldItalic.woff │ ├── KaTeX_Math-BoldItalic.woff2 │ ├── 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_Math-Regular.woff2 │ ├── KaTeX_SansSerif-Bold.eot │ ├── KaTeX_SansSerif-Bold.ttf │ ├── KaTeX_SansSerif-Bold.woff │ ├── 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_SansSerif-Regular.woff2 │ ├── KaTeX_Script-Regular.eot │ ├── KaTeX_Script-Regular.ttf │ ├── KaTeX_Script-Regular.woff │ ├── KaTeX_Script-Regular.woff2 │ ├── KaTeX_Size1-Regular.eot │ ├── KaTeX_Size1-Regular.ttf │ ├── KaTeX_Size1-Regular.woff │ ├── KaTeX_Size1-Regular.woff2 │ ├── KaTeX_Size2-Regular.eot │ ├── KaTeX_Size2-Regular.ttf │ ├── KaTeX_Size2-Regular.woff │ ├── KaTeX_Size2-Regular.woff2 │ ├── KaTeX_Size3-Regular.eot │ ├── KaTeX_Size3-Regular.ttf │ ├── KaTeX_Size3-Regular.woff │ ├── KaTeX_Size3-Regular.woff2 │ ├── KaTeX_Size4-Regular.eot │ ├── KaTeX_Size4-Regular.ttf │ ├── KaTeX_Size4-Regular.woff │ ├── KaTeX_Size4-Regular.woff2 │ ├── KaTeX_Typewriter-Regular.eot │ ├── KaTeX_Typewriter-Regular.ttf │ ├── KaTeX_Typewriter-Regular.woff │ └── KaTeX_Typewriter-Regular.woff2 ├── guppy-default-osk.min.css ├── guppy-default.min.css ├── guppy-none-osk.min.css ├── guppy-none.min.css ├── guppy-test.js ├── guppy.js ├── guppy.min.js ├── guppy_osk.js ├── guppy_osk.min.js ├── icons │ ├── help.png │ ├── keyboard.png │ ├── settings.png │ └── symbols.png └── package.json ├── deploy.json ├── index.html ├── karma.conf.js ├── lib ├── icons │ ├── help.png │ ├── if_141_Keyboard_183265.png │ ├── if_141_Keyboard_183265.svg │ ├── if_icon-help_211675.png │ ├── if_icon-help_211675.svg │ ├── if_settings_326699.png │ ├── if_settings_326699.svg │ ├── keyboard.png │ ├── settings.png │ └── symbols.png ├── katex │ ├── fonts │ │ ├── KaTeX_AMS-Regular.ttf │ │ ├── KaTeX_AMS-Regular.woff │ │ ├── KaTeX_AMS-Regular.woff2 │ │ ├── KaTeX_Caligraphic-Bold.ttf │ │ ├── KaTeX_Caligraphic-Bold.woff │ │ ├── KaTeX_Caligraphic-Bold.woff2 │ │ ├── KaTeX_Caligraphic-Regular.ttf │ │ ├── KaTeX_Caligraphic-Regular.woff │ │ ├── KaTeX_Caligraphic-Regular.woff2 │ │ ├── KaTeX_Fraktur-Bold.ttf │ │ ├── KaTeX_Fraktur-Bold.woff │ │ ├── KaTeX_Fraktur-Bold.woff2 │ │ ├── KaTeX_Fraktur-Regular.ttf │ │ ├── KaTeX_Fraktur-Regular.woff │ │ ├── KaTeX_Fraktur-Regular.woff2 │ │ ├── KaTeX_Main-Bold.ttf │ │ ├── KaTeX_Main-Bold.woff │ │ ├── KaTeX_Main-Bold.woff2 │ │ ├── KaTeX_Main-BoldItalic.ttf │ │ ├── KaTeX_Main-BoldItalic.woff │ │ ├── KaTeX_Main-BoldItalic.woff2 │ │ ├── KaTeX_Main-Italic.ttf │ │ ├── KaTeX_Main-Italic.woff │ │ ├── KaTeX_Main-Italic.woff2 │ │ ├── KaTeX_Main-Regular.ttf │ │ ├── KaTeX_Main-Regular.woff │ │ ├── KaTeX_Main-Regular.woff2 │ │ ├── KaTeX_Math-BoldItalic.ttf │ │ ├── KaTeX_Math-BoldItalic.woff │ │ ├── KaTeX_Math-BoldItalic.woff2 │ │ ├── KaTeX_Math-Italic.ttf │ │ ├── KaTeX_Math-Italic.woff │ │ ├── KaTeX_Math-Italic.woff2 │ │ ├── KaTeX_SansSerif-Bold.ttf │ │ ├── KaTeX_SansSerif-Bold.woff │ │ ├── KaTeX_SansSerif-Bold.woff2 │ │ ├── KaTeX_SansSerif-Italic.ttf │ │ ├── KaTeX_SansSerif-Italic.woff │ │ ├── KaTeX_SansSerif-Italic.woff2 │ │ ├── KaTeX_SansSerif-Regular.ttf │ │ ├── KaTeX_SansSerif-Regular.woff │ │ ├── KaTeX_SansSerif-Regular.woff2 │ │ ├── KaTeX_Script-Regular.ttf │ │ ├── KaTeX_Script-Regular.woff │ │ ├── KaTeX_Script-Regular.woff2 │ │ ├── KaTeX_Size1-Regular.ttf │ │ ├── KaTeX_Size1-Regular.woff │ │ ├── KaTeX_Size1-Regular.woff2 │ │ ├── KaTeX_Size2-Regular.ttf │ │ ├── KaTeX_Size2-Regular.woff │ │ ├── KaTeX_Size2-Regular.woff2 │ │ ├── KaTeX_Size3-Regular.ttf │ │ ├── KaTeX_Size3-Regular.woff │ │ ├── KaTeX_Size3-Regular.woff2 │ │ ├── KaTeX_Size4-Regular.ttf │ │ ├── KaTeX_Size4-Regular.woff │ │ ├── KaTeX_Size4-Regular.woff2 │ │ ├── KaTeX_Typewriter-Regular.ttf │ │ ├── KaTeX_Typewriter-Regular.woff │ │ └── KaTeX_Typewriter-Regular.woff2 │ ├── katex-modified.min.css │ └── katex-modified.min.js ├── math-expressions │ └── math-expressions.js └── mousetrap │ └── mousetrap.min.js ├── osk_rollup.config.js ├── package-lock.json ├── package.json ├── rollup.config.js ├── site ├── api │ └── guppy-js │ │ ├── 2.0.0-alpha.1 │ │ ├── Doc.html │ │ ├── Engine.html │ │ ├── Guppy.html │ │ ├── GuppyOSK.html │ │ ├── doc.js.html │ │ ├── engine.js.html │ │ ├── guppy.js.html │ │ ├── index.html │ │ ├── osk.js.html │ │ ├── scripts │ │ │ ├── linenumber.js │ │ │ └── prettify │ │ │ │ ├── Apache-License-2.0.txt │ │ │ │ ├── lang-css.js │ │ │ │ └── prettify.js │ │ └── styles │ │ │ ├── jsdoc.css │ │ │ └── prettify.css │ │ ├── 2.0.0-beta.1 │ │ ├── Doc.html │ │ ├── Engine.html │ │ ├── Guppy.html │ │ ├── GuppyOSK.html │ │ ├── doc.js.html │ │ ├── engine.js.html │ │ ├── guppy.js.html │ │ ├── index.html │ │ ├── osk.js.html │ │ ├── scripts │ │ │ ├── linenumber.js │ │ │ └── prettify │ │ │ │ ├── Apache-License-2.0.txt │ │ │ │ ├── lang-css.js │ │ │ │ └── prettify.js │ │ └── styles │ │ │ ├── jsdoc.css │ │ │ └── prettify.css │ │ ├── 2.0.0-beta.3 │ │ ├── Doc.html │ │ ├── Engine.html │ │ ├── Guppy.html │ │ ├── GuppyOSK.html │ │ ├── doc.js.html │ │ ├── engine.js.html │ │ ├── guppy.js.html │ │ ├── index.html │ │ ├── osk.js.html │ │ ├── scripts │ │ │ ├── linenumber.js │ │ │ └── prettify │ │ │ │ ├── Apache-License-2.0.txt │ │ │ │ ├── lang-css.js │ │ │ │ └── prettify.js │ │ └── styles │ │ │ ├── jsdoc.css │ │ │ └── prettify.css │ │ └── 2.0.0-rc.1 │ │ ├── Doc.html │ │ ├── Engine.html │ │ ├── Guppy.html │ │ ├── GuppyOSK.html │ │ ├── doc.js.html │ │ ├── engine.js.html │ │ ├── guppy.js.html │ │ ├── index.html │ │ ├── osk.js.html │ │ ├── scripts │ │ ├── linenumber.js │ │ └── prettify │ │ │ ├── Apache-License-2.0.txt │ │ │ ├── lang-css.js │ │ │ └── prettify.js │ │ └── styles │ │ ├── jsdoc.css │ │ └── prettify.css ├── build.sh ├── contribute │ ├── _src │ │ └── index.html │ └── index.html ├── doc │ ├── _src │ │ ├── faq.md │ │ ├── format.md │ │ ├── index.md │ │ ├── internals.md │ │ ├── quickstart.html │ │ ├── render.md │ │ ├── roadmap.md │ │ ├── script.md │ │ ├── style.md │ │ ├── symbols.md │ │ └── version.md │ ├── faq.html │ ├── format.html │ ├── guides.json │ ├── index.html │ ├── internals.html │ ├── quickstart.html │ ├── render.html │ ├── roadmap.html │ ├── script.html │ ├── style.html │ ├── symbols.html │ └── version.html ├── examples │ ├── _src │ │ └── index.html │ ├── article │ │ ├── article.html │ │ ├── codepen_hash │ │ └── index.html │ ├── basic │ │ ├── basic.html │ │ ├── codepen_hash │ │ └── index.html │ ├── calc │ │ ├── calc.html │ │ ├── codepen_hash │ │ └── index.html │ ├── cubic │ │ └── index.html │ ├── events │ │ ├── codepen_hash │ │ ├── events.html │ │ └── index.html │ ├── graph │ │ ├── codepen_hash │ │ ├── fabric.min.js │ │ ├── graph.html │ │ └── index.html │ ├── import │ │ ├── codepen_hash │ │ ├── import.html │ │ └── index.html │ ├── index.html │ ├── io │ │ ├── codepen_hash │ │ ├── index.html │ │ └── io.html │ ├── osk │ │ └── index.html │ ├── quiz │ │ ├── codepen_hash │ │ ├── index.html │ │ └── quiz.html │ └── template.html ├── index.css ├── index.html ├── index.js ├── style │ ├── guppy.css │ └── osk.css ├── sym │ ├── extra_symbols.json │ └── symbols.json └── template.html ├── src ├── ast.js ├── doc.js ├── engine.js ├── guppy.js ├── keyboard.js ├── osk.js ├── parser.js ├── settings.js ├── symbols.js ├── utils.js └── version.js ├── style ├── guppy.css └── osk.css ├── sym ├── number_theory.json └── symbols.json └── test ├── index.html └── test.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "es2015", 5 | { 6 | "modules": false 7 | } 8 | ] 9 | ], 10 | "plugins": [ 11 | "external-helpers" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | OLD 2 | *~ 3 | \#* 4 | *.pyc 5 | *.tmp 6 | node_modules 7 | *.o 8 | *.so 9 | *.a 10 | -------------------------------------------------------------------------------- /.jsdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "tags": { 3 | "allowUnknownTags": true, 4 | "dictionaries": ["jsdoc"] 5 | }, 6 | "source": { 7 | "include": ["src", "package.json", "README.md"], 8 | "includePattern": ".js$", 9 | "excludePattern": "(node_modules/)" 10 | }, 11 | "plugins": [ 12 | "plugins/markdown" 13 | ], 14 | "templates": { 15 | "cleverLinks": false, 16 | "monospaceLinks": true, 17 | "useLongnameInNav": false, 18 | "showInheritedInNav": true 19 | }, 20 | "opts": { 21 | "destination": "./site/api", 22 | "encoding": "utf8", 23 | "private": true, 24 | "recurse": true, 25 | "template": "./node_modules/docdash", 26 | "package": "deploy.json" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CNAME: -------------------------------------------------------------------------------- 1 | guppy.js.org 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Guppy 2 | 3 | [](https://gitter.im/guppy-mathbox/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) 4 | 5 | ## Synopsis 6 | 7 | Guppy is a Javascript-based WYSIWYG editor for mathematics whose 8 | content is stored in an XML format that makes Guppy mathematical 9 | expressions **searchable**, **parseable**, and **renderable**. 10 | 11 | The content of the editor can easily be extracted in a well-annotated 12 | XML format (for searching), as well as LaTeX (for rendering), plain 13 | text (for text applications) or a syntax tree (for 14 | manipulating/evaluating). 15 | 16 | ## Demos 17 | 18 | A full live demo can be found at 19 | [http://daniel3735928559.github.io/guppy/site](http://daniel3735928559.github.io/guppy/site) 20 | 21 | A standalone basic demo can be found at 22 | [http://daniel3735928559.github.io/guppy/site/examples/basic](http://daniel3735928559.github.io/guppy/site/examples/basic) 23 | 24 | ## How do I get started? 25 | 26 | Go to the [quickstart page](https://daniel3735928559.github.io/guppy/site/doc/quickstart). 27 | 28 | Also check the [FAQ](https://daniel3735928559.github.io/guppy/site/doc/faq.html). 29 | 30 | ## Can I see some examples? 31 | 32 | Yes! There are many at the [examples page](https://daniel3735928559.github.io/guppy/site/examples). 33 | 34 | Of particular note are: 35 | 36 | * [Calc](https://daniel3735928559.github.io/guppy/site/examples/calc) Numerically evaluate a guppy document. 37 | * [Input/Output](https://daniel3735928559.github.io/guppy/site/examples/io) Import and extract editor content. 38 | * [Mobile](https://daniel3735928559.github.io/guppy/site/examples/osk) Activate mobile keyboard functionality. 39 | * [Style](https://daniel3735928559.github.io/guppy/site/doc/style.html) Style the editor with CSS. 40 | * [Article](https://daniel3735928559.github.io/guppy/site/examples/article) Use guppy to render pre-existing mathematical content on a page. 41 | 42 | ## How does it work? 43 | 44 | Editor content is stored in a specific [XML format](https://daniel3735928559.github.io/guppy/site/doc/format.html). 45 | Editing operations then correspond to [operations on that XML](https://daniel3735928559.github.io/guppy/site/doc/internals.html). 46 | 47 | ## Can I help? 48 | 49 | Yes! See the [contributors page](https://daniel3735928559.github.io/guppy/site/contribute) for how, and the 50 | [roadmap](https://daniel3735928559.github.io/guppy/site/doc/roadmap.html) 51 | for an idea of where the project is heading. 52 | 53 | ## License 54 | 55 | Guppy is licensed under the [MIT License](http://opensource.org/licenses/MIT). 56 | -------------------------------------------------------------------------------- /build/coverage/block-navigation.js: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | var jumpToCode = (function init () { 3 | // Classes of code we would like to highlight 4 | var missingCoverageClasses = [ '.cbranch-no', '.cstat-no', '.fstat-no' ]; 5 | 6 | // We don't want to select elements that are direct descendants of another match 7 | var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > ` 8 | 9 | // Selecter that finds elements on the page to which we can jump 10 | var selector = notSelector + missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b` 11 | 12 | // The NodeList of matching elements 13 | var missingCoverageElements = document.querySelectorAll(selector); 14 | 15 | var currentIndex; 16 | 17 | function toggleClass(index) { 18 | missingCoverageElements.item(currentIndex).classList.remove('highlighted'); 19 | missingCoverageElements.item(index).classList.add('highlighted'); 20 | } 21 | 22 | function makeCurrent(index) { 23 | toggleClass(index); 24 | currentIndex = index; 25 | missingCoverageElements.item(index) 26 | .scrollIntoView({ behavior: 'smooth', block: 'center', inline: 'center' }); 27 | } 28 | 29 | function goToPrevious() { 30 | var nextIndex = 0; 31 | if (typeof currentIndex !== 'number' || currentIndex === 0) { 32 | nextIndex = missingCoverageElements.length - 1; 33 | } else if (missingCoverageElements.length > 1) { 34 | nextIndex = currentIndex - 1; 35 | } 36 | 37 | makeCurrent(nextIndex); 38 | } 39 | 40 | function goToNext() { 41 | var nextIndex = 0; 42 | 43 | if (typeof currentIndex === 'number' && currentIndex < (missingCoverageElements.length - 1)) { 44 | nextIndex = currentIndex + 1; 45 | } 46 | 47 | makeCurrent(nextIndex); 48 | } 49 | 50 | return function jump(event) { 51 | switch (event.which) { 52 | case 78: // n 53 | case 74: // j 54 | goToNext(); 55 | break; 56 | case 66: // b 57 | case 75: // k 58 | case 80: // p 59 | goToPrevious(); 60 | break; 61 | } 62 | }; 63 | }()); 64 | window.addEventListener('keydown', jumpToCode); 65 | -------------------------------------------------------------------------------- /build/coverage/lib/katex/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |44 | Press n or j to go to the next uncovered block, b, p or k for the previous block. 45 |
46 |File | 53 |54 | | Statements | 55 |56 | | Branches | 57 |58 | | Functions | 59 |60 | | Lines | 61 |62 | |
---|---|---|---|---|---|---|---|---|---|
katex-modified.min.js | 66 |57.72% | 68 |1425/2469 | 69 |47.53% | 70 |951/2001 | 71 |60.92% | 72 |279/458 | 73 |100% | 74 |3/3 | 75 |
44 | Press n or j to go to the next uncovered block, b, p or k for the previous block. 45 |
46 |File | 53 |54 | | Statements | 55 |56 | | Branches | 57 |58 | | Functions | 59 |60 | | Lines | 61 |62 | |
---|---|---|---|---|---|---|---|---|---|
mousetrap.min.js | 66 |78.68% | 68 |107/136 | 69 |48.45% | 70 |78/161 | 71 |62.5% | 72 |20/32 | 73 |100% | 74 |11/11 | 75 |