hyhyhy 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +15 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +4 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +22 -0
- data/README.md +184 -0
- data/Rakefile +2 -0
- data/bin/hyhyhy +59 -0
- data/hyhyhy.gemspec +29 -0
- data/lib/hyhyhy.rb +101 -0
- data/lib/hyhyhy/config.rb +29 -0
- data/lib/hyhyhy/frames.rb +108 -0
- data/lib/hyhyhy/logger.rb +40 -0
- data/lib/hyhyhy/parser.rb +9 -0
- data/lib/hyhyhy/structure/.bowerrc +5 -0
- data/lib/hyhyhy/structure/.hyhyhy +5 -0
- data/lib/hyhyhy/structure/README.md +0 -0
- data/lib/hyhyhy/structure/_assets/javascripts/main.js +395 -0
- data/lib/hyhyhy/structure/_assets/stylesheets/main.css +520 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/.bower.json +47 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/Gruntfile.js +472 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/LICENSE +21 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/README.md +129 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/bower.json +38 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/css/bootstrap-theme.css +470 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/css/bootstrap-theme.css.map +1 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/css/bootstrap-theme.min.css +5 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/css/bootstrap.css +6332 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/css/bootstrap.css.map +1 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/css/bootstrap.min.css +5 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/fonts/glyphicons-halflings-regular.svg +229 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/js/bootstrap.js +2320 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/js/bootstrap.min.js +7 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/dist/js/npm.js +13 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/fonts/glyphicons-halflings-regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/fonts/glyphicons-halflings-regular.svg +229 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/fonts/glyphicons-halflings-regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/fonts/glyphicons-halflings-regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/grunt/.jshintrc +7 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-commonjs-generator.js +23 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-lessdoc-parser.js +238 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/grunt/bs-raw-files-generator.js +46 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/grunt/configBridge.json +44 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/grunt/sauce_browsers.yml +82 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/.jscsrc +34 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/.jshintrc +15 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/affix.js +162 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/alert.js +94 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/button.js +116 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/carousel.js +240 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/collapse.js +211 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/dropdown.js +161 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/modal.js +324 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/popover.js +119 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/scrollspy.js +175 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/tab.js +153 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/tooltip.js +478 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/js/transition.js +59 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/.csscomb.json +304 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/.csslintrc +19 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/alerts.less +68 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/badges.less +61 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/bootstrap.less +50 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/breadcrumbs.less +26 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/button-groups.less +243 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/buttons.less +160 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/carousel.less +267 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/close.less +33 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/code.less +69 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/component-animations.less +34 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/dropdowns.less +213 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/forms.less +546 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/glyphicons.less +234 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/grid.less +84 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/input-groups.less +166 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/jumbotron.less +49 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/labels.less +64 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/list-group.less +124 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/media.less +47 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins.less +39 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/alerts.less +14 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/background-variant.less +8 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/border-radius.less +18 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/buttons.less +52 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/center-block.less +7 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/clearfix.less +22 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/forms.less +85 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/gradients.less +59 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/grid-framework.less +91 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/grid.less +122 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/hide-text.less +21 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/image.less +33 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/labels.less +12 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/list-group.less +29 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/nav-divider.less +10 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/nav-vertical-align.less +9 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/opacity.less +8 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/pagination.less +23 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/panels.less +24 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/progress-bar.less +10 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/reset-filter.less +8 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/resize.less +6 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/responsive-visibility.less +15 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/size.less +10 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/tab-focus.less +9 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/table-row.less +28 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/text-emphasis.less +8 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/text-overflow.less +8 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/mixins/vendor-prefixes.less +227 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/modals.less +148 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/navbar.less +660 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/navs.less +244 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/normalize.less +427 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/pager.less +54 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/pagination.less +88 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/panels.less +261 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/popovers.less +135 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/print.less +107 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/progress-bars.less +87 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/responsive-embed.less +35 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/responsive-utilities.less +194 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/scaffolding.less +150 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/tables.less +234 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/theme.less +272 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/thumbnails.less +36 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/tooltip.less +103 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/type.less +302 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/utilities.less +56 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/variables.less +856 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/less/wells.less +29 -0
- data/lib/hyhyhy/structure/_includes/bootstrap/package.json +82 -0
- data/lib/hyhyhy/structure/_includes/bower.json +9 -0
- data/lib/hyhyhy/structure/_includes/d3/.bower.json +37 -0
- data/lib/hyhyhy/structure/_includes/d3/CONTRIBUTING.md +25 -0
- data/lib/hyhyhy/structure/_includes/d3/LICENSE +26 -0
- data/lib/hyhyhy/structure/_includes/d3/README.md +9 -0
- data/lib/hyhyhy/structure/_includes/d3/bower.json +26 -0
- data/lib/hyhyhy/structure/_includes/d3/d3.js +9470 -0
- data/lib/hyhyhy/structure/_includes/d3/d3.min.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/.bower.json +38 -0
- data/lib/hyhyhy/structure/_includes/jquery/MIT-LICENSE.txt +21 -0
- data/lib/hyhyhy/structure/_includes/jquery/bower.json +27 -0
- data/lib/hyhyhy/structure/_includes/jquery/dist/jquery.js +9190 -0
- data/lib/hyhyhy/structure/_includes/jquery/dist/jquery.min.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/dist/jquery.min.map +1 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax.js +806 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/jsonp.js +89 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/load.js +75 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/parseJSON.js +13 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/parseXML.js +28 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/script.js +64 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/var/nonce.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/var/rquery.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/ajax/xhr.js +135 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/attributes.js +11 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/attributes/attr.js +143 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/attributes/classes.js +158 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/attributes/prop.js +96 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/attributes/support.js +35 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/attributes/val.js +163 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/callbacks.js +205 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/core.js +498 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/core/access.js +60 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/core/init.js +123 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/core/parseHTML.js +39 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/core/ready.js +97 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/core/var/rsingleTag.js +4 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css.js +451 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/addGetHookIf.js +24 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/curCSS.js +57 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/defaultDisplay.js +70 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/support.js +91 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/swap.js +28 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/var/cssExpand.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/var/getStyles.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/var/isHidden.js +13 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/var/rmargin.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/css/var/rnumnonpx.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/data.js +179 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/data/Data.js +181 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/data/accepts.js +20 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/data/var/data_priv.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/data/var/data_user.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/deferred.js +149 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/deprecated.js +13 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/dimensions.js +50 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/effects.js +649 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/effects/Tween.js +114 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/effects/animatedSelector.js +13 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/event.js +868 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/event/alias.js +39 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/event/support.js +9 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/exports/amd.js +24 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/exports/global.js +32 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/intro.js +44 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/jquery.js +36 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/manipulation.js +582 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/manipulation/_evalUrl.js +18 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/manipulation/support.js +31 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/manipulation/var/rcheckableType.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/offset.js +204 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/outro.js +1 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/queue.js +142 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/queue/delay.js +22 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/selector-native.js +172 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/selector-sizzle.js +14 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/selector.js +1 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/serialize.js +111 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/sizzle/dist/sizzle.js +2044 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/sizzle/dist/sizzle.min.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/sizzle/dist/sizzle.min.map +1 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/traversing.js +200 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/traversing/findFilter.js +100 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/traversing/var/rneedsContext.js +6 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/arr.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/class2type.js +4 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/concat.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/hasOwn.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/indexOf.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/pnum.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/push.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/rnotwhite.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/slice.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/strundefined.js +3 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/support.js +4 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/var/toString.js +5 -0
- data/lib/hyhyhy/structure/_includes/jquery/src/wrap.js +78 -0
- data/lib/hyhyhy/structure/_includes/katex/.arcconfig +4 -0
- data/lib/hyhyhy/structure/_includes/katex/.bower.json +14 -0
- data/lib/hyhyhy/structure/_includes/katex/.gitignore +5 -0
- data/lib/hyhyhy/structure/_includes/katex/.hyhyhy +10 -0
- data/lib/hyhyhy/structure/_includes/katex/.jshintrc +67 -0
- data/lib/hyhyhy/structure/_includes/katex/.travis.yml +4 -0
- data/lib/hyhyhy/structure/_includes/katex/CONTRIBUTING.md +112 -0
- data/lib/hyhyhy/structure/_includes/katex/LICENSE.txt +21 -0
- data/lib/hyhyhy/structure/_includes/katex/Makefile +61 -0
- data/lib/hyhyhy/structure/_includes/katex/README.md +50 -0
- data/lib/hyhyhy/structure/_includes/katex/cli.js +15 -0
- data/lib/hyhyhy/structure/_includes/katex/dockers/HuxleyTests/Dockerfile +13 -0
- data/lib/hyhyhy/structure/_includes/katex/dockers/HuxleyTests/README.md +29 -0
- data/lib/hyhyhy/structure/_includes/katex/dockers/MathJaxFonts/Dockerfile +34 -0
- data/lib/hyhyhy/structure/_includes/katex/dockers/MathJaxFonts/README.md +55 -0
- data/lib/hyhyhy/structure/_includes/katex/dockers/MathJaxFonts/copy_fonts.sh +47 -0
- data/lib/hyhyhy/structure/_includes/katex/katex.js +54 -0
- data/lib/hyhyhy/structure/_includes/katex/lint_blacklist.txt +8 -0
- data/lib/hyhyhy/structure/_includes/katex/metrics/README.md +21 -0
- data/lib/hyhyhy/structure/_includes/katex/metrics/extract_tfms.py +94 -0
- data/lib/hyhyhy/structure/_includes/katex/metrics/extract_ttfs.py +75 -0
- data/lib/hyhyhy/structure/_includes/katex/metrics/mapping.pl +997 -0
- data/lib/hyhyhy/structure/_includes/katex/metrics/parse_tfm.py +201 -0
- data/lib/hyhyhy/structure/_includes/katex/metrics/replace_line.py +17 -0
- data/lib/hyhyhy/structure/_includes/katex/package.json +30 -0
- data/lib/hyhyhy/structure/_includes/katex/server.js +77 -0
- data/lib/hyhyhy/structure/_includes/katex/src/Lexer.js +190 -0
- data/lib/hyhyhy/structure/_includes/katex/src/Options.js +85 -0
- data/lib/hyhyhy/structure/_includes/katex/src/ParseError.js +40 -0
- data/lib/hyhyhy/structure/_includes/katex/src/Parser.js +639 -0
- data/lib/hyhyhy/structure/_includes/katex/src/Style.js +126 -0
- data/lib/hyhyhy/structure/_includes/katex/src/buildCommon.js +271 -0
- data/lib/hyhyhy/structure/_includes/katex/src/buildTree.js +1167 -0
- data/lib/hyhyhy/structure/_includes/katex/src/delimiter.js +541 -0
- data/lib/hyhyhy/structure/_includes/katex/src/domTree.js +241 -0
- data/lib/hyhyhy/structure/_includes/katex/src/fontMetrics.js +129 -0
- data/lib/hyhyhy/structure/_includes/katex/src/functions.js +539 -0
- data/lib/hyhyhy/structure/_includes/katex/src/parseTree.js +17 -0
- data/lib/hyhyhy/structure/_includes/katex/src/symbols.js +1006 -0
- data/lib/hyhyhy/structure/_includes/katex/src/utils.js +97 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts.less +73 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_AMS-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_AMS-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_AMS-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_AMS-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Bold.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Bold.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Bold.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Bold.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Bold.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Bold.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Greek-Bold.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Greek-BoldItalic.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Greek-Italic.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Greek-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Bold.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Bold.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Bold.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Bold.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Italic.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Italic.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Italic.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Italic.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Main-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-BoldItalic.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-BoldItalic.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-BoldItalic.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Italic.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Italic.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Italic.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Italic.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Math-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Bold.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Bold.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Bold.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Italic.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Italic.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Italic.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Script-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Script-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Script-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Script-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size1-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size1-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size1-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size1-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size2-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size2-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size2-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size2-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size3-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size3-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size3-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size3-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size4-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size4-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size4-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Size4-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Typewriter-Regular.eot +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Typewriter-Regular.ttf +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Typewriter-Regular.woff +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
- data/lib/hyhyhy/structure/_includes/katex/static/index.html +17 -0
- data/lib/hyhyhy/structure/_includes/katex/static/katex.less +430 -0
- data/lib/hyhyhy/structure/_includes/katex/static/main.css +12 -0
- data/lib/hyhyhy/structure/_includes/katex/static/main.js +42 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfile.json +199 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Accents.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Accents.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Baseline.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Baseline.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/BasicTest.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/BasicTest.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/BinomTest.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/BinomTest.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Colors.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Colors.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/DeepFontSizing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/DeepFontSizing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/DelimiterSizing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/DelimiterSizing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/DisplayStyle.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/DisplayStyle.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Exponents.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Exponents.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/FractionTest.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/FractionTest.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Functions.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Functions.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/GreekLetters.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/GreekLetters.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/KaTeX.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/KaTeX.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Lap.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Lap.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/LeftRight.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/LeftRight.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/LeftRightListStyling.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/LeftRightListStyling.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/LeftRightStyleSizing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/LeftRightStyleSizing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/NestedFractions.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/NestedFractions.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/NullDelimiterInteraction.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/NullDelimiterInteraction.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/OpLimits.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/OpLimits.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Overline.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Overline.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/PrimeSpacing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/PrimeSpacing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/RlapBug.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/RlapBug.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Rule.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Rule.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Sizing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Sizing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SizingBaseline.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SizingBaseline.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Spacing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Spacing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Sqrt.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Sqrt.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SupSubCharacterBox.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SupSubCharacterBox.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SupSubHorizSpacing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SupSubHorizSpacing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SupSubOffsets.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/SupSubOffsets.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Text.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/Text.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/VerticalSpacing.hux/firefox-1.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/Huxleyfolder/VerticalSpacing.record.json +5 -0
- data/lib/hyhyhy/structure/_includes/katex/test/huxley/test.html +30 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/MIT.LICENSE +20 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/boot.js +120 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/console.js +166 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/jasmine-html.js +390 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/jasmine.css +61 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/jasmine.js +2593 -0
- data/lib/hyhyhy/structure/_includes/katex/test/jasmine/jasmine_favicon.png +0 -0
- data/lib/hyhyhy/structure/_includes/katex/test/katex-spec.js +1179 -0
- data/lib/hyhyhy/structure/_includes/katex/test/test.html +12 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/.bower.json +61 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/.hyhyhy +17 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/LICENSE +362 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/README.md +70 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/bower.json +50 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/css/metricsgraphics-demo-dark.css +640 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/css/metricsgraphics-demo.css +176 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/css/metricsgraphics.css +344 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/images/missing-data-dark.png +0 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/images/missing-data.png +0 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/js/metricsgraphics.min.js +590 -0
- data/lib/hyhyhy/structure/_includes/metrics-graphics/package.json +35 -0
- data/lib/hyhyhy/structure/_includes/prism/.bower.json +34 -0
- data/lib/hyhyhy/structure/_includes/prism/.hyhyhy +33 -0
- data/lib/hyhyhy/structure/_includes/prism/LICENSE +21 -0
- data/lib/hyhyhy/structure/_includes/prism/README.md +22 -0
- data/lib/hyhyhy/structure/_includes/prism/bower.json +26 -0
- data/lib/hyhyhy/structure/_includes/prism/components.js +233 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-apacheconf.js +46 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-apacheconf.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-aspnet.js +49 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-aspnet.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-autohotkey.js +27 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-autohotkey.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-bash.js +24 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-bash.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-c.js +26 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-c.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-clike.js +32 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-clike.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-coffeescript.js +18 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-coffeescript.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-core.js +424 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-core.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-cpp.js +12 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-cpp.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-csharp.js +6 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-csharp.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-css-extras.js +15 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-css-extras.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-css.js +50 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-css.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-gherkin.js +13 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-gherkin.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-git.js +68 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-git.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-go.js +9 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-go.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-groovy.js +43 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-groovy.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-handlebars.js +92 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-handlebars.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-haskell.js +32 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-haskell.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-http.js +44 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-http.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-ini.js +11 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-ini.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-java.js +8 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-java.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-javascript.js +27 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-javascript.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-latex.js +6 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-latex.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-markup.js +41 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-markup.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-nasm.js +20 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-nasm.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-nsis.js +19 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-nsis.min.js +5 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-objectivec.js +5 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-objectivec.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-perl.js +112 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-perl.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-php-extras.js +11 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-php-extras.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-php.js +99 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-php.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-python.js +14 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-python.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-rip.js +29 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-rip.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-ruby.js +21 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-ruby.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-scala.js +8 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-scala.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-scheme-min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-scheme.js +24 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-scss.js +36 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-scss.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-sql.js +17 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-sql.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-swift.js +8 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-swift.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-twig.js +46 -0
- data/lib/hyhyhy/structure/_includes/prism/components/prism-twig.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/gulpfile.js +48 -0
- data/lib/hyhyhy/structure/_includes/prism/package.json +27 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/autolinker/prism-autolinker.css +3 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/autolinker/prism-autolinker.js +66 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/autolinker/prism-autolinker.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/file-highlight/prism-file-highlight.js +54 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/file-highlight/prism-file-highlight.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/ie8/prism-ie8.css +3 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/ie8/prism-ie8.js +42 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/ie8/prism-ie8.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/line-highlight/prism-line-highlight.css +47 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/line-highlight/prism-line-highlight.js +109 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/line-highlight/prism-line-highlight.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/line-numbers/prism-line-numbers.css +40 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/line-numbers/prism-line-numbers.js +24 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/line-numbers/prism-line-numbers.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-invisibles/prism-show-invisibles.css +17 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-invisibles/prism-show-invisibles.js +15 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-invisibles/prism-show-invisibles.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-language/prism-show-language.css +21 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-language/prism-show-language.js +16 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-language/prism-show-language.min.css +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/show-language/prism-show-language.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/wpd/prism-wpd.css +11 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/wpd/prism-wpd.js +163 -0
- data/lib/hyhyhy/structure/_includes/prism/plugins/wpd/prism-wpd.min.js +1 -0
- data/lib/hyhyhy/structure/_includes/prism/prism.js +662 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism-coy.css +210 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism-dark.css +122 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism-funky.css +111 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism-okaidia.css +114 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism-tomorrow.css +115 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism-twilight.css +195 -0
- data/lib/hyhyhy/structure/_includes/prism/themes/prism.css +131 -0
- data/lib/hyhyhy/structure/_includes/prism/vendor/promise.js +5 -0
- data/lib/hyhyhy/structure/_layouts/default.erb +41 -0
- data/lib/hyhyhy/structure/_slides/1.introduction.md +36 -0
- data/lib/hyhyhy/structure/_slides/2.packages.md +52 -0
- data/lib/hyhyhy/structure/_slides/3.usage.md +146 -0
- data/lib/hyhyhy/version.rb +5 -0
- metadata +747 -0
@@ -0,0 +1,201 @@
|
|
1
|
+
class CharInfoWord(object):
|
2
|
+
def __init__(self, word):
|
3
|
+
b1, b2, b3, b4 = (word >> 24,
|
4
|
+
(word & 0xff0000) >> 16,
|
5
|
+
(word & 0xff00) >> 8,
|
6
|
+
word & 0xff)
|
7
|
+
|
8
|
+
self.width_index = b1
|
9
|
+
self.height_index = b2 >> 4
|
10
|
+
self.depth_index = b2 & 0x0f
|
11
|
+
self.italic_index = (b3 & 0b11111100) >> 2
|
12
|
+
self.tag = b3 & 0b11
|
13
|
+
self.remainder = b4
|
14
|
+
|
15
|
+
def has_ligkern(self):
|
16
|
+
return self.tag == 1
|
17
|
+
|
18
|
+
def ligkern_start(self):
|
19
|
+
return self.remainder
|
20
|
+
|
21
|
+
|
22
|
+
class LigKernProgram(object):
|
23
|
+
def __init__(self, program):
|
24
|
+
self.program = program
|
25
|
+
|
26
|
+
def execute(self, start, next_char):
|
27
|
+
curr_instruction = start
|
28
|
+
while True:
|
29
|
+
instruction = self.program[curr_instruction]
|
30
|
+
(skip, inst_next_char, op, remainder) = instruction
|
31
|
+
|
32
|
+
if inst_next_char == next_char:
|
33
|
+
if op < 128:
|
34
|
+
# Don't worry about ligatures for now, we only need kerns
|
35
|
+
return None
|
36
|
+
else:
|
37
|
+
return 256 * (op - 128) + remainder
|
38
|
+
elif skip >= 128:
|
39
|
+
return None
|
40
|
+
else:
|
41
|
+
curr_instruction += 1 + skip
|
42
|
+
|
43
|
+
|
44
|
+
class TfmCharMetrics(object):
|
45
|
+
def __init__(self, width, height, depth, italic, kern_table):
|
46
|
+
self.width = width
|
47
|
+
self.height = height
|
48
|
+
self.depth = depth
|
49
|
+
self.italic_correction = italic
|
50
|
+
self.kern_table = kern_table
|
51
|
+
|
52
|
+
|
53
|
+
class TfmFile(object):
|
54
|
+
def __init__(self, start_char, end_char, char_info, width_table,
|
55
|
+
height_table, depth_table, italic_table, ligkern_table,
|
56
|
+
kern_table):
|
57
|
+
self.start_char = start_char
|
58
|
+
self.end_char = end_char
|
59
|
+
self.char_info = char_info
|
60
|
+
self.width_table = width_table
|
61
|
+
self.height_table = height_table
|
62
|
+
self.depth_table = depth_table
|
63
|
+
self.italic_table = italic_table
|
64
|
+
self.ligkern_program = LigKernProgram(ligkern_table)
|
65
|
+
self.kern_table = kern_table
|
66
|
+
|
67
|
+
def get_char_metrics(self, char_num):
|
68
|
+
if char_num < self.start_char or char_num > self.end_char:
|
69
|
+
raise RuntimeError("Invalid character number")
|
70
|
+
|
71
|
+
info = self.char_info[char_num + self.start_char]
|
72
|
+
|
73
|
+
char_kern_table = {}
|
74
|
+
if info.has_ligkern():
|
75
|
+
for char in range(self.start_char, self.end_char + 1):
|
76
|
+
kern = self.ligkern_program.execute(info.ligkern_start(), char)
|
77
|
+
if kern:
|
78
|
+
char_kern_table[char] = self.kern_table[kern]
|
79
|
+
|
80
|
+
return TfmCharMetrics(
|
81
|
+
self.width_table[info.width_index],
|
82
|
+
self.height_table[info.height_index],
|
83
|
+
self.depth_table[info.depth_index],
|
84
|
+
self.italic_table[info.italic_index],
|
85
|
+
char_kern_table)
|
86
|
+
|
87
|
+
|
88
|
+
class TfmReader(object):
|
89
|
+
def __init__(self, f):
|
90
|
+
self.f = f
|
91
|
+
|
92
|
+
def read_byte(self):
|
93
|
+
return ord(self.f.read(1))
|
94
|
+
|
95
|
+
def read_halfword(self):
|
96
|
+
b1 = self.read_byte()
|
97
|
+
b2 = self.read_byte()
|
98
|
+
return (b1 << 8) | b2
|
99
|
+
|
100
|
+
def read_word(self):
|
101
|
+
b1 = self.read_byte()
|
102
|
+
b2 = self.read_byte()
|
103
|
+
b3 = self.read_byte()
|
104
|
+
b4 = self.read_byte()
|
105
|
+
return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4
|
106
|
+
|
107
|
+
def read_fixword(self):
|
108
|
+
word = self.read_word()
|
109
|
+
|
110
|
+
neg = False
|
111
|
+
if word & 0x80000000:
|
112
|
+
neg = True
|
113
|
+
word = (-word & 0xffffffff)
|
114
|
+
|
115
|
+
return (-1 if neg else 1) * word / float(1 << 20)
|
116
|
+
|
117
|
+
def read_bcpl(self, length):
|
118
|
+
str_length = self.read_byte()
|
119
|
+
data = self.f.read(length - 1)
|
120
|
+
return data[:str_length]
|
121
|
+
|
122
|
+
|
123
|
+
def read_tfm_file(file_name):
|
124
|
+
with open(file_name, 'rb') as f:
|
125
|
+
reader = TfmReader(f)
|
126
|
+
|
127
|
+
# file_size
|
128
|
+
reader.read_halfword()
|
129
|
+
header_size = reader.read_halfword()
|
130
|
+
|
131
|
+
start_char = reader.read_halfword()
|
132
|
+
end_char = reader.read_halfword()
|
133
|
+
|
134
|
+
width_table_size = reader.read_halfword()
|
135
|
+
height_table_size = reader.read_halfword()
|
136
|
+
depth_table_size = reader.read_halfword()
|
137
|
+
italic_table_size = reader.read_halfword()
|
138
|
+
|
139
|
+
ligkern_table_size = reader.read_halfword()
|
140
|
+
kern_table_size = reader.read_halfword()
|
141
|
+
|
142
|
+
# extensible_table_size
|
143
|
+
reader.read_halfword()
|
144
|
+
# parameter_table_size
|
145
|
+
reader.read_halfword()
|
146
|
+
|
147
|
+
# checksum
|
148
|
+
reader.read_word()
|
149
|
+
# design_size
|
150
|
+
reader.read_fixword()
|
151
|
+
|
152
|
+
if header_size > 2:
|
153
|
+
# coding_scheme
|
154
|
+
reader.read_bcpl(40)
|
155
|
+
|
156
|
+
if header_size > 12:
|
157
|
+
# font_family
|
158
|
+
reader.read_bcpl(20)
|
159
|
+
|
160
|
+
for i in range(header_size - 17):
|
161
|
+
reader.read_word()
|
162
|
+
|
163
|
+
char_info = []
|
164
|
+
for i in range(start_char, end_char + 1):
|
165
|
+
char_info.append(CharInfoWord(reader.read_word()))
|
166
|
+
|
167
|
+
width_table = []
|
168
|
+
for i in range(width_table_size):
|
169
|
+
width_table.append(reader.read_fixword())
|
170
|
+
|
171
|
+
height_table = []
|
172
|
+
for i in range(height_table_size):
|
173
|
+
height_table.append(reader.read_fixword())
|
174
|
+
|
175
|
+
depth_table = []
|
176
|
+
for i in range(depth_table_size):
|
177
|
+
depth_table.append(reader.read_fixword())
|
178
|
+
|
179
|
+
italic_table = []
|
180
|
+
for i in range(italic_table_size):
|
181
|
+
italic_table.append(reader.read_fixword())
|
182
|
+
|
183
|
+
ligkern_table = []
|
184
|
+
for i in range(ligkern_table_size):
|
185
|
+
skip = reader.read_byte()
|
186
|
+
next_char = reader.read_byte()
|
187
|
+
op = reader.read_byte()
|
188
|
+
remainder = reader.read_byte()
|
189
|
+
|
190
|
+
ligkern_table.append((skip, next_char, op, remainder))
|
191
|
+
|
192
|
+
kern_table = []
|
193
|
+
for i in range(kern_table_size):
|
194
|
+
kern_table.append(reader.read_fixword())
|
195
|
+
|
196
|
+
# There is more information, like the ligkern, kern, extensible, and
|
197
|
+
# param table, but we don't need these for now
|
198
|
+
|
199
|
+
return TfmFile(start_char, end_char, char_info, width_table,
|
200
|
+
height_table, depth_table, italic_table,
|
201
|
+
ligkern_table, kern_table)
|
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env python2
|
2
|
+
|
3
|
+
import sys
|
4
|
+
|
5
|
+
with open("../src/fontMetrics.js", "r") as metrics:
|
6
|
+
old_lines = file.readlines(metrics)
|
7
|
+
|
8
|
+
replace = sys.stdin.read()
|
9
|
+
|
10
|
+
with open("../src/fontMetrics.js", "w") as output:
|
11
|
+
for line in old_lines:
|
12
|
+
if line.startswith("var metricMap"):
|
13
|
+
output.write("var metricMap = ")
|
14
|
+
output.write(replace)
|
15
|
+
output.write(";\n")
|
16
|
+
else:
|
17
|
+
output.write(line)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
{
|
2
|
+
"name": "katex",
|
3
|
+
"version": "0.1.1",
|
4
|
+
"description": "Fast math typesetting for the web.",
|
5
|
+
"main": "katex.js",
|
6
|
+
"repository": {
|
7
|
+
"type": "git",
|
8
|
+
"url": "git://github.com/Khan/KaTeX.git"
|
9
|
+
},
|
10
|
+
"files": [
|
11
|
+
"katex.js",
|
12
|
+
"cli.js",
|
13
|
+
"src/"
|
14
|
+
],
|
15
|
+
"license": "MIT",
|
16
|
+
"devDependencies": {
|
17
|
+
"browserify": "~2.29.1",
|
18
|
+
"clean-css": "~2.2.15",
|
19
|
+
"express": "~3.3.3",
|
20
|
+
"huxley": "~0.8.1",
|
21
|
+
"jasmine-node": "git://github.com/mhevery/jasmine-node.git#Jasmine2.0",
|
22
|
+
"jshint": "^2.5.6",
|
23
|
+
"less": "~1.7.5",
|
24
|
+
"uglify-js": "~2.4.15"
|
25
|
+
},
|
26
|
+
"bin": "cli.js",
|
27
|
+
"scripts": {
|
28
|
+
"test": "make lint test"
|
29
|
+
}
|
30
|
+
}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
var fs = require("fs");
|
2
|
+
var path = require("path");
|
3
|
+
|
4
|
+
var browserify = require("browserify");
|
5
|
+
var express = require("express");
|
6
|
+
var less = require("less");
|
7
|
+
|
8
|
+
var app = express();
|
9
|
+
|
10
|
+
app.use(express.logger());
|
11
|
+
|
12
|
+
app.get("/katex.js", function(req, res, next) {
|
13
|
+
var b = browserify();
|
14
|
+
b.add("./katex");
|
15
|
+
|
16
|
+
var stream = b.bundle({standalone: "katex"});
|
17
|
+
|
18
|
+
var body = "";
|
19
|
+
stream.on("data", function(s) { body += s; });
|
20
|
+
stream.on("error", function(e) { next(e); });
|
21
|
+
stream.on("end", function() {
|
22
|
+
res.setHeader("Content-Type", "text/javascript");
|
23
|
+
res.send(body);
|
24
|
+
});
|
25
|
+
});
|
26
|
+
|
27
|
+
app.get("/katex.css", function(req, res, next) {
|
28
|
+
fs.readFile("static/katex.less", {encoding: "utf8"}, function(err, data) {
|
29
|
+
if (err) {
|
30
|
+
next(err);
|
31
|
+
return;
|
32
|
+
}
|
33
|
+
|
34
|
+
var parser = new less.Parser({
|
35
|
+
paths: ["./static"],
|
36
|
+
filename: "katex.less"
|
37
|
+
});
|
38
|
+
|
39
|
+
parser.parse(data, function(err, tree) {
|
40
|
+
if (err) {
|
41
|
+
next(err);
|
42
|
+
return;
|
43
|
+
}
|
44
|
+
|
45
|
+
res.setHeader("Content-Type", "text/css");
|
46
|
+
res.send(tree.toCSS());
|
47
|
+
});
|
48
|
+
});
|
49
|
+
});
|
50
|
+
|
51
|
+
app.get("/test/katex-spec.js", function(req, res, next) {
|
52
|
+
var b = browserify();
|
53
|
+
b.add("./test/katex-spec");
|
54
|
+
|
55
|
+
var stream = b.bundle({});
|
56
|
+
|
57
|
+
var body = "";
|
58
|
+
stream.on("data", function(s) { body += s; });
|
59
|
+
stream.on("error", function(e) { next(e); });
|
60
|
+
stream.on("end", function() {
|
61
|
+
res.setHeader("Content-Type", "text/javascript");
|
62
|
+
res.send(body);
|
63
|
+
});
|
64
|
+
});
|
65
|
+
|
66
|
+
app.use(express.static(path.join(__dirname, "static")));
|
67
|
+
app.use(express.static(path.join(__dirname, "build")));
|
68
|
+
app.use("/test", express.static(path.join(__dirname, "test")));
|
69
|
+
|
70
|
+
app.use(function(err, req, res, next) {
|
71
|
+
console.error(err.stack);
|
72
|
+
res.setHeader("Content-Type", "text/plain");
|
73
|
+
res.send(500, err.stack);
|
74
|
+
});
|
75
|
+
|
76
|
+
app.listen(7936);
|
77
|
+
console.log("Serving on http://0.0.0.0:7936/ ...");
|
@@ -0,0 +1,190 @@
|
|
1
|
+
/**
|
2
|
+
* The Lexer class handles tokenizing the input in various ways. Since our
|
3
|
+
* parser expects us to be able to backtrack, the lexer allows lexing from any
|
4
|
+
* given starting point.
|
5
|
+
*
|
6
|
+
* Its main exposed function is the `lex` function, which takes a position to
|
7
|
+
* lex from and a type of token to lex. It defers to the appropriate `_innerLex`
|
8
|
+
* function.
|
9
|
+
*
|
10
|
+
* The various `_innerLex` functions perform the actual lexing of different
|
11
|
+
* kinds.
|
12
|
+
*/
|
13
|
+
|
14
|
+
var ParseError = require("./ParseError");
|
15
|
+
|
16
|
+
// The main lexer class
|
17
|
+
function Lexer(input) {
|
18
|
+
this._input = input;
|
19
|
+
}
|
20
|
+
|
21
|
+
// The resulting token returned from `lex`.
|
22
|
+
function Token(text, data, position) {
|
23
|
+
this.text = text;
|
24
|
+
this.data = data;
|
25
|
+
this.position = position;
|
26
|
+
}
|
27
|
+
|
28
|
+
// "normal" types of tokens. These are tokens which can be matched by a simple
|
29
|
+
// regex
|
30
|
+
var mathNormals = [
|
31
|
+
/^[/|@.""`0-9a-zA-Z]/, // ords
|
32
|
+
/^[*+-]/, // bins
|
33
|
+
/^[=<>:]/, // rels
|
34
|
+
/^[,;]/, // punctuation
|
35
|
+
/^['\^_{}]/, // misc
|
36
|
+
/^[(\[]/, // opens
|
37
|
+
/^[)\]?!]/, // closes
|
38
|
+
/^~/ // spacing
|
39
|
+
];
|
40
|
+
|
41
|
+
// These are "normal" tokens like above, but should instead be parsed in text
|
42
|
+
// mode.
|
43
|
+
var textNormals = [
|
44
|
+
/^[a-zA-Z0-9`!@*()-=+\[\]'";:?\/.,]/, // ords
|
45
|
+
/^[{}]/, // grouping
|
46
|
+
/^~/ // spacing
|
47
|
+
];
|
48
|
+
|
49
|
+
// Regexes for matching whitespace
|
50
|
+
var whitespaceRegex = /^\s*/;
|
51
|
+
var whitespaceConcatRegex = /^( +|\\ +)/;
|
52
|
+
|
53
|
+
// This regex matches any other TeX function, which is a backslash followed by a
|
54
|
+
// word or a single symbol
|
55
|
+
var anyFunc = /^\\(?:[a-zA-Z]+|.)/;
|
56
|
+
|
57
|
+
/**
|
58
|
+
* This function lexes a single normal token. It takes a position, a list of
|
59
|
+
* "normal" tokens to try, and whether it should completely ignore whitespace or
|
60
|
+
* not.
|
61
|
+
*/
|
62
|
+
Lexer.prototype._innerLex = function(pos, normals, ignoreWhitespace) {
|
63
|
+
var input = this._input.slice(pos);
|
64
|
+
var whitespace;
|
65
|
+
|
66
|
+
if (ignoreWhitespace) {
|
67
|
+
// Get rid of whitespace.
|
68
|
+
whitespace = input.match(whitespaceRegex)[0];
|
69
|
+
pos += whitespace.length;
|
70
|
+
input = input.slice(whitespace.length);
|
71
|
+
} else {
|
72
|
+
// Do the funky concatenation of whitespace that happens in text mode.
|
73
|
+
whitespace = input.match(whitespaceConcatRegex);
|
74
|
+
if (whitespace !== null) {
|
75
|
+
return new Token(" ", null, pos + whitespace[0].length);
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
// If there's no more input to parse, return an EOF token
|
80
|
+
if (input.length === 0) {
|
81
|
+
return new Token("EOF", null, pos);
|
82
|
+
}
|
83
|
+
|
84
|
+
var match;
|
85
|
+
if ((match = input.match(anyFunc))) {
|
86
|
+
// If we match a function token, return it
|
87
|
+
return new Token(match[0], null, pos + match[0].length);
|
88
|
+
} else {
|
89
|
+
// Otherwise, we look through the normal token regexes and see if it's
|
90
|
+
// one of them.
|
91
|
+
for (var i = 0; i < normals.length; i++) {
|
92
|
+
var normal = normals[i];
|
93
|
+
|
94
|
+
if ((match = input.match(normal))) {
|
95
|
+
// If it is, return it
|
96
|
+
return new Token(
|
97
|
+
match[0], null, pos + match[0].length);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
throw new ParseError("Unexpected character: '" + input[0] +
|
103
|
+
"'", this, pos);
|
104
|
+
};
|
105
|
+
|
106
|
+
// A regex to match a CSS color (like #ffffff or BlueViolet)
|
107
|
+
var cssColor = /^(#[a-z0-9]+|[a-z]+)/i;
|
108
|
+
|
109
|
+
/**
|
110
|
+
* This function lexes a CSS color.
|
111
|
+
*/
|
112
|
+
Lexer.prototype._innerLexColor = function(pos) {
|
113
|
+
var input = this._input.slice(pos);
|
114
|
+
|
115
|
+
// Ignore whitespace
|
116
|
+
var whitespace = input.match(whitespaceRegex)[0];
|
117
|
+
pos += whitespace.length;
|
118
|
+
input = input.slice(whitespace.length);
|
119
|
+
|
120
|
+
var match;
|
121
|
+
if ((match = input.match(cssColor))) {
|
122
|
+
// If we look like a color, return a color
|
123
|
+
return new Token(match[0], null, pos + match[0].length);
|
124
|
+
} else {
|
125
|
+
throw new ParseError("Invalid color", this, pos);
|
126
|
+
}
|
127
|
+
};
|
128
|
+
|
129
|
+
// A regex to match a dimension. Dimensions look like
|
130
|
+
// "1.2em" or ".4pt" or "1 ex"
|
131
|
+
var sizeRegex = /^(-?)\s*(\d+(?:\.\d*)?|\.\d+)\s*([a-z]{2})/;
|
132
|
+
|
133
|
+
/**
|
134
|
+
* This function lexes a dimension.
|
135
|
+
*/
|
136
|
+
Lexer.prototype._innerLexSize = function(pos) {
|
137
|
+
var input = this._input.slice(pos);
|
138
|
+
|
139
|
+
// Ignore whitespace
|
140
|
+
var whitespace = input.match(whitespaceRegex)[0];
|
141
|
+
pos += whitespace.length;
|
142
|
+
input = input.slice(whitespace.length);
|
143
|
+
|
144
|
+
var match;
|
145
|
+
if ((match = input.match(sizeRegex))) {
|
146
|
+
var unit = match[3];
|
147
|
+
// We only currently handle "em" and "ex" units
|
148
|
+
if (unit !== "em" && unit !== "ex") {
|
149
|
+
throw new ParseError("Invalid unit: '" + unit + "'", this, pos);
|
150
|
+
}
|
151
|
+
return new Token(match[0], {
|
152
|
+
number: +(match[1] + match[2]),
|
153
|
+
unit: unit
|
154
|
+
}, pos + match[0].length);
|
155
|
+
}
|
156
|
+
|
157
|
+
throw new ParseError("Invalid size", this, pos);
|
158
|
+
};
|
159
|
+
|
160
|
+
/**
|
161
|
+
* This function lexes a string of whitespace.
|
162
|
+
*/
|
163
|
+
Lexer.prototype._innerLexWhitespace = function(pos) {
|
164
|
+
var input = this._input.slice(pos);
|
165
|
+
|
166
|
+
var whitespace = input.match(whitespaceRegex)[0];
|
167
|
+
pos += whitespace.length;
|
168
|
+
|
169
|
+
return new Token(whitespace, null, pos);
|
170
|
+
};
|
171
|
+
|
172
|
+
/**
|
173
|
+
* This function lexes a single token starting at `pos` and of the given mode.
|
174
|
+
* Based on the mode, we defer to one of the `_innerLex` functions.
|
175
|
+
*/
|
176
|
+
Lexer.prototype.lex = function(pos, mode) {
|
177
|
+
if (mode === "math") {
|
178
|
+
return this._innerLex(pos, mathNormals, true);
|
179
|
+
} else if (mode === "text") {
|
180
|
+
return this._innerLex(pos, textNormals, false);
|
181
|
+
} else if (mode === "color") {
|
182
|
+
return this._innerLexColor(pos);
|
183
|
+
} else if (mode === "size") {
|
184
|
+
return this._innerLexSize(pos);
|
185
|
+
} else if (mode === "whitespace") {
|
186
|
+
return this._innerLexWhitespace(pos);
|
187
|
+
}
|
188
|
+
};
|
189
|
+
|
190
|
+
module.exports = Lexer;
|