├── .gitignore ├── LICENSE ├── README.md ├── ipynbviewer ├── __init__.py ├── __main__.py ├── app.py ├── components │ ├── backbone │ │ └── backbone-min.js │ ├── bootstrap │ │ └── bootstrap │ │ │ └── js │ │ │ └── bootstrap.min.js │ ├── codemirror │ │ ├── addon │ │ │ ├── comment │ │ │ │ ├── comment.js │ │ │ │ └── continuecomment.js │ │ │ ├── dialog │ │ │ │ ├── dialog.css │ │ │ │ └── dialog.js │ │ │ ├── display │ │ │ │ ├── fullscreen.css │ │ │ │ ├── fullscreen.js │ │ │ │ ├── placeholder.js │ │ │ │ └── rulers.js │ │ │ ├── edit │ │ │ │ ├── closebrackets.js │ │ │ │ ├── closetag.js │ │ │ │ ├── continuelist.js │ │ │ │ ├── matchbrackets.js │ │ │ │ ├── matchtags.js │ │ │ │ └── trailingspace.js │ │ │ ├── fold │ │ │ │ ├── brace-fold.js │ │ │ │ ├── comment-fold.js │ │ │ │ ├── foldcode.js │ │ │ │ ├── foldgutter.css │ │ │ │ ├── foldgutter.js │ │ │ │ ├── indent-fold.js │ │ │ │ ├── markdown-fold.js │ │ │ │ └── xml-fold.js │ │ │ ├── hint │ │ │ │ ├── anyword-hint.js │ │ │ │ ├── css-hint.js │ │ │ │ ├── html-hint.js │ │ │ │ ├── javascript-hint.js │ │ │ │ ├── pig-hint.js │ │ │ │ ├── python-hint.js │ │ │ │ ├── show-hint.css │ │ │ │ ├── show-hint.js │ │ │ │ ├── sql-hint.js │ │ │ │ └── xml-hint.js │ │ │ ├── lint │ │ │ │ ├── coffeescript-lint.js │ │ │ │ ├── css-lint.js │ │ │ │ ├── javascript-lint.js │ │ │ │ ├── json-lint.js │ │ │ │ ├── lint.css │ │ │ │ ├── lint.js │ │ │ │ └── yaml-lint.js │ │ │ ├── merge │ │ │ │ ├── dep │ │ │ │ │ └── diff_match_patch.js │ │ │ │ ├── merge.css │ │ │ │ └── merge.js │ │ │ ├── mode │ │ │ │ ├── loadmode.js │ │ │ │ ├── multiplex.js │ │ │ │ ├── multiplex_test.js │ │ │ │ └── overlay.js │ │ │ ├── runmode │ │ │ │ ├── colorize.js │ │ │ │ ├── runmode-standalone.js │ │ │ │ ├── runmode.js │ │ │ │ └── runmode.node.js │ │ │ ├── scroll │ │ │ │ └── scrollpastend.js │ │ │ ├── search │ │ │ │ ├── match-highlighter.js │ │ │ │ ├── search.js │ │ │ │ └── searchcursor.js │ │ │ ├── selection │ │ │ │ ├── active-line.js │ │ │ │ └── mark-selection.js │ │ │ ├── tern │ │ │ │ ├── tern.css │ │ │ │ ├── tern.js │ │ │ │ └── worker.js │ │ │ └── wrap │ │ │ │ └── hardwrap.js │ │ ├── keymap │ │ │ ├── emacs.js │ │ │ ├── extra.js │ │ │ └── vim.js │ │ ├── mode │ │ │ ├── apl │ │ │ │ └── apl.js │ │ │ ├── asterisk │ │ │ │ └── asterisk.js │ │ │ ├── clike │ │ │ │ └── clike.js │ │ │ ├── clojure │ │ │ │ └── clojure.js │ │ │ ├── cobol │ │ │ │ └── cobol.js │ │ │ ├── coffeescript │ │ │ │ └── coffeescript.js │ │ │ ├── commonlisp │ │ │ │ └── commonlisp.js │ │ │ ├── css │ │ │ │ ├── css.js │ │ │ │ ├── less_test.js │ │ │ │ ├── scss_test.js │ │ │ │ └── test.js │ │ │ ├── d │ │ │ │ └── d.js │ │ │ ├── diff │ │ │ │ └── diff.js │ │ │ ├── dtd │ │ │ │ └── dtd.js │ │ │ ├── ecl │ │ │ │ └── ecl.js │ │ │ ├── eiffel │ │ │ │ └── eiffel.js │ │ │ ├── erlang │ │ │ │ └── erlang.js │ │ │ ├── fortran │ │ │ │ └── fortran.js │ │ │ ├── gas │ │ │ │ └── gas.js │ │ │ ├── gfm │ │ │ │ ├── gfm.js │ │ │ │ └── test.js │ │ │ ├── gherkin │ │ │ │ └── gherkin.js │ │ │ ├── go │ │ │ │ └── go.js │ │ │ ├── groovy │ │ │ │ └── groovy.js │ │ │ ├── haml │ │ │ │ ├── haml.js │ │ │ │ └── test.js │ │ │ ├── haskell │ │ │ │ └── haskell.js │ │ │ ├── haxe │ │ │ │ └── haxe.js │ │ │ ├── htmlembedded │ │ │ │ └── htmlembedded.js │ │ │ ├── htmlmixed │ │ │ │ └── htmlmixed.js │ │ │ ├── http │ │ │ │ └── http.js │ │ │ ├── jade │ │ │ │ └── jade.js │ │ │ ├── javascript │ │ │ │ ├── javascript.js │ │ │ │ └── test.js │ │ │ ├── jinja2 │ │ │ │ └── jinja2.js │ │ │ ├── julia │ │ │ │ └── julia.js │ │ │ ├── less │ │ │ │ └── less.js │ │ │ ├── livescript │ │ │ │ └── livescript.js │ │ │ ├── lua │ │ │ │ └── lua.js │ │ │ ├── markdown │ │ │ │ ├── markdown.js │ │ │ │ └── test.js │ │ │ ├── meta.js │ │ │ ├── mirc │ │ │ │ └── mirc.js │ │ │ ├── mllike │ │ │ │ └── mllike.js │ │ │ ├── nginx │ │ │ │ └── nginx.js │ │ │ ├── ntriples │ │ │ │ └── ntriples.js │ │ │ ├── octave │ │ │ │ └── octave.js │ │ │ ├── pascal │ │ │ │ └── pascal.js │ │ │ ├── pegjs │ │ │ │ └── pegjs.js │ │ │ ├── perl │ │ │ │ └── perl.js │ │ │ ├── php │ │ │ │ └── php.js │ │ │ ├── pig │ │ │ │ └── pig.js │ │ │ ├── properties │ │ │ │ └── properties.js │ │ │ ├── puppet │ │ │ │ └── puppet.js │ │ │ ├── python │ │ │ │ └── python.js │ │ │ ├── q │ │ │ │ └── q.js │ │ │ ├── r │ │ │ │ └── r.js │ │ │ ├── rpm │ │ │ │ ├── changes │ │ │ │ │ └── changes.js │ │ │ │ └── spec │ │ │ │ │ ├── spec.css │ │ │ │ │ └── spec.js │ │ │ ├── rst │ │ │ │ └── rst.js │ │ │ ├── ruby │ │ │ │ ├── ruby.js │ │ │ │ └── test.js │ │ │ ├── rust │ │ │ │ └── rust.js │ │ │ ├── sass │ │ │ │ └── sass.js │ │ │ ├── scheme │ │ │ │ └── scheme.js │ │ │ ├── shell │ │ │ │ └── shell.js │ │ │ ├── sieve │ │ │ │ └── sieve.js │ │ │ ├── smalltalk │ │ │ │ └── smalltalk.js │ │ │ ├── smarty │ │ │ │ └── smarty.js │ │ │ ├── smartymixed │ │ │ │ └── smartymixed.js │ │ │ ├── solr │ │ │ │ └── solr.js │ │ │ ├── sparql │ │ │ │ └── sparql.js │ │ │ ├── sql │ │ │ │ └── sql.js │ │ │ ├── stex │ │ │ │ ├── stex.js │ │ │ │ └── test.js │ │ │ ├── tcl │ │ │ │ └── tcl.js │ │ │ ├── tiddlywiki │ │ │ │ ├── tiddlywiki.css │ │ │ │ └── tiddlywiki.js │ │ │ ├── tiki │ │ │ │ ├── tiki.css │ │ │ │ └── tiki.js │ │ │ ├── toml │ │ │ │ └── toml.js │ │ │ ├── turtle │ │ │ │ └── turtle.js │ │ │ ├── vb │ │ │ │ └── vb.js │ │ │ ├── vbscript │ │ │ │ └── vbscript.js │ │ │ ├── velocity │ │ │ │ └── velocity.js │ │ │ ├── verilog │ │ │ │ └── verilog.js │ │ │ ├── xml │ │ │ │ └── xml.js │ │ │ ├── xquery │ │ │ │ ├── test.js │ │ │ │ └── xquery.js │ │ │ ├── yaml │ │ │ │ └── yaml.js │ │ │ └── z80 │ │ │ │ └── z80.js │ │ └── theme │ │ │ ├── 3024-day.css │ │ │ ├── 3024-night.css │ │ │ ├── ambiance-mobile.css │ │ │ ├── ambiance.css │ │ │ ├── base16-dark.css │ │ │ ├── base16-light.css │ │ │ ├── blackboard.css │ │ │ ├── cobalt.css │ │ │ ├── eclipse.css │ │ │ ├── elegant.css │ │ │ ├── erlang-dark.css │ │ │ ├── lesser-dark.css │ │ │ ├── mbo.css │ │ │ ├── mdn-like.css │ │ │ ├── midnight.css │ │ │ ├── monokai.css │ │ │ ├── neat.css │ │ │ ├── night.css │ │ │ ├── paraiso-dark.css │ │ │ ├── paraiso-light.css │ │ │ ├── pastel-on-dark.css │ │ │ ├── rubyblue.css │ │ │ ├── solarized.css │ │ │ ├── the-matrix.css │ │ │ ├── tomorrow-night-eighties.css │ │ │ ├── twilight.css │ │ │ ├── vibrant-ink.css │ │ │ ├── xq-dark.css │ │ │ └── xq-light.css │ ├── font-awesome │ │ └── font │ │ │ ├── FontAwesome.otf │ │ │ ├── fontawesome-webfont.eot │ │ │ ├── fontawesome-webfont.svg │ │ │ ├── fontawesome-webfont.ttf │ │ │ └── fontawesome-webfont.woff │ ├── google-caja │ │ └── html-css-sanitizer-minified.js │ ├── jquery-ui │ │ ├── themes │ │ │ └── smoothness │ │ │ │ ├── images │ │ │ │ ├── animated-overlay.gif │ │ │ │ ├── ui-bg_flat_0_aaaaaa_40x100.png │ │ │ │ ├── ui-bg_flat_75_ffffff_40x100.png │ │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ │ ├── ui-bg_glass_65_ffffff_1x400.png │ │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ │ ├── ui-icons_222222_256x240.png │ │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ │ ├── ui-icons_454545_256x240.png │ │ │ │ ├── ui-icons_888888_256x240.png │ │ │ │ └── ui-icons_cd0a0a_256x240.png │ │ │ │ └── jquery-ui.min.css │ │ └── ui │ │ │ └── minified │ │ │ └── jquery-ui.min.js │ ├── jquery │ │ └── jquery.min.js │ ├── requirejs │ │ └── require.js │ └── underscore │ │ └── underscore-min.js ├── handlers.py ├── static │ ├── bower.json │ ├── components │ │ ├── Font-Awesome │ │ │ ├── css │ │ │ │ ├── font-awesome.css │ │ │ │ └── font-awesome.min.css │ │ │ └── fonts │ │ │ │ ├── FontAwesome.otf │ │ │ │ ├── fontawesome-webfont.eot │ │ │ │ ├── fontawesome-webfont.svg │ │ │ │ ├── fontawesome-webfont.ttf │ │ │ │ └── fontawesome-webfont.woff │ │ ├── animate.css │ │ │ ├── animate.css │ │ │ └── animate.min.css │ │ ├── moment │ │ │ └── min │ │ │ │ └── moment.min.js │ │ └── requirejs │ │ │ ├── README.md │ │ │ ├── bower.json │ │ │ └── require.js │ ├── css │ │ ├── boilerplate.css │ │ ├── bootstrap-responsive.css │ │ ├── bootstrap-responsive.min.css │ │ ├── bootstrap.css │ │ ├── bootstrap.min.css │ │ ├── docs.css │ │ ├── nbviewer.css │ │ ├── override.css │ │ ├── pygments.css │ │ └── theme │ │ │ ├── cdp_1.css │ │ │ └── css_linalg.css │ ├── favicon.ico │ ├── ico │ │ ├── apple-touch-icon-114-precomposed.png │ │ ├── apple-touch-icon-144-precomposed.png │ │ ├── apple-touch-icon-57-precomposed.png │ │ ├── apple-touch-icon-72-precomposed.png │ │ ├── ipynb_icon_16x16.ico │ │ └── ipynb_icon_16x16.png │ ├── img │ │ ├── Python-logo-notext.png │ │ ├── bird.png │ │ ├── example-nb │ │ │ ├── XKCD-Matplotlib.png │ │ │ ├── bayesian-chap1.png │ │ │ ├── bokeh.png │ │ │ ├── covariance.png │ │ │ ├── data-cleanup.png │ │ │ ├── exploring_r_formula.png │ │ │ ├── fitting.png │ │ │ ├── gaza.png │ │ │ ├── ijulia-preview.png │ │ │ ├── ip-examples-list.png │ │ │ ├── ipython-thumb.png │ │ │ ├── iruby-nb.png │ │ │ ├── jaynes-cummings.png │ │ │ ├── mining-slice.png │ │ │ ├── nose_testing.png │ │ │ ├── numpy_tests.png │ │ │ ├── pandas_timeseries.png │ │ │ ├── pde_solver_with_numpy.png │ │ │ ├── plotly.png │ │ │ ├── probabilistic-bayesian.png │ │ │ ├── python-signal.png │ │ │ ├── python_for_visres.png │ │ │ ├── r_magic.png │ │ │ ├── readme.md │ │ │ ├── sympy.png │ │ │ └── working_with_pandas.png │ │ ├── github-16px.png │ │ ├── glyphicons-halflings-white.png │ │ ├── glyphicons-halflings.png │ │ ├── glyphicons │ │ │ ├── glyphicons_009_magic.png │ │ │ ├── glyphicons_042_group.png │ │ │ ├── glyphicons_079_podium.png │ │ │ ├── glyphicons_082_roundabout.png │ │ │ ├── glyphicons_155_show_thumbnails.png │ │ │ ├── glyphicons_163_iphone.png │ │ │ ├── glyphicons_214_resize_small.png │ │ │ └── glyphicons_266_book_open.png │ │ ├── grid-18px-masked.png │ │ ├── icon-css3.png │ │ ├── icon-github.png │ │ ├── icon-html5.png │ │ ├── icon-twitter.png │ │ ├── ipynblogo.png │ │ ├── less-logo-large.png │ │ ├── less-small.png │ │ ├── responsive-illustrations.png │ │ └── th_github.jpeg │ ├── js │ │ ├── README.md │ │ ├── application.js │ │ ├── bootstrap-alert.js │ │ ├── bootstrap-button.js │ │ ├── bootstrap-carousel.js │ │ ├── bootstrap-collapse.js │ │ ├── bootstrap-dropdown.js │ │ ├── bootstrap-modal.js │ │ ├── bootstrap-popover.js │ │ ├── bootstrap-scrollspy.js │ │ ├── bootstrap-tab.js │ │ ├── bootstrap-tooltip.js │ │ ├── bootstrap-transition.js │ │ ├── bootstrap-typeahead.js │ │ ├── bootstrap.js │ │ ├── bootstrap.min.js │ │ ├── google-code-prettify │ │ │ ├── prettify.css │ │ │ └── prettify.js │ │ ├── jquery.js │ │ ├── jquery.min.js │ │ └── require.min.js │ └── robots.txt └── templates │ ├── 404.html │ ├── error.html │ ├── layout.html │ ├── notebook.html │ └── slow_notebook.html ├── requirements.txt └── setup.py /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | 5 | # C extensions 6 | *.so 7 | 8 | # Distribution / packaging 9 | .Python 10 | env/ 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | lib/ 17 | lib64/ 18 | parts/ 19 | sdist/ 20 | var/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.egg 24 | 25 | # PyInstaller 26 | # Usually these files are written by a python script from a template 27 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 28 | *.manifest 29 | *.spec 30 | 31 | # Installer logs 32 | pip-log.txt 33 | pip-delete-this-directory.txt 34 | 35 | # Unit test / coverage reports 36 | htmlcov/ 37 | .tox/ 38 | .coverage 39 | .cache 40 | nosetests.xml 41 | coverage.xml 42 | 43 | # Translations 44 | *.mo 45 | *.pot 46 | 47 | # Django stuff: 48 | *.log 49 | 50 | # Sphinx documentation 51 | docs/_build/ 52 | 53 | # PyBuilder 54 | target/ 55 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 小明 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 | 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Ipynb-viewer 2 | ============ 3 | 4 | Rendering local ipynb to static HTML 5 | 6 | About 7 | ===== 8 | 9 | this is a project from make your ipynb file to html without serve by ipython notebook. why do this? 10 | 11 | 12 | * Usually I only need the other people see my data result, the other people no need to modify or execute it 13 | 14 | 15 | * I often generate many such ipynb files, but I need to use `nbconvert `transformation every time 16 | 17 | so. Ipynb-viewer can do this: 18 | 19 | * use a simple web service instead of ipython botebook's service 20 | * support show ipynb files like ipython notebook tree(/tree) 21 | * custom port and template simple and easy 22 | 23 | Install and Usage 24 | ===== 25 | 26 | You can install from pip: 27 | 28 | pip install ipynbviewer 29 | 30 | start it: 31 | 32 | cd /the/notebook/files/path 33 | python -m ipynbviewer # http://localhost:8000 and use ipython built-in template: full.tpl 34 | 35 | or: 36 | 37 | python -m ipynbviewer -p 54001 # http://localhost:54001 38 | 39 | or: 40 | 41 | python -m ipynbviewer -p 54001 -t double11.tpl # http://localhost:54001 and use custom template named `double11.tpl` in current dir. 42 | -------------------------------------------------------------------------------- /ipynbviewer/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/__init__.py -------------------------------------------------------------------------------- /ipynbviewer/__main__.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | from ipynbviewer.app import main 3 | main() 4 | -------------------------------------------------------------------------------- /ipynbviewer/app.py: -------------------------------------------------------------------------------- 1 | # coding=utf-8 2 | import os 3 | import argparse 4 | 5 | import markdown 6 | from concurrent.futures import ThreadPoolExecutor 7 | import tornado.autoreload 8 | from tornado import web, httpserver, ioloop, log 9 | from jinja2 import Environment, FileSystemLoader 10 | from IPython.config import Config 11 | from IPython.nbconvert.exporters import HTMLExporter 12 | from IPython.html.services.notebooks.filenbmanager import FileNotebookManager 13 | 14 | from handlers import handlers 15 | 16 | here = os.path.dirname(__file__) 17 | pjoin = os.path.join 18 | app_log = log.app_log 19 | log.enable_pretty_logging() 20 | 21 | threads = 10 22 | current_path = os.getcwd() 23 | default_template = 'full' 24 | 25 | 26 | def parse_arg(): 27 | parser = argparse.ArgumentParser() 28 | parser.add_argument('-t', '--template', default=default_template) 29 | parser.add_argument('-p', '--port', type=int, default=8000) 30 | return parser.parse_args() 31 | 32 | 33 | def main(): 34 | args = parse_arg() 35 | 36 | config = Config() 37 | if args.template != default_template: 38 | app_log.info("Using custom template: %s", args.template) 39 | config.HTMLExporter.template_file = args.template 40 | config.NbconvertApp.fileext = 'html' 41 | # config.CSSHTMLHeaderTransformer.enabled = False 42 | 43 | template_path = pjoin(here, 'templates') 44 | static_path = pjoin(here, 'static') 45 | document_path = current_path 46 | 47 | exporter = HTMLExporter(config=config, log=app_log) 48 | env = Environment(loader=FileSystemLoader(template_path)) 49 | env.filters['markdown'] = markdown.markdown 50 | 51 | # notebook 52 | notebook_manager = FileNotebookManager( 53 | notebook_dir=current_path, 54 | log=app_log 55 | ) 56 | 57 | settings = dict( 58 | jinja2_env=env, 59 | static_path=static_path, 60 | exporter=exporter, 61 | config=config, 62 | pool=ThreadPoolExecutor(threads), 63 | gzip=True, 64 | log=app_log, 65 | render_timeout=20, 66 | document_path=document_path, 67 | notebook_manager=notebook_manager, 68 | ) 69 | 70 | app = web.Application(handlers, debug=True, **settings) 71 | http_server = httpserver.HTTPServer(app, xheaders=True) 72 | app_log.info("Listening on port %i", args.port) 73 | http_server.listen(args.port) 74 | instance = ioloop.IOLoop.instance() 75 | tornado.autoreload.start(instance) 76 | instance.start() 77 | 78 | if __name__ == '__main__': 79 | main() 80 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/comment/continuecomment.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var modes = ["clike", "css", "javascript"]; 3 | 4 | for (var i = 0; i < modes.length; ++i) 5 | CodeMirror.extendMode(modes[i], {blockCommentContinue: " * "}); 6 | 7 | function continueComment(cm) { 8 | var pos = cm.getCursor(), token = cm.getTokenAt(pos); 9 | if (token.type != "comment" || cm.getOption("disableInput")) return CodeMirror.Pass; 10 | var mode = CodeMirror.innerMode(cm.getMode(), token.state).mode; 11 | 12 | var insert; 13 | if (mode.blockCommentStart && mode.blockCommentContinue) { 14 | var end = token.string.indexOf(mode.blockCommentEnd); 15 | var full = cm.getRange(CodeMirror.Pos(pos.line, 0), CodeMirror.Pos(pos.line, token.end)), found; 16 | if (end != -1 && end == token.string.length - mode.blockCommentEnd.length && pos.ch >= end) { 17 | // Comment ended, don't continue it 18 | } else if (token.string.indexOf(mode.blockCommentStart) == 0) { 19 | insert = full.slice(0, token.start); 20 | if (!/^\s*$/.test(insert)) { 21 | insert = ""; 22 | for (var i = 0; i < token.start; ++i) insert += " "; 23 | } 24 | } else if ((found = full.indexOf(mode.blockCommentContinue)) != -1 && 25 | found + mode.blockCommentContinue.length > token.start && 26 | /^\s*$/.test(full.slice(0, found))) { 27 | insert = full.slice(0, found); 28 | } 29 | if (insert != null) insert += mode.blockCommentContinue; 30 | } 31 | if (insert == null && mode.lineComment && continueLineCommentEnabled(cm)) { 32 | var line = cm.getLine(pos.line), found = line.indexOf(mode.lineComment); 33 | if (found > -1) { 34 | insert = line.slice(0, found); 35 | if (/\S/.test(insert)) insert = null; 36 | else insert += mode.lineComment + line.slice(found + mode.lineComment.length).match(/^\s*/)[0]; 37 | } 38 | } 39 | 40 | if (insert != null) 41 | cm.replaceSelection("\n" + insert, "end"); 42 | else 43 | return CodeMirror.Pass; 44 | } 45 | 46 | function continueLineCommentEnabled(cm) { 47 | var opt = cm.getOption("continueComments"); 48 | if (opt && typeof opt == "object") 49 | return opt.continueLineComment !== false; 50 | return true; 51 | } 52 | 53 | CodeMirror.defineOption("continueComments", null, function(cm, val, prev) { 54 | if (prev && prev != CodeMirror.Init) 55 | cm.removeKeyMap("continueComment"); 56 | if (val) { 57 | var key = "Enter"; 58 | if (typeof val == "string") 59 | key = val; 60 | else if (typeof val == "object" && val.key) 61 | key = val.key; 62 | var map = {name: "continueComment"}; 63 | map[key] = continueComment; 64 | cm.addKeyMap(map); 65 | } 66 | }); 67 | })(); 68 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/dialog/dialog.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-dialog { 2 | position: absolute; 3 | left: 0; right: 0; 4 | background: white; 5 | z-index: 15; 6 | padding: .1em .8em; 7 | overflow: hidden; 8 | color: #333; 9 | } 10 | 11 | .CodeMirror-dialog-top { 12 | border-bottom: 1px solid #eee; 13 | top: 0; 14 | } 15 | 16 | .CodeMirror-dialog-bottom { 17 | border-top: 1px solid #eee; 18 | bottom: 0; 19 | } 20 | 21 | .CodeMirror-dialog input { 22 | border: none; 23 | outline: none; 24 | background: transparent; 25 | width: 20em; 26 | color: inherit; 27 | font-family: monospace; 28 | } 29 | 30 | .CodeMirror-dialog button { 31 | font-size: 70%; 32 | } 33 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/display/fullscreen.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-fullscreen { 2 | position: fixed; 3 | top: 0; left: 0; right: 0; bottom: 0; 4 | height: auto; 5 | z-index: 9; 6 | } 7 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/display/fullscreen.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | 4 | CodeMirror.defineOption("fullScreen", false, function(cm, val, old) { 5 | if (old == CodeMirror.Init) old = false; 6 | if (!old == !val) return; 7 | if (val) setFullscreen(cm); 8 | else setNormal(cm); 9 | }); 10 | 11 | function setFullscreen(cm) { 12 | var wrap = cm.getWrapperElement(); 13 | cm.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, 14 | width: wrap.style.width, height: wrap.style.height}; 15 | wrap.style.width = ""; 16 | wrap.style.height = "auto"; 17 | wrap.className += " CodeMirror-fullscreen"; 18 | document.documentElement.style.overflow = "hidden"; 19 | cm.refresh(); 20 | } 21 | 22 | function setNormal(cm) { 23 | var wrap = cm.getWrapperElement(); 24 | wrap.className = wrap.className.replace(/\s*CodeMirror-fullscreen\b/, ""); 25 | document.documentElement.style.overflow = ""; 26 | var info = cm.state.fullScreenRestore; 27 | wrap.style.width = info.width; wrap.style.height = info.height; 28 | window.scrollTo(info.scrollLeft, info.scrollTop); 29 | cm.refresh(); 30 | } 31 | })(); 32 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/display/placeholder.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | CodeMirror.defineOption("placeholder", "", function(cm, val, old) { 3 | var prev = old && old != CodeMirror.Init; 4 | if (val && !prev) { 5 | cm.on("blur", onBlur); 6 | cm.on("change", onChange); 7 | onChange(cm); 8 | } else if (!val && prev) { 9 | cm.off("blur", onBlur); 10 | cm.off("change", onChange); 11 | clearPlaceholder(cm); 12 | var wrapper = cm.getWrapperElement(); 13 | wrapper.className = wrapper.className.replace(" CodeMirror-empty", ""); 14 | } 15 | 16 | if (val && !cm.hasFocus()) onBlur(cm); 17 | }); 18 | 19 | function clearPlaceholder(cm) { 20 | if (cm.state.placeholder) { 21 | cm.state.placeholder.parentNode.removeChild(cm.state.placeholder); 22 | cm.state.placeholder = null; 23 | } 24 | } 25 | function setPlaceholder(cm) { 26 | clearPlaceholder(cm); 27 | var elt = cm.state.placeholder = document.createElement("pre"); 28 | elt.style.cssText = "height: 0; overflow: visible"; 29 | elt.className = "CodeMirror-placeholder"; 30 | elt.appendChild(document.createTextNode(cm.getOption("placeholder"))); 31 | cm.display.lineSpace.insertBefore(elt, cm.display.lineSpace.firstChild); 32 | } 33 | 34 | function onBlur(cm) { 35 | if (isEmpty(cm)) setPlaceholder(cm); 36 | } 37 | function onChange(cm) { 38 | var wrapper = cm.getWrapperElement(), empty = isEmpty(cm); 39 | wrapper.className = wrapper.className.replace(" CodeMirror-empty", "") + (empty ? " CodeMirror-empty" : ""); 40 | 41 | if (empty) setPlaceholder(cm); 42 | else clearPlaceholder(cm); 43 | } 44 | 45 | function isEmpty(cm) { 46 | return (cm.lineCount() === 1) && (cm.getLine(0) === ""); 47 | } 48 | })(); 49 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/display/rulers.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | 4 | CodeMirror.defineOption("rulers", false, function(cm, val, old) { 5 | if (old && old != CodeMirror.Init) { 6 | clearRulers(cm); 7 | cm.off("refresh", refreshRulers); 8 | } 9 | if (val && val.length) { 10 | setRulers(cm); 11 | cm.on("refresh", refreshRulers); 12 | } 13 | }); 14 | 15 | function clearRulers(cm) { 16 | for (var i = cm.display.lineSpace.childNodes.length - 1; i >= 0; i--) { 17 | var node = cm.display.lineSpace.childNodes[i]; 18 | if (/(^|\s)CodeMirror-ruler($|\s)/.test(node.className)) 19 | node.parentNode.removeChild(node); 20 | } 21 | } 22 | 23 | function setRulers(cm) { 24 | var val = cm.getOption("rulers"); 25 | var cw = cm.defaultCharWidth(); 26 | var left = cm.charCoords(CodeMirror.Pos(cm.firstLine(), 0), "div").left; 27 | var bot = -cm.display.scroller.offsetHeight; 28 | for (var i = 0; i < val.length; i++) { 29 | var elt = document.createElement("div"); 30 | var col, cls = null; 31 | if (typeof val[i] == "number") { 32 | col = val[i]; 33 | } else { 34 | col = val[i].column; 35 | cls = val[i].className; 36 | } 37 | elt.className = "CodeMirror-ruler" + (cls ? " " + cls : ""); 38 | elt.style.cssText = "left: " + (left + col * cw) + "px; top: -50px; bottom: " + bot + "px"; 39 | cm.display.lineSpace.insertBefore(elt, cm.display.cursorDiv); 40 | } 41 | } 42 | 43 | function refreshRulers(cm) { 44 | clearRulers(cm); 45 | setRulers(cm); 46 | } 47 | })(); 48 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/edit/continuelist.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | 'use strict'; 3 | 4 | var listRE = /^(\s*)([*+-]|(\d+)\.)(\s*)/, 5 | unorderedBullets = '*+-'; 6 | 7 | CodeMirror.commands.newlineAndIndentContinueMarkdownList = function(cm) { 8 | if (cm.getOption("disableInput")) return CodeMirror.Pass; 9 | 10 | var pos = cm.getCursor(), 11 | inList = cm.getStateAfter(pos.line).list !== false, 12 | match; 13 | 14 | if (!inList || !(match = cm.getLine(pos.line).match(listRE))) { 15 | cm.execCommand('newlineAndIndent'); 16 | return; 17 | } 18 | 19 | var indent = match[1], after = match[4]; 20 | var bullet = unorderedBullets.indexOf(match[2]) >= 0 21 | ? match[2] 22 | : (parseInt(match[3], 10) + 1) + '.'; 23 | 24 | cm.replaceSelection('\n' + indent + bullet + after, 'end'); 25 | }; 26 | 27 | }()); 28 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/edit/matchtags.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | 4 | CodeMirror.defineOption("matchTags", false, function(cm, val, old) { 5 | if (old && old != CodeMirror.Init) { 6 | cm.off("cursorActivity", doMatchTags); 7 | cm.off("viewportChange", maybeUpdateMatch); 8 | clear(cm); 9 | } 10 | if (val) { 11 | cm.state.matchBothTags = typeof val == "object" && val.bothTags; 12 | cm.on("cursorActivity", doMatchTags); 13 | cm.on("viewportChange", maybeUpdateMatch); 14 | doMatchTags(cm); 15 | } 16 | }); 17 | 18 | function clear(cm) { 19 | if (cm.state.tagHit) cm.state.tagHit.clear(); 20 | if (cm.state.tagOther) cm.state.tagOther.clear(); 21 | cm.state.tagHit = cm.state.tagOther = null; 22 | } 23 | 24 | function doMatchTags(cm) { 25 | cm.state.failedTagMatch = false; 26 | cm.operation(function() { 27 | clear(cm); 28 | if (cm.somethingSelected()) return; 29 | var cur = cm.getCursor(), range = cm.getViewport(); 30 | range.from = Math.min(range.from, cur.line); range.to = Math.max(cur.line + 1, range.to); 31 | var match = CodeMirror.findMatchingTag(cm, cur, range); 32 | if (!match) return; 33 | if (cm.state.matchBothTags) { 34 | var hit = match.at == "open" ? match.open : match.close; 35 | if (hit) cm.state.tagHit = cm.markText(hit.from, hit.to, {className: "CodeMirror-matchingtag"}); 36 | } 37 | var other = match.at == "close" ? match.open : match.close; 38 | if (other) 39 | cm.state.tagOther = cm.markText(other.from, other.to, {className: "CodeMirror-matchingtag"}); 40 | else 41 | cm.state.failedTagMatch = true; 42 | }); 43 | } 44 | 45 | function maybeUpdateMatch(cm) { 46 | if (cm.state.failedTagMatch) doMatchTags(cm); 47 | } 48 | 49 | CodeMirror.commands.toMatchingTag = function(cm) { 50 | var found = CodeMirror.findMatchingTag(cm, cm.getCursor()); 51 | if (found) { 52 | var other = found.at == "close" ? found.open : found.close; 53 | if (other) cm.setSelection(other.to, other.from); 54 | } 55 | }; 56 | })(); 57 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/edit/trailingspace.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineOption("showTrailingSpace", false, function(cm, val, prev) { 2 | if (prev == CodeMirror.Init) prev = false; 3 | if (prev && !val) 4 | cm.removeOverlay("trailingspace"); 5 | else if (!prev && val) 6 | cm.addOverlay({ 7 | token: function(stream) { 8 | for (var l = stream.string.length, i = l; i && /\s/.test(stream.string.charAt(i - 1)); --i) {} 9 | if (i > stream.pos) { stream.pos = i; return null; } 10 | stream.pos = l; 11 | return "trailingspace"; 12 | }, 13 | name: "trailingspace" 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/fold/comment-fold.js: -------------------------------------------------------------------------------- 1 | CodeMirror.registerGlobalHelper("fold", "comment", function(mode) { 2 | return mode.blockCommentStart && mode.blockCommentEnd; 3 | }, function(cm, start) { 4 | var mode = cm.getModeAt(start), startToken = mode.blockCommentStart, endToken = mode.blockCommentEnd; 5 | if (!startToken || !endToken) return; 6 | var line = start.line, lineText = cm.getLine(line); 7 | 8 | var startCh; 9 | for (var at = start.ch, pass = 0;;) { 10 | var found = at <= 0 ? -1 : lineText.lastIndexOf(startToken, at - 1); 11 | if (found == -1) { 12 | if (pass == 1) return; 13 | pass = 1; 14 | at = lineText.length; 15 | continue; 16 | } 17 | if (pass == 1 && found < start.ch) return; 18 | if (/comment/.test(cm.getTokenTypeAt(CodeMirror.Pos(line, found + 1)))) { 19 | startCh = found + startToken.length; 20 | break; 21 | } 22 | at = found - 1; 23 | } 24 | 25 | var depth = 1, lastLine = cm.lastLine(), end, endCh; 26 | outer: for (var i = line; i <= lastLine; ++i) { 27 | var text = cm.getLine(i), pos = i == line ? startCh : 0; 28 | for (;;) { 29 | var nextOpen = text.indexOf(startToken, pos), nextClose = text.indexOf(endToken, pos); 30 | if (nextOpen < 0) nextOpen = text.length; 31 | if (nextClose < 0) nextClose = text.length; 32 | pos = Math.min(nextOpen, nextClose); 33 | if (pos == text.length) break; 34 | if (pos == nextOpen) ++depth; 35 | else if (!--depth) { end = i; endCh = pos; break outer; } 36 | ++pos; 37 | } 38 | } 39 | if (end == null || line == end && endCh == startCh) return; 40 | return {from: CodeMirror.Pos(line, startCh), 41 | to: CodeMirror.Pos(end, endCh)}; 42 | }); 43 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/fold/foldcode.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | 4 | function doFold(cm, pos, options, force) { 5 | var finder = options && (options.call ? options : options.rangeFinder); 6 | if (!finder) finder = CodeMirror.fold.auto; 7 | if (typeof pos == "number") pos = CodeMirror.Pos(pos, 0); 8 | var minSize = options && options.minFoldSize || 0; 9 | 10 | function getRange(allowFolded) { 11 | var range = finder(cm, pos); 12 | if (!range || range.to.line - range.from.line < minSize) return null; 13 | var marks = cm.findMarksAt(range.from); 14 | for (var i = 0; i < marks.length; ++i) { 15 | if (marks[i].__isFold && force !== "fold") { 16 | if (!allowFolded) return null; 17 | range.cleared = true; 18 | marks[i].clear(); 19 | } 20 | } 21 | return range; 22 | } 23 | 24 | var range = getRange(true); 25 | if (options && options.scanUp) while (!range && pos.line > cm.firstLine()) { 26 | pos = CodeMirror.Pos(pos.line - 1, 0); 27 | range = getRange(false); 28 | } 29 | if (!range || range.cleared || force === "unfold") return; 30 | 31 | var myWidget = makeWidget(options); 32 | CodeMirror.on(myWidget, "mousedown", function() { myRange.clear(); }); 33 | var myRange = cm.markText(range.from, range.to, { 34 | replacedWith: myWidget, 35 | clearOnEnter: true, 36 | __isFold: true 37 | }); 38 | myRange.on("clear", function(from, to) { 39 | CodeMirror.signal(cm, "unfold", cm, from, to); 40 | }); 41 | CodeMirror.signal(cm, "fold", cm, range.from, range.to); 42 | } 43 | 44 | function makeWidget(options) { 45 | var widget = (options && options.widget) || "\u2194"; 46 | if (typeof widget == "string") { 47 | var text = document.createTextNode(widget); 48 | widget = document.createElement("span"); 49 | widget.appendChild(text); 50 | widget.className = "CodeMirror-foldmarker"; 51 | } 52 | return widget; 53 | } 54 | 55 | // Clumsy backwards-compatible interface 56 | CodeMirror.newFoldFunction = function(rangeFinder, widget) { 57 | return function(cm, pos) { doFold(cm, pos, {rangeFinder: rangeFinder, widget: widget}); }; 58 | }; 59 | 60 | // New-style interface 61 | CodeMirror.defineExtension("foldCode", function(pos, options, force) { 62 | doFold(this, pos, options, force); 63 | }); 64 | 65 | CodeMirror.defineExtension("isFolded", function(pos) { 66 | var marks = this.findMarksAt(pos); 67 | for (var i = 0; i < marks.length; ++i) 68 | if (marks[i].__isFold) return true; 69 | }); 70 | 71 | CodeMirror.commands.fold = function(cm) { 72 | cm.foldCode(cm.getCursor()); 73 | }; 74 | 75 | CodeMirror.registerHelper("fold", "combine", function() { 76 | var funcs = Array.prototype.slice.call(arguments, 0); 77 | return function(cm, start) { 78 | for (var i = 0; i < funcs.length; ++i) { 79 | var found = funcs[i](cm, start); 80 | if (found) return found; 81 | } 82 | }; 83 | }); 84 | 85 | CodeMirror.registerHelper("fold", "auto", function(cm, start) { 86 | var helpers = cm.getHelpers(start, "fold"); 87 | for (var i = 0; i < helpers.length; i++) { 88 | var cur = helpers[i](cm, start); 89 | if (cur) return cur; 90 | } 91 | }); 92 | })(); 93 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/fold/foldgutter.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-foldmarker { 2 | color: blue; 3 | text-shadow: #b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px; 4 | font-family: arial; 5 | line-height: .3; 6 | cursor: pointer; 7 | } 8 | .CodeMirror-foldgutter { 9 | width: .7em; 10 | } 11 | .CodeMirror-foldgutter-open, 12 | .CodeMirror-foldgutter-folded { 13 | color: #555; 14 | cursor: pointer; 15 | } 16 | .CodeMirror-foldgutter-open:after { 17 | content: "\25BE"; 18 | } 19 | .CodeMirror-foldgutter-folded:after { 20 | content: "\25B8"; 21 | } 22 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/fold/indent-fold.js: -------------------------------------------------------------------------------- 1 | CodeMirror.registerHelper("fold", "indent", function(cm, start) { 2 | var tabSize = cm.getOption("tabSize"), firstLine = cm.getLine(start.line); 3 | if (!/\S/.test(firstLine)) return; 4 | var getIndent = function(line) { 5 | return CodeMirror.countColumn(line, null, tabSize); 6 | }; 7 | var myIndent = getIndent(firstLine); 8 | var lastLineInFold = null; 9 | // Go through lines until we find a line that definitely doesn't belong in 10 | // the block we're folding, or to the end. 11 | for (var i = start.line + 1, end = cm.lastLine(); i <= end; ++i) { 12 | var curLine = cm.getLine(i); 13 | var curIndent = getIndent(curLine); 14 | if (curIndent > myIndent) { 15 | // Lines with a greater indent are considered part of the block. 16 | lastLineInFold = i; 17 | } else if (!/\S/.test(curLine)) { 18 | // Empty lines might be breaks within the block we're trying to fold. 19 | } else { 20 | // A non-empty line at an indent equal to or less than ours marks the 21 | // start of another block. 22 | break; 23 | } 24 | } 25 | if (lastLineInFold) return { 26 | from: CodeMirror.Pos(start.line, firstLine.length), 27 | to: CodeMirror.Pos(lastLineInFold, cm.getLine(lastLineInFold).length) 28 | }; 29 | }); 30 | CodeMirror.indentRangeFinder = CodeMirror.fold.indent; // deprecated 31 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/fold/markdown-fold.js: -------------------------------------------------------------------------------- 1 | CodeMirror.registerHelper("fold", "markdown", function(cm, start) { 2 | var maxDepth = 100; 3 | 4 | function isHeader(lineNo) { 5 | var tokentype = cm.getTokenTypeAt(CodeMirror.Pos(lineNo, 0)); 6 | return tokentype && /\bheader\b/.test(tokentype); 7 | } 8 | 9 | function headerLevel(lineNo, line, nextLine) { 10 | var match = line && line.match(/^#+/); 11 | if (match && isHeader(lineNo)) return match[0].length; 12 | match = nextLine && nextLine.match(/^[=\-]+\s*$/); 13 | if (match && isHeader(lineNo + 1)) return nextLine[0] == "=" ? 1 : 2; 14 | return maxDepth; 15 | } 16 | 17 | var firstLine = cm.getLine(start.line), nextLine = cm.getLine(start.line + 1); 18 | var level = headerLevel(start.line, firstLine, nextLine); 19 | if (level === maxDepth) return undefined; 20 | 21 | var lastLineNo = cm.lastLine(); 22 | var end = start.line, nextNextLine = cm.getLine(end + 2); 23 | while (end < lastLineNo) { 24 | if (headerLevel(end + 1, nextLine, nextNextLine) <= level) break; 25 | ++end; 26 | nextLine = nextNextLine; 27 | nextNextLine = cm.getLine(end + 2); 28 | } 29 | 30 | return { 31 | from: CodeMirror.Pos(start.line, firstLine.length), 32 | to: CodeMirror.Pos(end, cm.getLine(end).length) 33 | }; 34 | }); 35 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/hint/anyword-hint.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | 4 | var WORD = /[\w$]+/, RANGE = 500; 5 | 6 | CodeMirror.registerHelper("hint", "anyword", function(editor, options) { 7 | var word = options && options.word || WORD; 8 | var range = options && options.range || RANGE; 9 | var cur = editor.getCursor(), curLine = editor.getLine(cur.line); 10 | var start = cur.ch, end = start; 11 | while (end < curLine.length && word.test(curLine.charAt(end))) ++end; 12 | while (start && word.test(curLine.charAt(start - 1))) --start; 13 | var curWord = start != end && curLine.slice(start, end); 14 | 15 | var list = [], seen = {}; 16 | var re = new RegExp(word.source, "g"); 17 | for (var dir = -1; dir <= 1; dir += 2) { 18 | var line = cur.line, endLine = Math.min(Math.max(line + dir * range, editor.firstLine()), editor.lastLine()) + dir; 19 | for (; line != endLine; line += dir) { 20 | var text = editor.getLine(line), m; 21 | while (m = re.exec(text)) { 22 | if (line == cur.line && m[0] === curWord) continue; 23 | if ((!curWord || m[0].lastIndexOf(curWord, 0) == 0) && !Object.prototype.hasOwnProperty.call(seen, m[0])) { 24 | seen[m[0]] = true; 25 | list.push(m[0]); 26 | } 27 | } 28 | } 29 | } 30 | return {list: list, from: CodeMirror.Pos(cur.line, start), to: CodeMirror.Pos(cur.line, end)}; 31 | }); 32 | })(); 33 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/hint/css-hint.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | "use strict"; 3 | 4 | var pseudoClasses = {link: 1, visited: 1, active: 1, hover: 1, focus: 1, 5 | "first-letter": 1, "first-line": 1, "first-child": 1, 6 | before: 1, after: 1, lang: 1}; 7 | 8 | CodeMirror.registerHelper("hint", "css", function(cm) { 9 | var cur = cm.getCursor(), token = cm.getTokenAt(cur); 10 | var inner = CodeMirror.innerMode(cm.getMode(), token.state); 11 | if (inner.mode.name != "css") return; 12 | 13 | var word = token.string, start = token.start, end = token.end; 14 | if (/[^\w$_-]/.test(word)) { 15 | word = ""; start = end = cur.ch; 16 | } 17 | 18 | var spec = CodeMirror.resolveMode("text/css"); 19 | 20 | var result = []; 21 | function add(keywords) { 22 | for (var name in keywords) 23 | if (!word || name.lastIndexOf(word, 0) == 0) 24 | result.push(name); 25 | } 26 | 27 | var st = token.state.state; 28 | if (st == "pseudo" || token.type == "variable-3") { 29 | add(pseudoClasses); 30 | } else if (st == "block" || st == "maybeprop") { 31 | add(spec.propertyKeywords); 32 | } else if (st == "prop" || st == "parens" || st == "at" || st == "params") { 33 | add(spec.valueKeywords); 34 | add(spec.colorKeywords); 35 | } else if (st == "media" || st == "media_parens") { 36 | add(spec.mediaTypes); 37 | add(spec.mediaFeatures); 38 | } 39 | 40 | if (result.length) return { 41 | list: result, 42 | from: CodeMirror.Pos(cur.line, start), 43 | to: CodeMirror.Pos(cur.line, end) 44 | }; 45 | }); 46 | })(); 47 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/hint/python-hint.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | function forEach(arr, f) { 3 | for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]); 4 | } 5 | 6 | function arrayContains(arr, item) { 7 | if (!Array.prototype.indexOf) { 8 | var i = arr.length; 9 | while (i--) { 10 | if (arr[i] === item) { 11 | return true; 12 | } 13 | } 14 | return false; 15 | } 16 | return arr.indexOf(item) != -1; 17 | } 18 | 19 | function scriptHint(editor, _keywords, getToken) { 20 | // Find the token at the cursor 21 | var cur = editor.getCursor(), token = getToken(editor, cur), tprop = token; 22 | // If it's not a 'word-style' token, ignore the token. 23 | 24 | if (!/^[\w$_]*$/.test(token.string)) { 25 | token = tprop = {start: cur.ch, end: cur.ch, string: "", state: token.state, 26 | className: token.string == ":" ? "python-type" : null}; 27 | } 28 | 29 | if (!context) var context = []; 30 | context.push(tprop); 31 | 32 | var completionList = getCompletions(token, context); 33 | completionList = completionList.sort(); 34 | 35 | return {list: completionList, 36 | from: CodeMirror.Pos(cur.line, token.start), 37 | to: CodeMirror.Pos(cur.line, token.end)}; 38 | } 39 | 40 | function pythonHint(editor) { 41 | return scriptHint(editor, pythonKeywordsU, function (e, cur) {return e.getTokenAt(cur);}); 42 | } 43 | CodeMirror.pythonHint = pythonHint; // deprecated 44 | CodeMirror.registerHelper("hint", "python", pythonHint); 45 | 46 | var pythonKeywords = "and del from not while as elif global or with assert else if pass yield" 47 | + "break except import print class exec in raise continue finally is return def for lambda try"; 48 | var pythonKeywordsL = pythonKeywords.split(" "); 49 | var pythonKeywordsU = pythonKeywords.toUpperCase().split(" "); 50 | 51 | var pythonBuiltins = "abs divmod input open staticmethod all enumerate int ord str " 52 | + "any eval isinstance pow sum basestring execfile issubclass print super" 53 | + "bin file iter property tuple bool filter len range type" 54 | + "bytearray float list raw_input unichr callable format locals reduce unicode" 55 | + "chr frozenset long reload vars classmethod getattr map repr xrange" 56 | + "cmp globals max reversed zip compile hasattr memoryview round __import__" 57 | + "complex hash min set apply delattr help next setattr buffer" 58 | + "dict hex object slice coerce dir id oct sorted intern "; 59 | var pythonBuiltinsL = pythonBuiltins.split(" ").join("() ").split(" "); 60 | var pythonBuiltinsU = pythonBuiltins.toUpperCase().split(" ").join("() ").split(" "); 61 | 62 | function getCompletions(token, context) { 63 | var found = [], start = token.string; 64 | function maybeAdd(str) { 65 | if (str.lastIndexOf(start, 0) == 0 && !arrayContains(found, str)) found.push(str); 66 | } 67 | 68 | function gatherCompletions(_obj) { 69 | forEach(pythonBuiltinsL, maybeAdd); 70 | forEach(pythonBuiltinsU, maybeAdd); 71 | forEach(pythonKeywordsL, maybeAdd); 72 | forEach(pythonKeywordsU, maybeAdd); 73 | } 74 | 75 | if (context) { 76 | // If this is a property, see if it belongs to some object we can 77 | // find in the current environment. 78 | var obj = context.pop(), base; 79 | 80 | if (obj.type == "variable") 81 | base = obj.string; 82 | else if(obj.type == "variable-3") 83 | base = ":" + obj.string; 84 | 85 | while (base != null && context.length) 86 | base = base[context.pop().string]; 87 | if (base != null) gatherCompletions(base); 88 | } 89 | return found; 90 | } 91 | })(); 92 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/hint/show-hint.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-hints { 2 | position: absolute; 3 | z-index: 10; 4 | overflow: hidden; 5 | list-style: none; 6 | 7 | margin: 0; 8 | padding: 2px; 9 | 10 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 11 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 12 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 13 | border-radius: 3px; 14 | border: 1px solid silver; 15 | 16 | background: white; 17 | font-size: 90%; 18 | font-family: monospace; 19 | 20 | max-height: 20em; 21 | overflow-y: auto; 22 | } 23 | 24 | .CodeMirror-hint { 25 | margin: 0; 26 | padding: 0 4px; 27 | border-radius: 2px; 28 | max-width: 19em; 29 | overflow: hidden; 30 | white-space: pre; 31 | color: black; 32 | cursor: pointer; 33 | } 34 | 35 | .CodeMirror-hint-active { 36 | background: #08f; 37 | color: white; 38 | } 39 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/hint/xml-hint.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | 4 | var Pos = CodeMirror.Pos; 5 | 6 | function getHints(cm, options) { 7 | var tags = options && options.schemaInfo; 8 | var quote = (options && options.quoteChar) || '"'; 9 | if (!tags) return; 10 | var cur = cm.getCursor(), token = cm.getTokenAt(cur); 11 | var inner = CodeMirror.innerMode(cm.getMode(), token.state); 12 | if (inner.mode.name != "xml") return; 13 | var result = [], replaceToken = false, prefix; 14 | var isTag = token.string.charAt(0) == "<"; 15 | if (!inner.state.tagName || isTag) { // Tag completion 16 | if (isTag) { 17 | prefix = token.string.slice(1); 18 | replaceToken = true; 19 | } 20 | var cx = inner.state.context, curTag = cx && tags[cx.tagName]; 21 | var childList = cx ? curTag && curTag.children : tags["!top"]; 22 | if (childList) { 23 | for (var i = 0; i < childList.length; ++i) if (!prefix || childList[i].lastIndexOf(prefix, 0) == 0) 24 | result.push("<" + childList[i]); 25 | } else { 26 | for (var name in tags) if (tags.hasOwnProperty(name) && name != "!top" && (!prefix || name.lastIndexOf(prefix, 0) == 0)) 27 | result.push("<" + name); 28 | } 29 | if (cx && (!prefix || ("/" + cx.tagName).lastIndexOf(prefix, 0) == 0)) 30 | result.push(""); 31 | } else { 32 | // Attribute completion 33 | var curTag = tags[inner.state.tagName], attrs = curTag && curTag.attrs; 34 | if (!attrs) return; 35 | if (token.type == "string" || token.string == "=") { // A value 36 | var before = cm.getRange(Pos(cur.line, Math.max(0, cur.ch - 60)), 37 | Pos(cur.line, token.type == "string" ? token.start : token.end)); 38 | var atName = before.match(/([^\s\u00a0=<>\"\']+)=$/), atValues; 39 | if (!atName || !attrs.hasOwnProperty(atName[1]) || !(atValues = attrs[atName[1]])) return; 40 | if (typeof atValues == 'function') atValues = atValues.call(this, cm); // Functions can be used to supply values for autocomplete widget 41 | if (token.type == "string") { 42 | prefix = token.string; 43 | if (/['"]/.test(token.string.charAt(0))) { 44 | quote = token.string.charAt(0); 45 | prefix = token.string.slice(1); 46 | } 47 | replaceToken = true; 48 | } 49 | for (var i = 0; i < atValues.length; ++i) if (!prefix || atValues[i].lastIndexOf(prefix, 0) == 0) 50 | result.push(quote + atValues[i] + quote); 51 | } else { // An attribute name 52 | if (token.type == "attribute") { 53 | prefix = token.string; 54 | replaceToken = true; 55 | } 56 | for (var attr in attrs) if (attrs.hasOwnProperty(attr) && (!prefix || attr.lastIndexOf(prefix, 0) == 0)) 57 | result.push(attr); 58 | } 59 | } 60 | return { 61 | list: result, 62 | from: replaceToken ? Pos(cur.line, token.start) : cur, 63 | to: replaceToken ? Pos(cur.line, token.end) : cur 64 | }; 65 | } 66 | 67 | CodeMirror.xmlHint = getHints; // deprecated 68 | CodeMirror.registerHelper("hint", "xml", getHints); 69 | })(); 70 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/lint/coffeescript-lint.js: -------------------------------------------------------------------------------- 1 | // Depends on coffeelint.js from http://www.coffeelint.org/js/coffeelint.js 2 | 3 | // declare global: coffeelint 4 | 5 | CodeMirror.registerHelper("lint", "coffeescript", function(text) { 6 | var found = []; 7 | var parseError = function(err) { 8 | var loc = err.lineNumber; 9 | found.push({from: CodeMirror.Pos(loc-1, 0), 10 | to: CodeMirror.Pos(loc, 0), 11 | severity: err.level, 12 | message: err.message}); 13 | }; 14 | try { 15 | var res = coffeelint.lint(text); 16 | for(var i = 0; i < res.length; i++) { 17 | parseError(res[i]); 18 | } 19 | } catch(e) { 20 | found.push({from: CodeMirror.Pos(e.location.first_line, 0), 21 | to: CodeMirror.Pos(e.location.last_line, e.location.last_column), 22 | severity: 'error', 23 | message: e.message}); 24 | } 25 | return found; 26 | }); 27 | CodeMirror.coffeeValidator = CodeMirror.lint.coffeescript; // deprecated 28 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/lint/css-lint.js: -------------------------------------------------------------------------------- 1 | // Depends on csslint.js from https://github.com/stubbornella/csslint 2 | 3 | // declare global: CSSLint 4 | 5 | CodeMirror.registerHelper("lint", "css", function(text) { 6 | var found = []; 7 | var results = CSSLint.verify(text), messages = results.messages, message = null; 8 | for ( var i = 0; i < messages.length; i++) { 9 | message = messages[i]; 10 | var startLine = message.line -1, endLine = message.line -1, startCol = message.col -1, endCol = message.col; 11 | found.push({ 12 | from: CodeMirror.Pos(startLine, startCol), 13 | to: CodeMirror.Pos(endLine, endCol), 14 | message: message.message, 15 | severity : message.type 16 | }); 17 | } 18 | return found; 19 | }); 20 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/lint/json-lint.js: -------------------------------------------------------------------------------- 1 | // Depends on jsonlint.js from https://github.com/zaach/jsonlint 2 | 3 | // declare global: jsonlint 4 | 5 | CodeMirror.registerHelper("lint", "json", function(text) { 6 | var found = []; 7 | jsonlint.parseError = function(str, hash) { 8 | var loc = hash.loc; 9 | found.push({from: CodeMirror.Pos(loc.first_line - 1, loc.first_column), 10 | to: CodeMirror.Pos(loc.last_line - 1, loc.last_column), 11 | message: str}); 12 | }; 13 | try { jsonlint.parse(text); } 14 | catch(e) {} 15 | return found; 16 | }); 17 | CodeMirror.jsonValidator = CodeMirror.lint.json; // deprecated 18 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/lint/lint.css: -------------------------------------------------------------------------------- 1 | /* The lint marker gutter */ 2 | .CodeMirror-lint-markers { 3 | width: 16px; 4 | } 5 | 6 | .CodeMirror-lint-tooltip { 7 | background-color: infobackground; 8 | border: 1px solid black; 9 | border-radius: 4px 4px 4px 4px; 10 | color: infotext; 11 | font-family: monospace; 12 | font-size: 10pt; 13 | overflow: hidden; 14 | padding: 2px 5px; 15 | position: fixed; 16 | white-space: pre; 17 | white-space: pre-wrap; 18 | z-index: 100; 19 | max-width: 600px; 20 | opacity: 0; 21 | transition: opacity .4s; 22 | -moz-transition: opacity .4s; 23 | -webkit-transition: opacity .4s; 24 | -o-transition: opacity .4s; 25 | -ms-transition: opacity .4s; 26 | } 27 | 28 | .CodeMirror-lint-mark-error, .CodeMirror-lint-mark-warning { 29 | background-position: left bottom; 30 | background-repeat: repeat-x; 31 | } 32 | 33 | .CodeMirror-lint-mark-error { 34 | background-image: 35 | url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==") 36 | ; 37 | } 38 | 39 | .CodeMirror-lint-mark-warning { 40 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII="); 41 | } 42 | 43 | .CodeMirror-lint-marker-error, .CodeMirror-lint-marker-warning { 44 | background-position: center center; 45 | background-repeat: no-repeat; 46 | cursor: pointer; 47 | display: inline-block; 48 | height: 16px; 49 | width: 16px; 50 | vertical-align: middle; 51 | position: relative; 52 | } 53 | 54 | .CodeMirror-lint-message-error, .CodeMirror-lint-message-warning { 55 | padding-left: 18px; 56 | background-position: top left; 57 | background-repeat: no-repeat; 58 | } 59 | 60 | .CodeMirror-lint-marker-error, .CodeMirror-lint-message-error { 61 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII="); 62 | } 63 | 64 | .CodeMirror-lint-marker-warning, .CodeMirror-lint-message-warning { 65 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII="); 66 | } 67 | 68 | .CodeMirror-lint-marker-multiple { 69 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC"); 70 | background-repeat: no-repeat; 71 | background-position: right bottom; 72 | width: 100%; height: 100%; 73 | } 74 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/lint/yaml-lint.js: -------------------------------------------------------------------------------- 1 | // Depends on js-yaml.js from https://github.com/nodeca/js-yaml 2 | 3 | // declare global: jsyaml 4 | 5 | CodeMirror.registerHelper("lint", "yaml", function(text) { 6 | var found = []; 7 | try { jsyaml.load(text); } 8 | catch(e) { 9 | var loc = e.mark; 10 | found.push({ from: CodeMirror.Pos(loc.line, loc.column), to: CodeMirror.Pos(loc.line, loc.column), message: e.message }); 11 | } 12 | return found; 13 | }); 14 | CodeMirror.yamlValidator = CodeMirror.lint.yaml; // deprecated 15 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/merge/merge.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-merge { 2 | position: relative; 3 | border: 1px solid #ddd; 4 | white-space: pre; 5 | } 6 | 7 | .CodeMirror-merge, .CodeMirror-merge .CodeMirror { 8 | height: 350px; 9 | } 10 | 11 | .CodeMirror-merge-2pane .CodeMirror-merge-pane { width: 47%; } 12 | .CodeMirror-merge-2pane .CodeMirror-merge-gap { width: 6%; } 13 | .CodeMirror-merge-3pane .CodeMirror-merge-pane { width: 31%; } 14 | .CodeMirror-merge-3pane .CodeMirror-merge-gap { width: 3.5%; } 15 | 16 | .CodeMirror-merge-pane { 17 | display: inline-block; 18 | white-space: normal; 19 | vertical-align: top; 20 | } 21 | .CodeMirror-merge-pane-rightmost { 22 | position: absolute; 23 | right: 0px; 24 | z-index: 1; 25 | } 26 | 27 | .CodeMirror-merge-gap { 28 | z-index: 2; 29 | display: inline-block; 30 | height: 100%; 31 | -moz-box-sizing: border-box; 32 | box-sizing: border-box; 33 | overflow: hidden; 34 | border-left: 1px solid #ddd; 35 | border-right: 1px solid #ddd; 36 | position: relative; 37 | background: #f8f8f8; 38 | } 39 | 40 | .CodeMirror-merge-scrolllock-wrap { 41 | position: absolute; 42 | bottom: 0; left: 50%; 43 | } 44 | .CodeMirror-merge-scrolllock { 45 | position: relative; 46 | left: -50%; 47 | cursor: pointer; 48 | color: #555; 49 | line-height: 1; 50 | } 51 | 52 | .CodeMirror-merge-copybuttons-left, .CodeMirror-merge-copybuttons-right { 53 | position: absolute; 54 | left: 0; top: 0; 55 | right: 0; bottom: 0; 56 | line-height: 1; 57 | } 58 | 59 | .CodeMirror-merge-copy { 60 | position: absolute; 61 | cursor: pointer; 62 | color: #44c; 63 | } 64 | 65 | .CodeMirror-merge-copybuttons-left .CodeMirror-merge-copy { left: 2px; } 66 | .CodeMirror-merge-copybuttons-right .CodeMirror-merge-copy { right: 2px; } 67 | 68 | .CodeMirror-merge-r-inserted, .CodeMirror-merge-l-inserted { 69 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12MwuCXy3+CWyH8GBgYGJgYkAABZbAQ9ELXurwAAAABJRU5ErkJggg==); 70 | background-position: bottom left; 71 | background-repeat: repeat-x; 72 | } 73 | 74 | .CodeMirror-merge-r-deleted, .CodeMirror-merge-l-deleted { 75 | background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAMAAAACCAYAAACddGYaAAAAGUlEQVQI12M4Kyb2/6yY2H8GBgYGJgYkAABURgPz6Ks7wQAAAABJRU5ErkJggg==); 76 | background-position: bottom left; 77 | background-repeat: repeat-x; 78 | } 79 | 80 | .CodeMirror-merge-r-chunk { background: #ffffe0; } 81 | .CodeMirror-merge-r-chunk-start { border-top: 1px solid #ee8; } 82 | .CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #ee8; } 83 | .CodeMirror-merge-r-connect { fill: #ffffe0; stroke: #ee8; stroke-width: 1px; } 84 | 85 | .CodeMirror-merge-l-chunk { background: #eef; } 86 | .CodeMirror-merge-l-chunk-start { border-top: 1px solid #88e; } 87 | .CodeMirror-merge-l-chunk-end { border-bottom: 1px solid #88e; } 88 | .CodeMirror-merge-l-connect { fill: #eef; stroke: #88e; stroke-width: 1px; } 89 | 90 | .CodeMirror-merge-l-chunk.CodeMirror-merge-r-chunk { background: #dfd; } 91 | .CodeMirror-merge-l-chunk-start.CodeMirror-merge-r-chunk-start { border-top: 1px solid #4e4; } 92 | .CodeMirror-merge-l-chunk-end.CodeMirror-merge-r-chunk-end { border-bottom: 1px solid #4e4; } 93 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/mode/loadmode.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | if (!CodeMirror.modeURL) CodeMirror.modeURL = "../mode/%N/%N.js"; 3 | 4 | var loading = {}; 5 | function splitCallback(cont, n) { 6 | var countDown = n; 7 | return function() { if (--countDown == 0) cont(); }; 8 | } 9 | function ensureDeps(mode, cont) { 10 | var deps = CodeMirror.modes[mode].dependencies; 11 | if (!deps) return cont(); 12 | var missing = []; 13 | for (var i = 0; i < deps.length; ++i) { 14 | if (!CodeMirror.modes.hasOwnProperty(deps[i])) 15 | missing.push(deps[i]); 16 | } 17 | if (!missing.length) return cont(); 18 | var split = splitCallback(cont, missing.length); 19 | for (var i = 0; i < missing.length; ++i) 20 | CodeMirror.requireMode(missing[i], split); 21 | } 22 | 23 | CodeMirror.requireMode = function(mode, cont) { 24 | if (typeof mode != "string") mode = mode.name; 25 | if (CodeMirror.modes.hasOwnProperty(mode)) return ensureDeps(mode, cont); 26 | if (loading.hasOwnProperty(mode)) return loading[mode].push(cont); 27 | 28 | var script = document.createElement("script"); 29 | script.src = CodeMirror.modeURL.replace(/%N/g, mode); 30 | var others = document.getElementsByTagName("script")[0]; 31 | others.parentNode.insertBefore(script, others); 32 | var list = loading[mode] = [cont]; 33 | var count = 0, poll = setInterval(function() { 34 | if (++count > 100) return clearInterval(poll); 35 | if (CodeMirror.modes.hasOwnProperty(mode)) { 36 | clearInterval(poll); 37 | loading[mode] = null; 38 | ensureDeps(mode, function() { 39 | for (var i = 0; i < list.length; ++i) list[i](); 40 | }); 41 | } 42 | }, 200); 43 | }; 44 | 45 | CodeMirror.autoLoadMode = function(instance, mode) { 46 | if (!CodeMirror.modes.hasOwnProperty(mode)) 47 | CodeMirror.requireMode(mode, function() { 48 | instance.setOption("mode", instance.getOption("mode")); 49 | }); 50 | }; 51 | }()); 52 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/mode/multiplex_test.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | CodeMirror.defineMode("markdown_with_stex", function(){ 3 | var inner = CodeMirror.getMode({}, "stex"); 4 | var outer = CodeMirror.getMode({}, "markdown"); 5 | 6 | var innerOptions = { 7 | open: '$', 8 | close: '$', 9 | mode: inner, 10 | delimStyle: 'delim', 11 | innerStyle: 'inner' 12 | }; 13 | 14 | return CodeMirror.multiplexingMode(outer, innerOptions); 15 | }); 16 | 17 | var mode = CodeMirror.getMode({}, "markdown_with_stex"); 18 | 19 | function MT(name) { 20 | test.mode( 21 | name, 22 | mode, 23 | Array.prototype.slice.call(arguments, 1), 24 | 'multiplexing'); 25 | } 26 | 27 | MT( 28 | "stexInsideMarkdown", 29 | "[strong **Equation:**] [delim $][inner&tag \\pi][delim $]"); 30 | })(); 31 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/mode/overlay.js: -------------------------------------------------------------------------------- 1 | // Utility function that allows modes to be combined. The mode given 2 | // as the base argument takes care of most of the normal mode 3 | // functionality, but a second (typically simple) mode is used, which 4 | // can override the style of text. Both modes get to parse all of the 5 | // text, but when both assign a non-null style to a piece of code, the 6 | // overlay wins, unless the combine argument was true, in which case 7 | // the styles are combined. 8 | 9 | // overlayParser is the old, deprecated name 10 | CodeMirror.overlayMode = CodeMirror.overlayParser = function(base, overlay, combine) { 11 | return { 12 | startState: function() { 13 | return { 14 | base: CodeMirror.startState(base), 15 | overlay: CodeMirror.startState(overlay), 16 | basePos: 0, baseCur: null, 17 | overlayPos: 0, overlayCur: null 18 | }; 19 | }, 20 | copyState: function(state) { 21 | return { 22 | base: CodeMirror.copyState(base, state.base), 23 | overlay: CodeMirror.copyState(overlay, state.overlay), 24 | basePos: state.basePos, baseCur: null, 25 | overlayPos: state.overlayPos, overlayCur: null 26 | }; 27 | }, 28 | 29 | token: function(stream, state) { 30 | if (stream.start == state.basePos) { 31 | state.baseCur = base.token(stream, state.base); 32 | state.basePos = stream.pos; 33 | } 34 | if (stream.start == state.overlayPos) { 35 | stream.pos = stream.start; 36 | state.overlayCur = overlay.token(stream, state.overlay); 37 | state.overlayPos = stream.pos; 38 | } 39 | stream.pos = Math.min(state.basePos, state.overlayPos); 40 | if (stream.eol()) state.basePos = state.overlayPos = 0; 41 | 42 | if (state.overlayCur == null) return state.baseCur; 43 | if (state.baseCur != null && combine) return state.baseCur + " " + state.overlayCur; 44 | else return state.overlayCur; 45 | }, 46 | 47 | indent: base.indent && function(state, textAfter) { 48 | return base.indent(state.base, textAfter); 49 | }, 50 | electricChars: base.electricChars, 51 | 52 | innerMode: function(state) { return {state: state.base, mode: base}; }, 53 | 54 | blankLine: function(state) { 55 | if (base.blankLine) base.blankLine(state.base); 56 | if (overlay.blankLine) overlay.blankLine(state.overlay); 57 | } 58 | }; 59 | }; 60 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/runmode/colorize.js: -------------------------------------------------------------------------------- 1 | CodeMirror.colorize = (function() { 2 | 3 | var isBlock = /^(p|li|div|h\\d|pre|blockquote|td)$/; 4 | 5 | function textContent(node, out) { 6 | if (node.nodeType == 3) return out.push(node.nodeValue); 7 | for (var ch = node.firstChild; ch; ch = ch.nextSibling) { 8 | textContent(ch, out); 9 | if (isBlock.test(node.nodeType)) out.push("\n"); 10 | } 11 | } 12 | 13 | return function(collection, defaultMode) { 14 | if (!collection) collection = document.body.getElementsByTagName("pre"); 15 | 16 | for (var i = 0; i < collection.length; ++i) { 17 | var node = collection[i]; 18 | var mode = node.getAttribute("data-lang") || defaultMode; 19 | if (!mode) continue; 20 | 21 | var text = []; 22 | textContent(node, text); 23 | node.innerHTML = ""; 24 | CodeMirror.runMode(text.join(""), mode, node); 25 | 26 | node.className += " cm-s-default"; 27 | } 28 | }; 29 | })(); 30 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/runmode/runmode.js: -------------------------------------------------------------------------------- 1 | CodeMirror.runMode = function(string, modespec, callback, options) { 2 | var mode = CodeMirror.getMode(CodeMirror.defaults, modespec); 3 | var ie = /MSIE \d/.test(navigator.userAgent); 4 | var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9); 5 | 6 | if (callback.nodeType == 1) { 7 | var tabSize = (options && options.tabSize) || CodeMirror.defaults.tabSize; 8 | var node = callback, col = 0; 9 | node.innerHTML = ""; 10 | callback = function(text, style) { 11 | if (text == "\n") { 12 | // Emitting LF or CRLF on IE8 or earlier results in an incorrect display. 13 | // Emitting a carriage return makes everything ok. 14 | node.appendChild(document.createTextNode(ie_lt9 ? '\r' : text)); 15 | col = 0; 16 | return; 17 | } 18 | var content = ""; 19 | // replace tabs 20 | for (var pos = 0;;) { 21 | var idx = text.indexOf("\t", pos); 22 | if (idx == -1) { 23 | content += text.slice(pos); 24 | col += text.length - pos; 25 | break; 26 | } else { 27 | col += idx - pos; 28 | content += text.slice(pos, idx); 29 | var size = tabSize - col % tabSize; 30 | col += size; 31 | for (var i = 0; i < size; ++i) content += " "; 32 | pos = idx + 1; 33 | } 34 | } 35 | 36 | if (style) { 37 | var sp = node.appendChild(document.createElement("span")); 38 | sp.className = "cm-" + style.replace(/ +/g, " cm-"); 39 | sp.appendChild(document.createTextNode(content)); 40 | } else { 41 | node.appendChild(document.createTextNode(content)); 42 | } 43 | }; 44 | } 45 | 46 | var lines = CodeMirror.splitLines(string), state = (options && options.state) || CodeMirror.startState(mode); 47 | for (var i = 0, e = lines.length; i < e; ++i) { 48 | if (i) callback("\n"); 49 | var stream = new CodeMirror.StringStream(lines[i]); 50 | while (!stream.eol()) { 51 | var style = mode.token(stream, state); 52 | callback(stream.current(), style, i, stream.start, state); 53 | stream.start = stream.pos; 54 | } 55 | } 56 | }; 57 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/scroll/scrollpastend.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | 4 | CodeMirror.defineOption("scrollPastEnd", false, function(cm, val, old) { 5 | if (old && old != CodeMirror.Init) { 6 | cm.off("change", onChange); 7 | cm.off("refresh", updateBottomMargin); 8 | cm.display.lineSpace.parentNode.style.paddingBottom = ""; 9 | cm.state.scrollPastEndPadding = null; 10 | } 11 | if (val) { 12 | cm.on("change", onChange); 13 | cm.on("refresh", updateBottomMargin); 14 | updateBottomMargin(cm); 15 | } 16 | }); 17 | 18 | function onChange(cm, change) { 19 | if (CodeMirror.changeEnd(change).line == cm.lastLine()) 20 | updateBottomMargin(cm); 21 | } 22 | 23 | function updateBottomMargin(cm) { 24 | var padding = ""; 25 | if (cm.lineCount() > 1) { 26 | var totalH = cm.display.scroller.clientHeight - 30, 27 | lastLineH = cm.getLineHandle(cm.lastLine()).height; 28 | padding = (totalH - lastLineH) + "px"; 29 | } 30 | if (cm.state.scrollPastEndPadding != padding) { 31 | cm.state.scrollPastEndPadding = padding; 32 | cm.display.lineSpace.parentNode.style.paddingBottom = padding; 33 | cm.setSize(); 34 | } 35 | } 36 | })(); 37 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/selection/active-line.js: -------------------------------------------------------------------------------- 1 | // Because sometimes you need to style the cursor's line. 2 | // 3 | // Adds an option 'styleActiveLine' which, when enabled, gives the 4 | // active line's wrapping
the CSS class "CodeMirror-activeline", 5 | // and gives its background
the class "CodeMirror-activeline-background". 6 | 7 | (function() { 8 | "use strict"; 9 | var WRAP_CLASS = "CodeMirror-activeline"; 10 | var BACK_CLASS = "CodeMirror-activeline-background"; 11 | 12 | CodeMirror.defineOption("styleActiveLine", false, function(cm, val, old) { 13 | var prev = old && old != CodeMirror.Init; 14 | if (val && !prev) { 15 | updateActiveLine(cm, cm.getCursor().line); 16 | cm.on("beforeSelectionChange", selectionChange); 17 | } else if (!val && prev) { 18 | cm.off("beforeSelectionChange", selectionChange); 19 | clearActiveLine(cm); 20 | delete cm.state.activeLine; 21 | } 22 | }); 23 | 24 | function clearActiveLine(cm) { 25 | if ("activeLine" in cm.state) { 26 | cm.removeLineClass(cm.state.activeLine, "wrap", WRAP_CLASS); 27 | cm.removeLineClass(cm.state.activeLine, "background", BACK_CLASS); 28 | } 29 | } 30 | 31 | function updateActiveLine(cm, selectedLine) { 32 | var line = cm.getLineHandleVisualStart(selectedLine); 33 | if (cm.state.activeLine == line) return; 34 | cm.operation(function() { 35 | clearActiveLine(cm); 36 | cm.addLineClass(line, "wrap", WRAP_CLASS); 37 | cm.addLineClass(line, "background", BACK_CLASS); 38 | cm.state.activeLine = line; 39 | }); 40 | } 41 | 42 | function selectionChange(cm, sel) { 43 | updateActiveLine(cm, sel.head.line); 44 | } 45 | })(); 46 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/tern/tern.css: -------------------------------------------------------------------------------- 1 | .CodeMirror-Tern-completion { 2 | padding-left: 22px; 3 | position: relative; 4 | } 5 | .CodeMirror-Tern-completion:before { 6 | position: absolute; 7 | left: 2px; 8 | bottom: 2px; 9 | border-radius: 50%; 10 | font-size: 12px; 11 | font-weight: bold; 12 | height: 15px; 13 | width: 15px; 14 | line-height: 16px; 15 | text-align: center; 16 | color: white; 17 | -moz-box-sizing: border-box; 18 | box-sizing: border-box; 19 | } 20 | .CodeMirror-Tern-completion-unknown:before { 21 | content: "?"; 22 | background: #4bb; 23 | } 24 | .CodeMirror-Tern-completion-object:before { 25 | content: "O"; 26 | background: #77c; 27 | } 28 | .CodeMirror-Tern-completion-fn:before { 29 | content: "F"; 30 | background: #7c7; 31 | } 32 | .CodeMirror-Tern-completion-array:before { 33 | content: "A"; 34 | background: #c66; 35 | } 36 | .CodeMirror-Tern-completion-number:before { 37 | content: "1"; 38 | background: #999; 39 | } 40 | .CodeMirror-Tern-completion-string:before { 41 | content: "S"; 42 | background: #999; 43 | } 44 | .CodeMirror-Tern-completion-bool:before { 45 | content: "B"; 46 | background: #999; 47 | } 48 | 49 | .CodeMirror-Tern-completion-guess { 50 | color: #999; 51 | } 52 | 53 | .CodeMirror-Tern-tooltip { 54 | border: 1px solid silver; 55 | border-radius: 3px; 56 | color: #444; 57 | padding: 2px 5px; 58 | font-size: 90%; 59 | font-family: monospace; 60 | background-color: white; 61 | white-space: pre-wrap; 62 | 63 | max-width: 40em; 64 | position: absolute; 65 | z-index: 10; 66 | -webkit-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 67 | -moz-box-shadow: 2px 3px 5px rgba(0,0,0,.2); 68 | box-shadow: 2px 3px 5px rgba(0,0,0,.2); 69 | 70 | transition: opacity 1s; 71 | -moz-transition: opacity 1s; 72 | -webkit-transition: opacity 1s; 73 | -o-transition: opacity 1s; 74 | -ms-transition: opacity 1s; 75 | } 76 | 77 | .CodeMirror-Tern-hint-doc { 78 | max-width: 25em; 79 | } 80 | 81 | .CodeMirror-Tern-fname { color: black; } 82 | .CodeMirror-Tern-farg { color: #70a; } 83 | .CodeMirror-Tern-farg-current { text-decoration: underline; } 84 | .CodeMirror-Tern-type { color: #07c; } 85 | .CodeMirror-Tern-fhint-guess { opacity: .7; } 86 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/addon/tern/worker.js: -------------------------------------------------------------------------------- 1 | // declare global: tern, server 2 | 3 | var server; 4 | 5 | this.onmessage = function(e) { 6 | var data = e.data; 7 | switch (data.type) { 8 | case "init": return startServer(data.defs, data.plugins, data.scripts); 9 | case "add": return server.addFile(data.name, data.text); 10 | case "del": return server.delFile(data.name); 11 | case "req": return server.request(data.body, function(err, reqData) { 12 | postMessage({id: data.id, body: reqData, err: err && String(err)}); 13 | }); 14 | case "getFile": 15 | var c = pending[data.id]; 16 | delete pending[data.id]; 17 | return c(data.err, data.text); 18 | default: throw new Error("Unknown message type: " + data.type); 19 | } 20 | }; 21 | 22 | var nextId = 0, pending = {}; 23 | function getFile(file, c) { 24 | postMessage({type: "getFile", name: file, id: ++nextId}); 25 | pending[nextId] = c; 26 | } 27 | 28 | function startServer(defs, plugins, scripts) { 29 | if (scripts) importScripts.apply(null, scripts); 30 | 31 | server = new tern.Server({ 32 | getFile: getFile, 33 | async: true, 34 | defs: defs, 35 | plugins: plugins 36 | }); 37 | } 38 | 39 | var console = { 40 | log: function(v) { postMessage({type: "debug", message: v}); } 41 | }; 42 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/keymap/extra.js: -------------------------------------------------------------------------------- 1 | // A number of additional default bindings that are too obscure to 2 | // include in the core codemirror.js file. 3 | 4 | (function() { 5 | "use strict"; 6 | 7 | var Pos = CodeMirror.Pos; 8 | 9 | function moveLines(cm, start, end, dist) { 10 | if (!dist || start > end) return 0; 11 | 12 | var from = cm.clipPos(Pos(start, 0)), to = cm.clipPos(Pos(end)); 13 | var text = cm.getRange(from, to); 14 | 15 | if (start <= cm.firstLine()) 16 | cm.replaceRange("", from, Pos(to.line + 1, 0)); 17 | else 18 | cm.replaceRange("", Pos(from.line - 1), to); 19 | var target = from.line + dist; 20 | if (target <= cm.firstLine()) { 21 | cm.replaceRange(text + "\n", Pos(target, 0)); 22 | return cm.firstLine() - from.line; 23 | } else { 24 | var targetPos = cm.clipPos(Pos(target - 1)); 25 | cm.replaceRange("\n" + text, targetPos); 26 | return targetPos.line + 1 - from.line; 27 | } 28 | } 29 | 30 | function moveSelectedLines(cm, dist) { 31 | var head = cm.getCursor("head"), anchor = cm.getCursor("anchor"); 32 | cm.operation(function() { 33 | var moved = moveLines(cm, Math.min(head.line, anchor.line), Math.max(head.line, anchor.line), dist); 34 | cm.setSelection(Pos(anchor.line + moved, anchor.ch), Pos(head.line + moved, head.ch)); 35 | }); 36 | } 37 | 38 | CodeMirror.commands.moveLinesUp = function(cm) { moveSelectedLines(cm, -1); }; 39 | CodeMirror.commands.moveLinesDown = function(cm) { moveSelectedLines(cm, 1); }; 40 | 41 | CodeMirror.keyMap["default"]["Alt-Up"] = "moveLinesUp"; 42 | CodeMirror.keyMap["default"]["Alt-Down"] = "moveLinesDown"; 43 | })(); 44 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/css/less_test.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | "use strict"; 3 | 4 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-less"); 5 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "less"); } 6 | 7 | MT("variable", 8 | "[variable-2 @base]: [atom #f04615];", 9 | "[qualifier .class] {", 10 | " [property width]: [variable percentage]([number 0.5]); [comment // returns `50%`]", 11 | " [property color]: [variable saturate]([variable-2 @base], [number 5%]);", 12 | "}"); 13 | 14 | MT("amp", 15 | "[qualifier .child], [qualifier .sibling] {", 16 | " [qualifier .parent] [atom &] {", 17 | " [property color]: [keyword black];", 18 | " }", 19 | " [atom &] + [atom &] {", 20 | " [property color]: [keyword red];", 21 | " }", 22 | "}"); 23 | 24 | MT("mixin", 25 | "[qualifier .mixin] ([variable dark]; [variable-2 @color]) {", 26 | " [property color]: [variable darken]([variable-2 @color], [number 10%]);", 27 | "}", 28 | "[qualifier .mixin] ([variable light]; [variable-2 @color]) {", 29 | " [property color]: [variable lighten]([variable-2 @color], [number 10%]);", 30 | "}", 31 | "[qualifier .mixin] ([variable-2 @_]; [variable-2 @color]) {", 32 | " [property display]: [atom block];", 33 | "}", 34 | "[variable-2 @switch]: [variable light];", 35 | "[qualifier .class] {", 36 | " [qualifier .mixin]([variable-2 @switch]; [atom #888]);", 37 | "}"); 38 | 39 | MT("nest", 40 | "[qualifier .one] {", 41 | " [def @media] ([property width]: [number 400px]) {", 42 | " [property font-size]: [number 1.2em];", 43 | " [def @media] [attribute print] [keyword and] [property color] {", 44 | " [property color]: [keyword blue];", 45 | " }", 46 | " }", 47 | "}"); 48 | })(); 49 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/css/scss_test.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var mode = CodeMirror.getMode({indentUnit: 2}, "text/x-scss"); 3 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), "scss"); } 4 | 5 | MT('url_with_quotation', 6 | "[tag foo] { [property background]:[atom url]([string test.jpg]) }"); 7 | 8 | MT('url_with_double_quotes', 9 | "[tag foo] { [property background]:[atom url]([string \"test.jpg\"]) }"); 10 | 11 | MT('url_with_single_quotes', 12 | "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) }"); 13 | 14 | MT('string', 15 | "[def @import] [string \"compass/css3\"]"); 16 | 17 | MT('important_keyword', 18 | "[tag foo] { [property background]:[atom url]([string \'test.jpg\']) [keyword !important] }"); 19 | 20 | MT('variable', 21 | "[variable-2 $blue]:[atom #333]"); 22 | 23 | MT('variable_as_attribute', 24 | "[tag foo] { [property color]:[variable-2 $blue] }"); 25 | 26 | MT('numbers', 27 | "[tag foo] { [property padding]:[number 10px] [number 10] [number 10em] [number 8in] }"); 28 | 29 | MT('number_percentage', 30 | "[tag foo] { [property width]:[number 80%] }"); 31 | 32 | MT('selector', 33 | "[builtin #hello][qualifier .world]{}"); 34 | 35 | MT('singleline_comment', 36 | "[comment // this is a comment]"); 37 | 38 | MT('multiline_comment', 39 | "[comment /*foobar*/]"); 40 | 41 | MT('attribute_with_hyphen', 42 | "[tag foo] { [property font-size]:[number 10px] }"); 43 | 44 | MT('string_after_attribute', 45 | "[tag foo] { [property content]:[string \"::\"] }"); 46 | 47 | MT('directives', 48 | "[def @include] [qualifier .mixin]"); 49 | 50 | MT('basic_structure', 51 | "[tag p] { [property background]:[keyword red]; }"); 52 | 53 | MT('nested_structure', 54 | "[tag p] { [tag a] { [property color]:[keyword red]; } }"); 55 | 56 | MT('mixin', 57 | "[def @mixin] [tag table-base] {}"); 58 | 59 | MT('number_without_semicolon', 60 | "[tag p] {[property width]:[number 12]}", 61 | "[tag a] {[property color]:[keyword red];}"); 62 | 63 | MT('atom_in_nested_block', 64 | "[tag p] { [tag a] { [property color]:[atom #000]; } }"); 65 | 66 | MT('interpolation_in_property', 67 | "[tag foo] { #{[variable-2 $hello]}:[number 2]; }"); 68 | 69 | MT('interpolation_in_selector', 70 | "[tag foo]#{[variable-2 $hello]} { [property color]:[atom #000]; }"); 71 | 72 | MT('interpolation_error', 73 | "[tag foo]#{[error foo]} { [property color]:[atom #000]; }"); 74 | 75 | MT("divide_operator", 76 | "[tag foo] { [property width]:[number 4] [operator /] [number 2] }"); 77 | 78 | MT('nested_structure_with_id_selector', 79 | "[tag p] { [builtin #hello] { [property color]:[keyword red]; } }"); 80 | 81 | MT('indent_mixin', 82 | "[def @mixin] [tag container] (", 83 | " [variable-2 $a]: [number 10],", 84 | " [variable-2 $b]: [number 10])", 85 | "{}"); 86 | 87 | MT('indent_nested', 88 | "[tag foo] {", 89 | " [tag bar] {", 90 | " }", 91 | "}"); 92 | 93 | MT('indent_parentheses', 94 | "[tag foo] {", 95 | " [property color]: [variable darken]([variable-2 $blue],", 96 | " [number 9%]);", 97 | "}"); 98 | 99 | MT('indent_vardef', 100 | "[variable-2 $name]:", 101 | " [string 'val'];", 102 | "[tag tag] {", 103 | " [tag inner] {", 104 | " [property margin]: [number 3px];", 105 | " }", 106 | "}"); 107 | })(); 108 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/diff/diff.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("diff", function() { 2 | 3 | var TOKEN_NAMES = { 4 | '+': 'positive', 5 | '-': 'negative', 6 | '@': 'meta' 7 | }; 8 | 9 | return { 10 | token: function(stream) { 11 | var tw_pos = stream.string.search(/[\t ]+?$/); 12 | 13 | if (!stream.sol() || tw_pos === 0) { 14 | stream.skipToEnd(); 15 | return ("error " + ( 16 | TOKEN_NAMES[stream.string.charAt(0)] || '')).replace(/ $/, ''); 17 | } 18 | 19 | var token_name = TOKEN_NAMES[stream.peek()] || stream.skipToEnd(); 20 | 21 | if (tw_pos === -1) { 22 | stream.skipToEnd(); 23 | } else { 24 | stream.pos = tw_pos; 25 | } 26 | 27 | return token_name; 28 | } 29 | }; 30 | }); 31 | 32 | CodeMirror.defineMIME("text/x-diff", "diff"); 33 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/gfm/gfm.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("gfm", function(config, modeConfig) { 2 | var codeDepth = 0; 3 | function blankLine(state) { 4 | state.code = false; 5 | return null; 6 | } 7 | var gfmOverlay = { 8 | startState: function() { 9 | return { 10 | code: false, 11 | codeBlock: false, 12 | ateSpace: false 13 | }; 14 | }, 15 | copyState: function(s) { 16 | return { 17 | code: s.code, 18 | codeBlock: s.codeBlock, 19 | ateSpace: s.ateSpace 20 | }; 21 | }, 22 | token: function(stream, state) { 23 | // Hack to prevent formatting override inside code blocks (block and inline) 24 | if (state.codeBlock) { 25 | if (stream.match(/^```/)) { 26 | state.codeBlock = false; 27 | return null; 28 | } 29 | stream.skipToEnd(); 30 | return null; 31 | } 32 | if (stream.sol()) { 33 | state.code = false; 34 | } 35 | if (stream.sol() && stream.match(/^```/)) { 36 | stream.skipToEnd(); 37 | state.codeBlock = true; 38 | return null; 39 | } 40 | // If this block is changed, it may need to be updated in Markdown mode 41 | if (stream.peek() === '`') { 42 | stream.next(); 43 | var before = stream.pos; 44 | stream.eatWhile('`'); 45 | var difference = 1 + stream.pos - before; 46 | if (!state.code) { 47 | codeDepth = difference; 48 | state.code = true; 49 | } else { 50 | if (difference === codeDepth) { // Must be exact 51 | state.code = false; 52 | } 53 | } 54 | return null; 55 | } else if (state.code) { 56 | stream.next(); 57 | return null; 58 | } 59 | // Check if space. If so, links can be formatted later on 60 | if (stream.eatSpace()) { 61 | state.ateSpace = true; 62 | return null; 63 | } 64 | if (stream.sol() || state.ateSpace) { 65 | state.ateSpace = false; 66 | if(stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/)) { 67 | // User/Project@SHA 68 | // User@SHA 69 | // SHA 70 | return "link"; 71 | } else if (stream.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/)) { 72 | // User/Project#Num 73 | // User#Num 74 | // #Num 75 | return "link"; 76 | } 77 | } 78 | if (stream.match(/^((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i) && 79 | stream.string.slice(stream.start - 2, stream.start) != "](") { 80 | // URLs 81 | // Taken from http://daringfireball.net/2010/07/improved_regex_for_matching_urls 82 | // And then (issue #1160) simplified to make it not crash the Chrome Regexp engine 83 | return "link"; 84 | } 85 | stream.next(); 86 | return null; 87 | }, 88 | blankLine: blankLine 89 | }; 90 | 91 | var markdownConfig = { 92 | underscoresBreakWords: false, 93 | taskLists: true, 94 | fencedCodeBlocks: true 95 | }; 96 | for (var attr in modeConfig) { 97 | markdownConfig[attr] = modeConfig[attr]; 98 | } 99 | markdownConfig.name = "markdown"; 100 | CodeMirror.defineMIME("gfmBase", markdownConfig); 101 | return CodeMirror.overlayMode(CodeMirror.getMode(config, "gfmBase"), gfmOverlay); 102 | }, "markdown"); 103 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/haml/test.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "haml"); 3 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 4 | 5 | // Requires at least one media query 6 | MT("elementName", 7 | "[tag %h1] Hey There"); 8 | 9 | MT("oneElementPerLine", 10 | "[tag %h1] Hey There %h2"); 11 | 12 | MT("idSelector", 13 | "[tag %h1][attribute #test] Hey There"); 14 | 15 | MT("classSelector", 16 | "[tag %h1][attribute .hello] Hey There"); 17 | 18 | MT("docType", 19 | "[tag !!! XML]"); 20 | 21 | MT("comment", 22 | "[comment / Hello WORLD]"); 23 | 24 | MT("notComment", 25 | "[tag %h1] This is not a / comment "); 26 | 27 | MT("attributes", 28 | "[tag %a]([variable title][operator =][string \"test\"]){[atom :title] [operator =>] [string \"test\"]}"); 29 | 30 | MT("htmlCode", 31 | "[tag

]Title[tag

]"); 32 | 33 | MT("rubyBlock", 34 | "[operator =][variable-2 @item]"); 35 | 36 | MT("selectorRubyBlock", 37 | "[tag %a.selector=] [variable-2 @item]"); 38 | 39 | MT("nestedRubyBlock", 40 | "[tag %a]", 41 | " [operator =][variable puts] [string \"test\"]"); 42 | 43 | MT("multilinePlaintext", 44 | "[tag %p]", 45 | " Hello,", 46 | " World"); 47 | 48 | MT("multilineRuby", 49 | "[tag %p]", 50 | " [comment -# this is a comment]", 51 | " [comment and this is a comment too]", 52 | " Date/Time", 53 | " [operator -] [variable now] [operator =] [tag DateTime][operator .][variable now]", 54 | " [tag %strong=] [variable now]", 55 | " [operator -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][variable parse]([string \"December 31, 2006\"])", 56 | " [operator =][string \"Happy\"]", 57 | " [operator =][string \"Belated\"]", 58 | " [operator =][string \"Birthday\"]"); 59 | 60 | MT("multilineComment", 61 | "[comment /]", 62 | " [comment Multiline]", 63 | " [comment Comment]"); 64 | 65 | MT("hamlComment", 66 | "[comment -# this is a comment]"); 67 | 68 | MT("multilineHamlComment", 69 | "[comment -# this is a comment]", 70 | " [comment and this is a comment too]"); 71 | 72 | MT("multilineHTMLComment", 73 | "[comment ]"); 76 | 77 | MT("hamlAfterRubyTag", 78 | "[attribute .block]", 79 | " [tag %strong=] [variable now]", 80 | " [attribute .test]", 81 | " [operator =][variable now]", 82 | " [attribute .right]"); 83 | 84 | MT("stretchedRuby", 85 | "[operator =] [variable puts] [string \"Hello\"],", 86 | " [string \"World\"]"); 87 | 88 | MT("interpolationInHashAttribute", 89 | //"[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test"); 90 | "[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test"); 91 | 92 | MT("interpolationInHTMLAttribute", 93 | "[tag %div]([variable title][operator =][string \"#{][variable test][string }_#{][variable ting]()[string }\"]) Test"); 94 | })(); 95 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/htmlembedded/htmlembedded.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("htmlembedded", function(config, parserConfig) { 2 | 3 | //config settings 4 | var scriptStartRegex = parserConfig.scriptStartRegex || /^<%/i, 5 | scriptEndRegex = parserConfig.scriptEndRegex || /^%>/i; 6 | 7 | //inner modes 8 | var scriptingMode, htmlMixedMode; 9 | 10 | //tokenizer when in html mode 11 | function htmlDispatch(stream, state) { 12 | if (stream.match(scriptStartRegex, false)) { 13 | state.token=scriptingDispatch; 14 | return scriptingMode.token(stream, state.scriptState); 15 | } 16 | else 17 | return htmlMixedMode.token(stream, state.htmlState); 18 | } 19 | 20 | //tokenizer when in scripting mode 21 | function scriptingDispatch(stream, state) { 22 | if (stream.match(scriptEndRegex, false)) { 23 | state.token=htmlDispatch; 24 | return htmlMixedMode.token(stream, state.htmlState); 25 | } 26 | else 27 | return scriptingMode.token(stream, state.scriptState); 28 | } 29 | 30 | 31 | return { 32 | startState: function() { 33 | scriptingMode = scriptingMode || CodeMirror.getMode(config, parserConfig.scriptingModeSpec); 34 | htmlMixedMode = htmlMixedMode || CodeMirror.getMode(config, "htmlmixed"); 35 | return { 36 | token : parserConfig.startOpen ? scriptingDispatch : htmlDispatch, 37 | htmlState : CodeMirror.startState(htmlMixedMode), 38 | scriptState : CodeMirror.startState(scriptingMode) 39 | }; 40 | }, 41 | 42 | token: function(stream, state) { 43 | return state.token(stream, state); 44 | }, 45 | 46 | indent: function(state, textAfter) { 47 | if (state.token == htmlDispatch) 48 | return htmlMixedMode.indent(state.htmlState, textAfter); 49 | else if (scriptingMode.indent) 50 | return scriptingMode.indent(state.scriptState, textAfter); 51 | }, 52 | 53 | copyState: function(state) { 54 | return { 55 | token : state.token, 56 | htmlState : CodeMirror.copyState(htmlMixedMode, state.htmlState), 57 | scriptState : CodeMirror.copyState(scriptingMode, state.scriptState) 58 | }; 59 | }, 60 | 61 | innerMode: function(state) { 62 | if (state.token == scriptingDispatch) return {state: state.scriptState, mode: scriptingMode}; 63 | else return {state: state.htmlState, mode: htmlMixedMode}; 64 | } 65 | }; 66 | }, "htmlmixed"); 67 | 68 | CodeMirror.defineMIME("application/x-ejs", { name: "htmlembedded", scriptingModeSpec:"javascript"}); 69 | CodeMirror.defineMIME("application/x-aspx", { name: "htmlembedded", scriptingModeSpec:"text/x-csharp"}); 70 | CodeMirror.defineMIME("application/x-jsp", { name: "htmlembedded", scriptingModeSpec:"text/x-java"}); 71 | CodeMirror.defineMIME("application/x-erb", { name: "htmlembedded", scriptingModeSpec:"ruby"}); 72 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/http/http.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("http", function() { 2 | function failFirstLine(stream, state) { 3 | stream.skipToEnd(); 4 | state.cur = header; 5 | return "error"; 6 | } 7 | 8 | function start(stream, state) { 9 | if (stream.match(/^HTTP\/\d\.\d/)) { 10 | state.cur = responseStatusCode; 11 | return "keyword"; 12 | } else if (stream.match(/^[A-Z]+/) && /[ \t]/.test(stream.peek())) { 13 | state.cur = requestPath; 14 | return "keyword"; 15 | } else { 16 | return failFirstLine(stream, state); 17 | } 18 | } 19 | 20 | function responseStatusCode(stream, state) { 21 | var code = stream.match(/^\d+/); 22 | if (!code) return failFirstLine(stream, state); 23 | 24 | state.cur = responseStatusText; 25 | var status = Number(code[0]); 26 | if (status >= 100 && status < 200) { 27 | return "positive informational"; 28 | } else if (status >= 200 && status < 300) { 29 | return "positive success"; 30 | } else if (status >= 300 && status < 400) { 31 | return "positive redirect"; 32 | } else if (status >= 400 && status < 500) { 33 | return "negative client-error"; 34 | } else if (status >= 500 && status < 600) { 35 | return "negative server-error"; 36 | } else { 37 | return "error"; 38 | } 39 | } 40 | 41 | function responseStatusText(stream, state) { 42 | stream.skipToEnd(); 43 | state.cur = header; 44 | return null; 45 | } 46 | 47 | function requestPath(stream, state) { 48 | stream.eatWhile(/\S/); 49 | state.cur = requestProtocol; 50 | return "string-2"; 51 | } 52 | 53 | function requestProtocol(stream, state) { 54 | if (stream.match(/^HTTP\/\d\.\d$/)) { 55 | state.cur = header; 56 | return "keyword"; 57 | } else { 58 | return failFirstLine(stream, state); 59 | } 60 | } 61 | 62 | function header(stream) { 63 | if (stream.sol() && !stream.eat(/[ \t]/)) { 64 | if (stream.match(/^.*?:/)) { 65 | return "atom"; 66 | } else { 67 | stream.skipToEnd(); 68 | return "error"; 69 | } 70 | } else { 71 | stream.skipToEnd(); 72 | return "string"; 73 | } 74 | } 75 | 76 | function body(stream) { 77 | stream.skipToEnd(); 78 | return null; 79 | } 80 | 81 | return { 82 | token: function(stream, state) { 83 | var cur = state.cur; 84 | if (cur != header && cur != body && stream.eatSpace()) return null; 85 | return cur(stream, state); 86 | }, 87 | 88 | blankLine: function(state) { 89 | state.cur = body; 90 | }, 91 | 92 | startState: function() { 93 | return {cur: start}; 94 | } 95 | }; 96 | }); 97 | 98 | CodeMirror.defineMIME("message/http", "http"); 99 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/jade/jade.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("jade", function () { 2 | var symbol_regex1 = /^(?:~|!|%|\^|\*|\+|=|\\|:|;|,|\/|\?|&|<|>|\|)/; 3 | var open_paren_regex = /^(\(|\[)/; 4 | var close_paren_regex = /^(\)|\])/; 5 | var keyword_regex1 = /^(if|else|return|var|function|include|doctype|each)/; 6 | var keyword_regex2 = /^(#|{|}|\.)/; 7 | var keyword_regex3 = /^(in)/; 8 | var html_regex1 = /^(html|head|title|meta|link|script|body|br|div|input|span|a|img)/; 9 | var html_regex2 = /^(h1|h2|h3|h4|h5|p|strong|em)/; 10 | return { 11 | startState: function () { 12 | return { 13 | inString: false, 14 | stringType: "", 15 | beforeTag: true, 16 | justMatchedKeyword: false, 17 | afterParen: false 18 | }; 19 | }, 20 | token: function (stream, state) { 21 | //check for state changes 22 | if (!state.inString && ((stream.peek() == '"') || (stream.peek() == "'"))) { 23 | state.stringType = stream.peek(); 24 | stream.next(); // Skip quote 25 | state.inString = true; // Update state 26 | } 27 | 28 | //return state 29 | if (state.inString) { 30 | if (stream.skipTo(state.stringType)) { // Quote found on this line 31 | stream.next(); // Skip quote 32 | state.inString = false; // Clear flag 33 | } else { 34 | stream.skipToEnd(); // Rest of line is string 35 | } 36 | state.justMatchedKeyword = false; 37 | return "string"; // Token style 38 | } else if (stream.sol() && stream.eatSpace()) { 39 | if (stream.match(keyword_regex1)) { 40 | state.justMatchedKeyword = true; 41 | stream.eatSpace(); 42 | return "keyword"; 43 | } 44 | if (stream.match(html_regex1) || stream.match(html_regex2)) { 45 | state.justMatchedKeyword = true; 46 | return "variable"; 47 | } 48 | } else if (stream.sol() && stream.match(keyword_regex1)) { 49 | state.justMatchedKeyword = true; 50 | stream.eatSpace(); 51 | return "keyword"; 52 | } else if (stream.sol() && (stream.match(html_regex1) || stream.match(html_regex2))) { 53 | state.justMatchedKeyword = true; 54 | return "variable"; 55 | } else if (stream.eatSpace()) { 56 | state.justMatchedKeyword = false; 57 | if (stream.match(keyword_regex3) && stream.eatSpace()) { 58 | state.justMatchedKeyword = true; 59 | return "keyword"; 60 | } 61 | } else if (stream.match(symbol_regex1)) { 62 | state.justMatchedKeyword = false; 63 | return "atom"; 64 | } else if (stream.match(open_paren_regex)) { 65 | state.afterParen = true; 66 | state.justMatchedKeyword = true; 67 | return "def"; 68 | } else if (stream.match(close_paren_regex)) { 69 | state.afterParen = false; 70 | state.justMatchedKeyword = true; 71 | return "def"; 72 | } else if (stream.match(keyword_regex2)) { 73 | state.justMatchedKeyword = true; 74 | return "keyword"; 75 | } else if (stream.eatSpace()) { 76 | state.justMatchedKeyword = false; 77 | } else { 78 | stream.next(); 79 | if (state.justMatchedKeyword) { 80 | return "property"; 81 | } else if (state.afterParen) { 82 | return "property"; 83 | } 84 | } 85 | return null; 86 | } 87 | }; 88 | }); 89 | 90 | CodeMirror.defineMIME('text/x-jade', 'jade'); 91 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/jinja2/jinja2.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("jinja2", function() { 2 | var keywords = ["and", "as", "block", "endblock", "by", "cycle", "debug", "else", "elif", 3 | "extends", "filter", "endfilter", "firstof", "for", 4 | "endfor", "if", "endif", "ifchanged", "endifchanged", 5 | "ifequal", "endifequal", "ifnotequal", 6 | "endifnotequal", "in", "include", "load", "not", "now", "or", 7 | "parsed", "regroup", "reversed", "spaceless", 8 | "endspaceless", "ssi", "templatetag", "openblock", 9 | "closeblock", "openvariable", "closevariable", 10 | "openbrace", "closebrace", "opencomment", 11 | "closecomment", "widthratio", "url", "with", "endwith", 12 | "get_current_language", "trans", "noop", "blocktrans", 13 | "endblocktrans", "get_available_languages", 14 | "get_current_language_bidi", "plural"]; 15 | keywords = new RegExp("^((" + keywords.join(")|(") + "))\\b"); 16 | 17 | function tokenBase (stream, state) { 18 | var ch = stream.next(); 19 | if (ch == "{") { 20 | if (ch = stream.eat(/\{|%|#/)) { 21 | stream.eat("-"); 22 | state.tokenize = inTag(ch); 23 | return "tag"; 24 | } 25 | } 26 | } 27 | function inTag (close) { 28 | if (close == "{") { 29 | close = "}"; 30 | } 31 | return function (stream, state) { 32 | var ch = stream.next(); 33 | if ((ch == close || (ch == "-" && stream.eat(close))) 34 | && stream.eat("}")) { 35 | state.tokenize = tokenBase; 36 | return "tag"; 37 | } 38 | if (stream.match(keywords)) { 39 | return "keyword"; 40 | } 41 | return close == "#" ? "comment" : "string"; 42 | }; 43 | } 44 | return { 45 | startState: function () { 46 | return {tokenize: tokenBase}; 47 | }, 48 | token: function (stream, state) { 49 | return state.tokenize(stream, state); 50 | } 51 | }; 52 | }); 53 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/pascal/pascal.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("pascal", function() { 2 | function words(str) { 3 | var obj = {}, words = str.split(" "); 4 | for (var i = 0; i < words.length; ++i) obj[words[i]] = true; 5 | return obj; 6 | } 7 | var keywords = words("and array begin case const div do downto else end file for forward integer " + 8 | "boolean char function goto if in label mod nil not of or packed procedure " + 9 | "program record repeat set string then to type until var while with"); 10 | var atoms = {"null": true}; 11 | 12 | var isOperatorChar = /[+\-*&%=<>!?|\/]/; 13 | 14 | function tokenBase(stream, state) { 15 | var ch = stream.next(); 16 | if (ch == "#" && state.startOfLine) { 17 | stream.skipToEnd(); 18 | return "meta"; 19 | } 20 | if (ch == '"' || ch == "'") { 21 | state.tokenize = tokenString(ch); 22 | return state.tokenize(stream, state); 23 | } 24 | if (ch == "(" && stream.eat("*")) { 25 | state.tokenize = tokenComment; 26 | return tokenComment(stream, state); 27 | } 28 | if (/[\[\]{}\(\),;\:\.]/.test(ch)) { 29 | return null; 30 | } 31 | if (/\d/.test(ch)) { 32 | stream.eatWhile(/[\w\.]/); 33 | return "number"; 34 | } 35 | if (ch == "/") { 36 | if (stream.eat("/")) { 37 | stream.skipToEnd(); 38 | return "comment"; 39 | } 40 | } 41 | if (isOperatorChar.test(ch)) { 42 | stream.eatWhile(isOperatorChar); 43 | return "operator"; 44 | } 45 | stream.eatWhile(/[\w\$_]/); 46 | var cur = stream.current(); 47 | if (keywords.propertyIsEnumerable(cur)) return "keyword"; 48 | if (atoms.propertyIsEnumerable(cur)) return "atom"; 49 | return "variable"; 50 | } 51 | 52 | function tokenString(quote) { 53 | return function(stream, state) { 54 | var escaped = false, next, end = false; 55 | while ((next = stream.next()) != null) { 56 | if (next == quote && !escaped) {end = true; break;} 57 | escaped = !escaped && next == "\\"; 58 | } 59 | if (end || !escaped) state.tokenize = null; 60 | return "string"; 61 | }; 62 | } 63 | 64 | function tokenComment(stream, state) { 65 | var maybeEnd = false, ch; 66 | while (ch = stream.next()) { 67 | if (ch == ")" && maybeEnd) { 68 | state.tokenize = null; 69 | break; 70 | } 71 | maybeEnd = (ch == "*"); 72 | } 73 | return "comment"; 74 | } 75 | 76 | // Interface 77 | 78 | return { 79 | startState: function() { 80 | return {tokenize: null}; 81 | }, 82 | 83 | token: function(stream, state) { 84 | if (stream.eatSpace()) return null; 85 | var style = (state.tokenize || tokenBase)(stream, state); 86 | if (style == "comment" || style == "meta") return style; 87 | return style; 88 | }, 89 | 90 | electricChars: "{}" 91 | }; 92 | }); 93 | 94 | CodeMirror.defineMIME("text/x-pascal", "pascal"); 95 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/pegjs/pegjs.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("pegjs", function (config) { 2 | var jsMode = CodeMirror.getMode(config, "javascript"); 3 | 4 | function identifier(stream) { 5 | return stream.match(/^[a-zA-Z_][a-zA-Z0-9_]*/); 6 | } 7 | 8 | return { 9 | startState: function () { 10 | return { 11 | inString: false, 12 | stringType: null, 13 | inComment: false, 14 | inChracterClass: false, 15 | braced: 0, 16 | lhs: true, 17 | localState: null 18 | }; 19 | }, 20 | token: function (stream, state) { 21 | if (stream) 22 | 23 | //check for state changes 24 | if (!state.inString && !state.inComment && ((stream.peek() == '"') || (stream.peek() == "'"))) { 25 | state.stringType = stream.peek(); 26 | stream.next(); // Skip quote 27 | state.inString = true; // Update state 28 | } 29 | if (!state.inString && !state.inComment && stream.match(/^\/\*/)) { 30 | state.inComment = true; 31 | } 32 | 33 | //return state 34 | if (state.inString) { 35 | while (state.inString && !stream.eol()) { 36 | if (stream.peek() === state.stringType) { 37 | stream.next(); // Skip quote 38 | state.inString = false; // Clear flag 39 | } else if (stream.peek() === '\\') { 40 | stream.next(); 41 | stream.next(); 42 | } else { 43 | stream.match(/^.[^\\\"\']*/); 44 | } 45 | } 46 | return state.lhs ? "property string" : "string"; // Token style 47 | } else if (state.inComment) { 48 | while (state.inComment && !stream.eol()) { 49 | if (stream.match(/\*\//)) { 50 | state.inComment = false; // Clear flag 51 | } else { 52 | stream.match(/^.[^\*]*/); 53 | } 54 | } 55 | return "comment"; 56 | } else if (state.inChracterClass) { 57 | while (state.inChracterClass && !stream.eol()) { 58 | if (!(stream.match(/^[^\]\\]+/) || stream.match(/^\\./))) { 59 | state.inChracterClass = false; 60 | } 61 | } 62 | } else if (stream.peek() === '[') { 63 | stream.next(); 64 | state.inChracterClass = true; 65 | return 'bracket'; 66 | } else if (stream.match(/^\/\//)) { 67 | stream.skipToEnd(); 68 | return "comment"; 69 | } else if (state.braced || stream.peek() === '{') { 70 | if (state.localState === null) { 71 | state.localState = jsMode.startState(); 72 | } 73 | var token = jsMode.token(stream, state.localState); 74 | var text = stream.current(); 75 | if (!token) { 76 | for (var i = 0; i < text.length; i++) { 77 | if (text[i] === '{') { 78 | state.braced++; 79 | } else if (text[i] === '}') { 80 | state.braced--; 81 | } 82 | }; 83 | } 84 | return token; 85 | } else if (identifier(stream)) { 86 | if (stream.peek() === ':') { 87 | return 'variable'; 88 | } 89 | return 'variable-2'; 90 | } else if (['[', ']', '(', ')'].indexOf(stream.peek()) != -1) { 91 | stream.next(); 92 | return 'bracket'; 93 | } else if (!stream.eatSpace()) { 94 | stream.next(); 95 | } 96 | return null; 97 | } 98 | }; 99 | }, "javascript"); 100 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/properties/properties.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("properties", function() { 2 | return { 3 | token: function(stream, state) { 4 | var sol = stream.sol() || state.afterSection; 5 | var eol = stream.eol(); 6 | 7 | state.afterSection = false; 8 | 9 | if (sol) { 10 | if (state.nextMultiline) { 11 | state.inMultiline = true; 12 | state.nextMultiline = false; 13 | } else { 14 | state.position = "def"; 15 | } 16 | } 17 | 18 | if (eol && ! state.nextMultiline) { 19 | state.inMultiline = false; 20 | state.position = "def"; 21 | } 22 | 23 | if (sol) { 24 | while(stream.eatSpace()); 25 | } 26 | 27 | var ch = stream.next(); 28 | 29 | if (sol && (ch === "#" || ch === "!" || ch === ";")) { 30 | state.position = "comment"; 31 | stream.skipToEnd(); 32 | return "comment"; 33 | } else if (sol && ch === "[") { 34 | state.afterSection = true; 35 | stream.skipTo("]"); stream.eat("]"); 36 | return "header"; 37 | } else if (ch === "=" || ch === ":") { 38 | state.position = "quote"; 39 | return null; 40 | } else if (ch === "\\" && state.position === "quote") { 41 | if (stream.next() !== "u") { // u = Unicode sequence \u1234 42 | // Multiline value 43 | state.nextMultiline = true; 44 | } 45 | } 46 | 47 | return state.position; 48 | }, 49 | 50 | startState: function() { 51 | return { 52 | position : "def", // Current position, "def", "quote" or "comment" 53 | nextMultiline : false, // Is the next line multiline value 54 | inMultiline : false, // Is the current line a multiline value 55 | afterSection : false // Did we just open a section 56 | }; 57 | } 58 | 59 | }; 60 | }); 61 | 62 | CodeMirror.defineMIME("text/x-properties", "properties"); 63 | CodeMirror.defineMIME("text/x-ini", "properties"); 64 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/rpm/changes/changes.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("changes", function() { 2 | var headerSeperator = /^-+$/; 3 | var headerLine = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ?\d{1,2} \d{2}:\d{2}(:\d{2})? [A-Z]{3,4} \d{4} - /; 4 | var simpleEmail = /^[\w+.-]+@[\w.-]+/; 5 | 6 | return { 7 | token: function(stream) { 8 | if (stream.sol()) { 9 | if (stream.match(headerSeperator)) { return 'tag'; } 10 | if (stream.match(headerLine)) { return 'tag'; } 11 | } 12 | if (stream.match(simpleEmail)) { return 'string'; } 13 | stream.next(); 14 | return null; 15 | } 16 | }; 17 | }); 18 | 19 | CodeMirror.defineMIME("text/x-rpm-changes", "changes"); 20 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/rpm/spec/spec.css: -------------------------------------------------------------------------------- 1 | .cm-s-default span.cm-preamble {color: #b26818; font-weight: bold;} 2 | .cm-s-default span.cm-macro {color: #b218b2;} 3 | .cm-s-default span.cm-section {color: green; font-weight: bold;} 4 | .cm-s-default span.cm-script {color: red;} 5 | .cm-s-default span.cm-issue {color: yellow;} 6 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/rpm/spec/spec.js: -------------------------------------------------------------------------------- 1 | // Quick and dirty spec file highlighting 2 | 3 | CodeMirror.defineMode("spec", function() { 4 | var arch = /^(i386|i586|i686|x86_64|ppc64|ppc|ia64|s390x|s390|sparc64|sparcv9|sparc|noarch|alphaev6|alpha|hppa|mipsel)/; 5 | 6 | var preamble = /^(Name|Version|Release|License|Summary|Url|Group|Source|BuildArch|BuildRequires|BuildRoot|AutoReqProv|Provides|Requires(\(\w+\))?|Obsoletes|Conflicts|Recommends|Source\d*|Patch\d*|ExclusiveArch|NoSource|Supplements):/; 7 | var section = /^%(debug_package|package|description|prep|build|install|files|clean|changelog|preinstall|preun|postinstall|postun|pre|post|triggerin|triggerun|pretrans|posttrans|verifyscript|check|triggerpostun|triggerprein|trigger)/; 8 | var control_flow_complex = /^%(ifnarch|ifarch|if)/; // rpm control flow macros 9 | var control_flow_simple = /^%(else|endif)/; // rpm control flow macros 10 | var operators = /^(\!|\?|\<\=|\<|\>\=|\>|\=\=|\&\&|\|\|)/; // operators in control flow macros 11 | 12 | return { 13 | startState: function () { 14 | return { 15 | controlFlow: false, 16 | macroParameters: false, 17 | section: false 18 | }; 19 | }, 20 | token: function (stream, state) { 21 | var ch = stream.peek(); 22 | if (ch == "#") { stream.skipToEnd(); return "comment"; } 23 | 24 | if (stream.sol()) { 25 | if (stream.match(preamble)) { return "preamble"; } 26 | if (stream.match(section)) { return "section"; } 27 | } 28 | 29 | if (stream.match(/^\$\w+/)) { return "def"; } // Variables like '$RPM_BUILD_ROOT' 30 | if (stream.match(/^\$\{\w+\}/)) { return "def"; } // Variables like '${RPM_BUILD_ROOT}' 31 | 32 | if (stream.match(control_flow_simple)) { return "keyword"; } 33 | if (stream.match(control_flow_complex)) { 34 | state.controlFlow = true; 35 | return "keyword"; 36 | } 37 | if (state.controlFlow) { 38 | if (stream.match(operators)) { return "operator"; } 39 | if (stream.match(/^(\d+)/)) { return "number"; } 40 | if (stream.eol()) { state.controlFlow = false; } 41 | } 42 | 43 | if (stream.match(arch)) { return "number"; } 44 | 45 | // Macros like '%make_install' or '%attr(0775,root,root)' 46 | if (stream.match(/^%[\w]+/)) { 47 | if (stream.match(/^\(/)) { state.macroParameters = true; } 48 | return "macro"; 49 | } 50 | if (state.macroParameters) { 51 | if (stream.match(/^\d+/)) { return "number";} 52 | if (stream.match(/^\)/)) { 53 | state.macroParameters = false; 54 | return "macro"; 55 | } 56 | } 57 | if (stream.match(/^%\{\??[\w \-]+\}/)) { return "macro"; } // Macros like '%{defined fedora}' 58 | 59 | //TODO: Include bash script sub-parser (CodeMirror supports that) 60 | stream.next(); 61 | return null; 62 | } 63 | }; 64 | }); 65 | 66 | CodeMirror.defineMIME("text/x-rpm-spec", "spec"); 67 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/ruby/test.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var mode = CodeMirror.getMode({indentUnit: 2}, "ruby"); 3 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 4 | 5 | MT("divide_equal_operator", 6 | "[variable bar] [operator /=] [variable foo]"); 7 | 8 | MT("divide_equal_operator_no_spacing", 9 | "[variable foo][operator /=][number 42]"); 10 | 11 | })(); 12 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/shell/shell.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode('shell', function() { 2 | 3 | var words = {}; 4 | function define(style, string) { 5 | var split = string.split(' '); 6 | for(var i = 0; i < split.length; i++) { 7 | words[split[i]] = style; 8 | } 9 | }; 10 | 11 | // Atoms 12 | define('atom', 'true false'); 13 | 14 | // Keywords 15 | define('keyword', 'if then do else elif while until for in esac fi fin ' + 16 | 'fil done exit set unset export function'); 17 | 18 | // Commands 19 | define('builtin', 'ab awk bash beep cat cc cd chown chmod chroot clear cp ' + 20 | 'curl cut diff echo find gawk gcc get git grep kill killall ln ls make ' + 21 | 'mkdir openssl mv nc node npm ping ps restart rm rmdir sed service sh ' + 22 | 'shopt shred source sort sleep ssh start stop su sudo tee telnet top ' + 23 | 'touch vi vim wall wc wget who write yes zsh'); 24 | 25 | function tokenBase(stream, state) { 26 | 27 | var sol = stream.sol(); 28 | var ch = stream.next(); 29 | 30 | if (ch === '\'' || ch === '"' || ch === '`') { 31 | state.tokens.unshift(tokenString(ch)); 32 | return tokenize(stream, state); 33 | } 34 | if (ch === '#') { 35 | if (sol && stream.eat('!')) { 36 | stream.skipToEnd(); 37 | return 'meta'; // 'comment'? 38 | } 39 | stream.skipToEnd(); 40 | return 'comment'; 41 | } 42 | if (ch === '$') { 43 | state.tokens.unshift(tokenDollar); 44 | return tokenize(stream, state); 45 | } 46 | if (ch === '+' || ch === '=') { 47 | return 'operator'; 48 | } 49 | if (ch === '-') { 50 | stream.eat('-'); 51 | stream.eatWhile(/\w/); 52 | return 'attribute'; 53 | } 54 | if (/\d/.test(ch)) { 55 | stream.eatWhile(/\d/); 56 | if(!/\w/.test(stream.peek())) { 57 | return 'number'; 58 | } 59 | } 60 | stream.eatWhile(/[\w-]/); 61 | var cur = stream.current(); 62 | if (stream.peek() === '=' && /\w+/.test(cur)) return 'def'; 63 | return words.hasOwnProperty(cur) ? words[cur] : null; 64 | } 65 | 66 | function tokenString(quote) { 67 | return function(stream, state) { 68 | var next, end = false, escaped = false; 69 | while ((next = stream.next()) != null) { 70 | if (next === quote && !escaped) { 71 | end = true; 72 | break; 73 | } 74 | if (next === '$' && !escaped && quote !== '\'') { 75 | escaped = true; 76 | stream.backUp(1); 77 | state.tokens.unshift(tokenDollar); 78 | break; 79 | } 80 | escaped = !escaped && next === '\\'; 81 | } 82 | if (end || !escaped) { 83 | state.tokens.shift(); 84 | } 85 | return (quote === '`' || quote === ')' ? 'quote' : 'string'); 86 | }; 87 | }; 88 | 89 | var tokenDollar = function(stream, state) { 90 | if (state.tokens.length > 1) stream.eat('$'); 91 | var ch = stream.next(), hungry = /\w/; 92 | if (ch === '{') hungry = /[^}]/; 93 | if (ch === '(') { 94 | state.tokens[0] = tokenString(')'); 95 | return tokenize(stream, state); 96 | } 97 | if (!/\d/.test(ch)) { 98 | stream.eatWhile(hungry); 99 | stream.eat('}'); 100 | } 101 | state.tokens.shift(); 102 | return 'def'; 103 | }; 104 | 105 | function tokenize(stream, state) { 106 | return (state.tokens[0] || tokenBase) (stream, state); 107 | }; 108 | 109 | return { 110 | startState: function() {return {tokens:[]};}, 111 | token: function(stream, state) { 112 | if (stream.eatSpace()) return null; 113 | return tokenize(stream, state); 114 | } 115 | }; 116 | }); 117 | 118 | CodeMirror.defineMIME('text/x-sh', 'shell'); 119 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/solr/solr.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("solr", function() { 2 | "use strict"; 3 | 4 | var isStringChar = /[^\s\|\!\+\-\*\?\~\^\&\:\(\)\[\]\{\}\^\"\\]/; 5 | var isOperatorChar = /[\|\!\+\-\*\?\~\^\&]/; 6 | var isOperatorString = /^(OR|AND|NOT|TO)$/i; 7 | 8 | function isNumber(word) { 9 | return parseFloat(word, 10).toString() === word; 10 | } 11 | 12 | function tokenString(quote) { 13 | return function(stream, state) { 14 | var escaped = false, next; 15 | while ((next = stream.next()) != null) { 16 | if (next == quote && !escaped) break; 17 | escaped = !escaped && next == "\\"; 18 | } 19 | 20 | if (!escaped) state.tokenize = tokenBase; 21 | return "string"; 22 | }; 23 | } 24 | 25 | function tokenOperator(operator) { 26 | return function(stream, state) { 27 | var style = "operator"; 28 | if (operator == "+") 29 | style += " positive"; 30 | else if (operator == "-") 31 | style += " negative"; 32 | else if (operator == "|") 33 | stream.eat(/\|/); 34 | else if (operator == "&") 35 | stream.eat(/\&/); 36 | else if (operator == "^") 37 | style += " boost"; 38 | 39 | state.tokenize = tokenBase; 40 | return style; 41 | }; 42 | } 43 | 44 | function tokenWord(ch) { 45 | return function(stream, state) { 46 | var word = ch; 47 | while ((ch = stream.peek()) && ch.match(isStringChar) != null) { 48 | word += stream.next(); 49 | } 50 | 51 | state.tokenize = tokenBase; 52 | if (isOperatorString.test(word)) 53 | return "operator"; 54 | else if (isNumber(word)) 55 | return "number"; 56 | else if (stream.peek() == ":") 57 | return "field"; 58 | else 59 | return "string"; 60 | }; 61 | } 62 | 63 | function tokenBase(stream, state) { 64 | var ch = stream.next(); 65 | if (ch == '"') 66 | state.tokenize = tokenString(ch); 67 | else if (isOperatorChar.test(ch)) 68 | state.tokenize = tokenOperator(ch); 69 | else if (isStringChar.test(ch)) 70 | state.tokenize = tokenWord(ch); 71 | 72 | return (state.tokenize != tokenBase) ? state.tokenize(stream, state) : null; 73 | } 74 | 75 | return { 76 | startState: function() { 77 | return { 78 | tokenize: tokenBase 79 | }; 80 | }, 81 | 82 | token: function(stream, state) { 83 | if (stream.eatSpace()) return null; 84 | return state.tokenize(stream, state); 85 | } 86 | }; 87 | }); 88 | 89 | CodeMirror.defineMIME("text/x-solr", "solr"); 90 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/stex/test.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var mode = CodeMirror.getMode({tabSize: 4}, "stex"); 3 | function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); } 4 | 5 | MT("word", 6 | "foo"); 7 | 8 | MT("twoWords", 9 | "foo bar"); 10 | 11 | MT("beginEndDocument", 12 | "[tag \\begin][bracket {][atom document][bracket }]", 13 | "[tag \\end][bracket {][atom document][bracket }]"); 14 | 15 | MT("beginEndEquation", 16 | "[tag \\begin][bracket {][atom equation][bracket }]", 17 | " E=mc^2", 18 | "[tag \\end][bracket {][atom equation][bracket }]"); 19 | 20 | MT("beginModule", 21 | "[tag \\begin][bracket {][atom module][bracket }[[]]]"); 22 | 23 | MT("beginModuleId", 24 | "[tag \\begin][bracket {][atom module][bracket }[[]id=bbt-size[bracket ]]]"); 25 | 26 | MT("importModule", 27 | "[tag \\importmodule][bracket [[][string b-b-t][bracket ]]{][builtin b-b-t][bracket }]"); 28 | 29 | MT("importModulePath", 30 | "[tag \\importmodule][bracket [[][tag \\KWARCslides][bracket {][string dmath/en/cardinality][bracket }]]{][builtin card][bracket }]"); 31 | 32 | MT("psForPDF", 33 | "[tag \\PSforPDF][bracket [[][atom 1][bracket ]]{]#1[bracket }]"); 34 | 35 | MT("comment", 36 | "[comment % foo]"); 37 | 38 | MT("tagComment", 39 | "[tag \\item][comment % bar]"); 40 | 41 | MT("commentTag", 42 | " [comment % \\item]"); 43 | 44 | MT("commentLineBreak", 45 | "[comment %]", 46 | "foo"); 47 | 48 | MT("tagErrorCurly", 49 | "[tag \\begin][error }][bracket {]"); 50 | 51 | MT("tagErrorSquare", 52 | "[tag \\item][error ]]][bracket {]"); 53 | 54 | MT("commentCurly", 55 | "[comment % }]"); 56 | 57 | MT("tagHash", 58 | "the [tag \\#] key"); 59 | 60 | MT("tagNumber", 61 | "a [tag \\$][atom 5] stetson"); 62 | 63 | MT("tagPercent", 64 | "[atom 100][tag \\%] beef"); 65 | 66 | MT("tagAmpersand", 67 | "L [tag \\&] N"); 68 | 69 | MT("tagUnderscore", 70 | "foo[tag \\_]bar"); 71 | 72 | MT("tagBracketOpen", 73 | "[tag \\emph][bracket {][tag \\{][bracket }]"); 74 | 75 | MT("tagBracketClose", 76 | "[tag \\emph][bracket {][tag \\}][bracket }]"); 77 | 78 | MT("tagLetterNumber", 79 | "section [tag \\S][atom 1]"); 80 | 81 | MT("textTagNumber", 82 | "para [tag \\P][atom 2]"); 83 | 84 | MT("thinspace", 85 | "x[tag \\,]y"); 86 | 87 | MT("thickspace", 88 | "x[tag \\;]y"); 89 | 90 | MT("negativeThinspace", 91 | "x[tag \\!]y"); 92 | 93 | MT("periodNotSentence", 94 | "J.\\ L.\\ is"); 95 | 96 | MT("periodSentence", 97 | "X[tag \\@]. The"); 98 | 99 | MT("italicCorrection", 100 | "[bracket {][tag \\em] If[tag \\/][bracket }] I"); 101 | 102 | MT("tagBracket", 103 | "[tag \\newcommand][bracket {][tag \\pop][bracket }]"); 104 | 105 | MT("inlineMathTagFollowedByNumber", 106 | "[keyword $][tag \\pi][number 2][keyword $]"); 107 | 108 | MT("inlineMath", 109 | "[keyword $][number 3][variable-2 x][tag ^][number 2.45]-[tag \\sqrt][bracket {][tag \\$\\alpha][bracket }] = [number 2][keyword $] other text"); 110 | 111 | MT("displayMath", 112 | "More [keyword $$]\t[variable-2 S][tag ^][variable-2 n][tag \\sum] [variable-2 i][keyword $$] other text"); 113 | 114 | MT("mathWithComment", 115 | "[keyword $][variable-2 x] [comment % $]", 116 | "[variable-2 y][keyword $] other text"); 117 | 118 | MT("lineBreakArgument", 119 | "[tag \\\\][bracket [[][atom 1cm][bracket ]]]"); 120 | })(); 121 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/tiddlywiki/tiddlywiki.css: -------------------------------------------------------------------------------- 1 | span.cm-underlined { 2 | text-decoration: underline; 3 | } 4 | span.cm-strikethrough { 5 | text-decoration: line-through; 6 | } 7 | span.cm-brace { 8 | color: #170; 9 | font-weight: bold; 10 | } 11 | span.cm-table { 12 | color: blue; 13 | font-weight: bold; 14 | } 15 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/tiki/tiki.css: -------------------------------------------------------------------------------- 1 | .cm-tw-syntaxerror { 2 | color: #FFF; 3 | background-color: #900; 4 | } 5 | 6 | .cm-tw-deleted { 7 | text-decoration: line-through; 8 | } 9 | 10 | .cm-tw-header5 { 11 | font-weight: bold; 12 | } 13 | .cm-tw-listitem:first-child { /*Added first child to fix duplicate padding when highlighting*/ 14 | padding-left: 10px; 15 | } 16 | 17 | .cm-tw-box { 18 | border-top-width: 0px ! important; 19 | border-style: solid; 20 | border-width: 1px; 21 | border-color: inherit; 22 | } 23 | 24 | .cm-tw-underline { 25 | text-decoration: underline; 26 | } -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/toml/toml.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("toml", function () { 2 | return { 3 | startState: function () { 4 | return { 5 | inString: false, 6 | stringType: "", 7 | lhs: true, 8 | inArray: 0 9 | }; 10 | }, 11 | token: function (stream, state) { 12 | //check for state changes 13 | if (!state.inString && ((stream.peek() == '"') || (stream.peek() == "'"))) { 14 | state.stringType = stream.peek(); 15 | stream.next(); // Skip quote 16 | state.inString = true; // Update state 17 | } 18 | if (stream.sol() && state.inArray === 0) { 19 | state.lhs = true; 20 | } 21 | //return state 22 | if (state.inString) { 23 | while (state.inString && !stream.eol()) { 24 | if (stream.peek() === state.stringType) { 25 | stream.next(); // Skip quote 26 | state.inString = false; // Clear flag 27 | } else if (stream.peek() === '\\') { 28 | stream.next(); 29 | stream.next(); 30 | } else { 31 | stream.match(/^.[^\\\"\']*/); 32 | } 33 | } 34 | return state.lhs ? "property string" : "string"; // Token style 35 | } else if (state.inArray && stream.peek() === ']') { 36 | stream.next(); 37 | state.inArray--; 38 | return 'bracket'; 39 | } else if (state.lhs && stream.peek() === '[' && stream.skipTo(']')) { 40 | stream.next();//skip closing ] 41 | return "atom"; 42 | } else if (stream.peek() === "#") { 43 | stream.skipToEnd(); 44 | return "comment"; 45 | } else if (stream.eatSpace()) { 46 | return null; 47 | } else if (state.lhs && stream.eatWhile(function (c) { return c != '=' && c != ' '; })) { 48 | return "property"; 49 | } else if (state.lhs && stream.peek() === "=") { 50 | stream.next(); 51 | state.lhs = false; 52 | return null; 53 | } else if (!state.lhs && stream.match(/^\d\d\d\d[\d\-\:\.T]*Z/)) { 54 | return 'atom'; //date 55 | } else if (!state.lhs && (stream.match('true') || stream.match('false'))) { 56 | return 'atom'; 57 | } else if (!state.lhs && stream.peek() === '[') { 58 | state.inArray++; 59 | stream.next(); 60 | return 'bracket'; 61 | } else if (!state.lhs && stream.match(/^\-?\d+(?:\.\d+)?/)) { 62 | return 'number'; 63 | } else if (!stream.eatSpace()) { 64 | stream.next(); 65 | } 66 | return null; 67 | } 68 | }; 69 | }); 70 | 71 | CodeMirror.defineMIME('text/x-toml', 'toml'); 72 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/yaml/yaml.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode("yaml", function() { 2 | 3 | var cons = ['true', 'false', 'on', 'off', 'yes', 'no']; 4 | var keywordRegex = new RegExp("\\b(("+cons.join(")|(")+"))$", 'i'); 5 | 6 | return { 7 | token: function(stream, state) { 8 | var ch = stream.peek(); 9 | var esc = state.escaped; 10 | state.escaped = false; 11 | /* comments */ 12 | if (ch == "#" && (stream.pos == 0 || /\s/.test(stream.string.charAt(stream.pos - 1)))) { 13 | stream.skipToEnd(); return "comment"; 14 | } 15 | if (state.literal && stream.indentation() > state.keyCol) { 16 | stream.skipToEnd(); return "string"; 17 | } else if (state.literal) { state.literal = false; } 18 | if (stream.sol()) { 19 | state.keyCol = 0; 20 | state.pair = false; 21 | state.pairStart = false; 22 | /* document start */ 23 | if(stream.match(/---/)) { return "def"; } 24 | /* document end */ 25 | if (stream.match(/\.\.\./)) { return "def"; } 26 | /* array list item */ 27 | if (stream.match(/\s*-\s+/)) { return 'meta'; } 28 | } 29 | /* inline pairs/lists */ 30 | if (stream.match(/^(\{|\}|\[|\])/)) { 31 | if (ch == '{') 32 | state.inlinePairs++; 33 | else if (ch == '}') 34 | state.inlinePairs--; 35 | else if (ch == '[') 36 | state.inlineList++; 37 | else 38 | state.inlineList--; 39 | return 'meta'; 40 | } 41 | 42 | /* list seperator */ 43 | if (state.inlineList > 0 && !esc && ch == ',') { 44 | stream.next(); 45 | return 'meta'; 46 | } 47 | /* pairs seperator */ 48 | if (state.inlinePairs > 0 && !esc && ch == ',') { 49 | state.keyCol = 0; 50 | state.pair = false; 51 | state.pairStart = false; 52 | stream.next(); 53 | return 'meta'; 54 | } 55 | 56 | /* start of value of a pair */ 57 | if (state.pairStart) { 58 | /* block literals */ 59 | if (stream.match(/^\s*(\||\>)\s*/)) { state.literal = true; return 'meta'; }; 60 | /* references */ 61 | if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)) { return 'variable-2'; } 62 | /* numbers */ 63 | if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/)) { return 'number'; } 64 | if (state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)) { return 'number'; } 65 | /* keywords */ 66 | if (stream.match(keywordRegex)) { return 'keyword'; } 67 | } 68 | 69 | /* pairs (associative arrays) -> key */ 70 | if (!state.pair && stream.match(/^\s*\S+(?=\s*:($|\s))/i)) { 71 | state.pair = true; 72 | state.keyCol = stream.indentation(); 73 | return "atom"; 74 | } 75 | if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; } 76 | 77 | /* nothing found, continue */ 78 | state.pairStart = false; 79 | state.escaped = (ch == '\\'); 80 | stream.next(); 81 | return null; 82 | }, 83 | startState: function() { 84 | return { 85 | pair: false, 86 | pairStart: false, 87 | keyCol: 0, 88 | inlinePairs: 0, 89 | inlineList: 0, 90 | literal: false, 91 | escaped: false 92 | }; 93 | } 94 | }; 95 | }); 96 | 97 | CodeMirror.defineMIME("text/x-yaml", "yaml"); 98 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/mode/z80/z80.js: -------------------------------------------------------------------------------- 1 | CodeMirror.defineMode('z80', function() { 2 | var keywords1 = /^(exx?|(ld|cp|in)([di]r?)?|pop|push|ad[cd]|cpl|daa|dec|inc|neg|sbc|sub|and|bit|[cs]cf|x?or|res|set|r[lr]c?a?|r[lr]d|s[lr]a|srl|djnz|nop|rst|[de]i|halt|im|ot[di]r|out[di]?)\b/i; 3 | var keywords2 = /^(call|j[pr]|ret[in]?)\b/i; 4 | var keywords3 = /^b_?(call|jump)\b/i; 5 | var variables1 = /^(af?|bc?|c|de?|e|hl?|l|i[xy]?|r|sp)\b/i; 6 | var variables2 = /^(n?[zc]|p[oe]?|m)\b/i; 7 | var errors = /^([hl][xy]|i[xy][hl]|slia|sll)\b/i; 8 | var numbers = /^([\da-f]+h|[0-7]+o|[01]+b|\d+)\b/i; 9 | 10 | return { 11 | startState: function() { 12 | return {context: 0}; 13 | }, 14 | token: function(stream, state) { 15 | if (!stream.column()) 16 | state.context = 0; 17 | 18 | if (stream.eatSpace()) 19 | return null; 20 | 21 | var w; 22 | 23 | if (stream.eatWhile(/\w/)) { 24 | w = stream.current(); 25 | 26 | if (stream.indentation()) { 27 | if (state.context == 1 && variables1.test(w)) 28 | return 'variable-2'; 29 | 30 | if (state.context == 2 && variables2.test(w)) 31 | return 'variable-3'; 32 | 33 | if (keywords1.test(w)) { 34 | state.context = 1; 35 | return 'keyword'; 36 | } else if (keywords2.test(w)) { 37 | state.context = 2; 38 | return 'keyword'; 39 | } else if (keywords3.test(w)) { 40 | state.context = 3; 41 | return 'keyword'; 42 | } 43 | 44 | if (errors.test(w)) 45 | return 'error'; 46 | } else if (numbers.test(w)) { 47 | return 'number'; 48 | } else { 49 | return null; 50 | } 51 | } else if (stream.eat(';')) { 52 | stream.skipToEnd(); 53 | return 'comment'; 54 | } else if (stream.eat('"')) { 55 | while (w = stream.next()) { 56 | if (w == '"') 57 | break; 58 | 59 | if (w == '\\') 60 | stream.next(); 61 | } 62 | return 'string'; 63 | } else if (stream.eat('\'')) { 64 | if (stream.match(/\\?.'/)) 65 | return 'number'; 66 | } else if (stream.eat('.') || stream.sol() && stream.eat('#')) { 67 | state.context = 4; 68 | 69 | if (stream.eatWhile(/\w/)) 70 | return 'def'; 71 | } else if (stream.eat('$')) { 72 | if (stream.eatWhile(/[\da-f]/i)) 73 | return 'number'; 74 | } else if (stream.eat('%')) { 75 | if (stream.eatWhile(/[01]/)) 76 | return 'number'; 77 | } else { 78 | stream.next(); 79 | } 80 | return null; 81 | } 82 | }; 83 | }); 84 | 85 | CodeMirror.defineMIME("text/x-z80", "z80"); 86 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/3024-day.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: 3024 day 4 | Author: Jan T. Sott (http://github.com/idleberg) 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-3024-day.CodeMirror {background: #f7f7f7; color: #3a3432;} 12 | .cm-s-3024-day div.CodeMirror-selected {background: #d6d5d4 !important;} 13 | .cm-s-3024-day .CodeMirror-gutters {background: #f7f7f7; border-right: 0px;} 14 | .cm-s-3024-day .CodeMirror-linenumber {color: #807d7c;} 15 | .cm-s-3024-day .CodeMirror-cursor {border-left: 1px solid #5c5855 !important;} 16 | 17 | .cm-s-3024-day span.cm-comment {color: #cdab53;} 18 | .cm-s-3024-day span.cm-atom {color: #a16a94;} 19 | .cm-s-3024-day span.cm-number {color: #a16a94;} 20 | 21 | .cm-s-3024-day span.cm-property, .cm-s-3024-day span.cm-attribute {color: #01a252;} 22 | .cm-s-3024-day span.cm-keyword {color: #db2d20;} 23 | .cm-s-3024-day span.cm-string {color: #fded02;} 24 | 25 | .cm-s-3024-day span.cm-variable {color: #01a252;} 26 | .cm-s-3024-day span.cm-variable-2 {color: #01a0e4;} 27 | .cm-s-3024-day span.cm-def {color: #e8bbd0;} 28 | .cm-s-3024-day span.cm-bracket {color: #3a3432;} 29 | .cm-s-3024-day span.cm-tag {color: #db2d20;} 30 | .cm-s-3024-day span.cm-link {color: #a16a94;} 31 | .cm-s-3024-day span.cm-error {background: #db2d20; color: #5c5855;} 32 | 33 | .cm-s-3024-day .CodeMirror-activeline-background {background: #e8f2ff !important;} 34 | .cm-s-3024-day .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 35 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/3024-night.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: 3024 night 4 | Author: Jan T. Sott (http://github.com/idleberg) 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-3024-night.CodeMirror {background: #090300; color: #d6d5d4;} 12 | .cm-s-3024-night div.CodeMirror-selected {background: #3a3432 !important;} 13 | .cm-s-3024-night .CodeMirror-gutters {background: #090300; border-right: 0px;} 14 | .cm-s-3024-night .CodeMirror-linenumber {color: #5c5855;} 15 | .cm-s-3024-night .CodeMirror-cursor {border-left: 1px solid #807d7c !important;} 16 | 17 | .cm-s-3024-night span.cm-comment {color: #cdab53;} 18 | .cm-s-3024-night span.cm-atom {color: #a16a94;} 19 | .cm-s-3024-night span.cm-number {color: #a16a94;} 20 | 21 | .cm-s-3024-night span.cm-property, .cm-s-3024-night span.cm-attribute {color: #01a252;} 22 | .cm-s-3024-night span.cm-keyword {color: #db2d20;} 23 | .cm-s-3024-night span.cm-string {color: #fded02;} 24 | 25 | .cm-s-3024-night span.cm-variable {color: #01a252;} 26 | .cm-s-3024-night span.cm-variable-2 {color: #01a0e4;} 27 | .cm-s-3024-night span.cm-def {color: #e8bbd0;} 28 | .cm-s-3024-night span.cm-bracket {color: #d6d5d4;} 29 | .cm-s-3024-night span.cm-tag {color: #db2d20;} 30 | .cm-s-3024-night span.cm-link {color: #a16a94;} 31 | .cm-s-3024-night span.cm-error {background: #db2d20; color: #807d7c;} 32 | 33 | .cm-s-3024-night .CodeMirror-activeline-background {background: #2F2F2F !important;} 34 | .cm-s-3024-night .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 35 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/ambiance-mobile.css: -------------------------------------------------------------------------------- 1 | .cm-s-ambiance.CodeMirror { 2 | -webkit-box-shadow: none; 3 | -moz-box-shadow: none; 4 | box-shadow: none; 5 | } 6 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/base16-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Base16 Default Dark 4 | Author: Chris Kempson (http://chriskempson.com) 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-base16-dark.CodeMirror {background: #151515; color: #e0e0e0;} 12 | .cm-s-base16-dark div.CodeMirror-selected {background: #202020 !important;} 13 | .cm-s-base16-dark .CodeMirror-gutters {background: #151515; border-right: 0px;} 14 | .cm-s-base16-dark .CodeMirror-linenumber {color: #505050;} 15 | .cm-s-base16-dark .CodeMirror-cursor {border-left: 1px solid #b0b0b0 !important;} 16 | 17 | .cm-s-base16-dark span.cm-comment {color: #8f5536;} 18 | .cm-s-base16-dark span.cm-atom {color: #aa759f;} 19 | .cm-s-base16-dark span.cm-number {color: #aa759f;} 20 | 21 | .cm-s-base16-dark span.cm-property, .cm-s-base16-dark span.cm-attribute {color: #90a959;} 22 | .cm-s-base16-dark span.cm-keyword {color: #ac4142;} 23 | .cm-s-base16-dark span.cm-string {color: #f4bf75;} 24 | 25 | .cm-s-base16-dark span.cm-variable {color: #90a959;} 26 | .cm-s-base16-dark span.cm-variable-2 {color: #6a9fb5;} 27 | .cm-s-base16-dark span.cm-def {color: #d28445;} 28 | .cm-s-base16-dark span.cm-bracket {color: #e0e0e0;} 29 | .cm-s-base16-dark span.cm-tag {color: #ac4142;} 30 | .cm-s-base16-dark span.cm-link {color: #aa759f;} 31 | .cm-s-base16-dark span.cm-error {background: #ac4142; color: #b0b0b0;} 32 | 33 | .cm-s-base16-dark .CodeMirror-activeline-background {background: #2F2F2F !important;} 34 | .cm-s-base16-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 35 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/base16-light.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Base16 Default Light 4 | Author: Chris Kempson (http://chriskempson.com) 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-chrome-devtools) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-base16-light.CodeMirror {background: #f5f5f5; color: #202020;} 12 | .cm-s-base16-light div.CodeMirror-selected {background: #e0e0e0 !important;} 13 | .cm-s-base16-light .CodeMirror-gutters {background: #f5f5f5; border-right: 0px;} 14 | .cm-s-base16-light .CodeMirror-linenumber {color: #b0b0b0;} 15 | .cm-s-base16-light .CodeMirror-cursor {border-left: 1px solid #505050 !important;} 16 | 17 | .cm-s-base16-light span.cm-comment {color: #8f5536;} 18 | .cm-s-base16-light span.cm-atom {color: #aa759f;} 19 | .cm-s-base16-light span.cm-number {color: #aa759f;} 20 | 21 | .cm-s-base16-light span.cm-property, .cm-s-base16-light span.cm-attribute {color: #90a959;} 22 | .cm-s-base16-light span.cm-keyword {color: #ac4142;} 23 | .cm-s-base16-light span.cm-string {color: #f4bf75;} 24 | 25 | .cm-s-base16-light span.cm-variable {color: #90a959;} 26 | .cm-s-base16-light span.cm-variable-2 {color: #6a9fb5;} 27 | .cm-s-base16-light span.cm-def {color: #d28445;} 28 | .cm-s-base16-light span.cm-bracket {color: #202020;} 29 | .cm-s-base16-light span.cm-tag {color: #ac4142;} 30 | .cm-s-base16-light span.cm-link {color: #aa759f;} 31 | .cm-s-base16-light span.cm-error {background: #ac4142; color: #505050;} 32 | 33 | .cm-s-base16-light .CodeMirror-activeline-background {background: #DDDCDC !important;} 34 | .cm-s-base16-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 35 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/blackboard.css: -------------------------------------------------------------------------------- 1 | /* Port of TextMate's Blackboard theme */ 2 | 3 | .cm-s-blackboard.CodeMirror { background: #0C1021; color: #F8F8F8; } 4 | .cm-s-blackboard .CodeMirror-selected { background: #253B76 !important; } 5 | .cm-s-blackboard .CodeMirror-gutters { background: #0C1021; border-right: 0; } 6 | .cm-s-blackboard .CodeMirror-linenumber { color: #888; } 7 | .cm-s-blackboard .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; } 8 | 9 | .cm-s-blackboard .cm-keyword { color: #FBDE2D; } 10 | .cm-s-blackboard .cm-atom { color: #D8FA3C; } 11 | .cm-s-blackboard .cm-number { color: #D8FA3C; } 12 | .cm-s-blackboard .cm-def { color: #8DA6CE; } 13 | .cm-s-blackboard .cm-variable { color: #FF6400; } 14 | .cm-s-blackboard .cm-operator { color: #FBDE2D;} 15 | .cm-s-blackboard .cm-comment { color: #AEAEAE; } 16 | .cm-s-blackboard .cm-string { color: #61CE3C; } 17 | .cm-s-blackboard .cm-string-2 { color: #61CE3C; } 18 | .cm-s-blackboard .cm-meta { color: #D8FA3C; } 19 | .cm-s-blackboard .cm-builtin { color: #8DA6CE; } 20 | .cm-s-blackboard .cm-tag { color: #8DA6CE; } 21 | .cm-s-blackboard .cm-attribute { color: #8DA6CE; } 22 | .cm-s-blackboard .cm-header { color: #FF6400; } 23 | .cm-s-blackboard .cm-hr { color: #AEAEAE; } 24 | .cm-s-blackboard .cm-link { color: #8DA6CE; } 25 | .cm-s-blackboard .cm-error { background: #9D1E15; color: #F8F8F8; } 26 | 27 | .cm-s-blackboard .CodeMirror-activeline-background {background: #3C3636 !important;} 28 | .cm-s-blackboard .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important} -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/cobalt.css: -------------------------------------------------------------------------------- 1 | .cm-s-cobalt.CodeMirror { background: #002240; color: white; } 2 | .cm-s-cobalt div.CodeMirror-selected { background: #b36539 !important; } 3 | .cm-s-cobalt .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } 4 | .cm-s-cobalt .CodeMirror-linenumber { color: #d0d0d0; } 5 | .cm-s-cobalt .CodeMirror-cursor { border-left: 1px solid white !important; } 6 | 7 | .cm-s-cobalt span.cm-comment { color: #08f; } 8 | .cm-s-cobalt span.cm-atom { color: #845dc4; } 9 | .cm-s-cobalt span.cm-number, .cm-s-cobalt span.cm-attribute { color: #ff80e1; } 10 | .cm-s-cobalt span.cm-keyword { color: #ffee80; } 11 | .cm-s-cobalt span.cm-string { color: #3ad900; } 12 | .cm-s-cobalt span.cm-meta { color: #ff9d00; } 13 | .cm-s-cobalt span.cm-variable-2, .cm-s-cobalt span.cm-tag { color: #9effff; } 14 | .cm-s-cobalt span.cm-variable-3, .cm-s-cobalt span.cm-def { color: white; } 15 | .cm-s-cobalt span.cm-bracket { color: #d8d8d8; } 16 | .cm-s-cobalt span.cm-builtin, .cm-s-cobalt span.cm-special { color: #ff9e59; } 17 | .cm-s-cobalt span.cm-link { color: #845dc4; } 18 | .cm-s-cobalt span.cm-error { color: #9d1e15; } 19 | 20 | .cm-s-cobalt .CodeMirror-activeline-background {background: #002D57 !important;} 21 | .cm-s-cobalt .CodeMirror-matchingbracket {outline:1px solid grey;color:white !important} 22 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/eclipse.css: -------------------------------------------------------------------------------- 1 | .cm-s-eclipse span.cm-meta {color: #FF1717;} 2 | .cm-s-eclipse span.cm-keyword { line-height: 1em; font-weight: bold; color: #7F0055; } 3 | .cm-s-eclipse span.cm-atom {color: #219;} 4 | .cm-s-eclipse span.cm-number {color: #164;} 5 | .cm-s-eclipse span.cm-def {color: #00f;} 6 | .cm-s-eclipse span.cm-variable {color: black;} 7 | .cm-s-eclipse span.cm-variable-2 {color: #0000C0;} 8 | .cm-s-eclipse span.cm-variable-3 {color: #0000C0;} 9 | .cm-s-eclipse span.cm-property {color: black;} 10 | .cm-s-eclipse span.cm-operator {color: black;} 11 | .cm-s-eclipse span.cm-comment {color: #3F7F5F;} 12 | .cm-s-eclipse span.cm-string {color: #2A00FF;} 13 | .cm-s-eclipse span.cm-string-2 {color: #f50;} 14 | .cm-s-eclipse span.cm-qualifier {color: #555;} 15 | .cm-s-eclipse span.cm-builtin {color: #30a;} 16 | .cm-s-eclipse span.cm-bracket {color: #cc7;} 17 | .cm-s-eclipse span.cm-tag {color: #170;} 18 | .cm-s-eclipse span.cm-attribute {color: #00c;} 19 | .cm-s-eclipse span.cm-link {color: #219;} 20 | .cm-s-eclipse span.cm-error {color: #f00;} 21 | 22 | .cm-s-eclipse .CodeMirror-activeline-background {background: #e8f2ff !important;} 23 | .cm-s-eclipse .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} 24 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/elegant.css: -------------------------------------------------------------------------------- 1 | .cm-s-elegant span.cm-number, .cm-s-elegant span.cm-string, .cm-s-elegant span.cm-atom {color: #762;} 2 | .cm-s-elegant span.cm-comment {color: #262; font-style: italic; line-height: 1em;} 3 | .cm-s-elegant span.cm-meta {color: #555; font-style: italic; line-height: 1em;} 4 | .cm-s-elegant span.cm-variable {color: black;} 5 | .cm-s-elegant span.cm-variable-2 {color: #b11;} 6 | .cm-s-elegant span.cm-qualifier {color: #555;} 7 | .cm-s-elegant span.cm-keyword {color: #730;} 8 | .cm-s-elegant span.cm-builtin {color: #30a;} 9 | .cm-s-elegant span.cm-link {color: #762;} 10 | .cm-s-elegant span.cm-error {background-color: #fdd;} 11 | 12 | .cm-s-elegant .CodeMirror-activeline-background {background: #e8f2ff !important;} 13 | .cm-s-elegant .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} 14 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/erlang-dark.css: -------------------------------------------------------------------------------- 1 | .cm-s-erlang-dark.CodeMirror { background: #002240; color: white; } 2 | .cm-s-erlang-dark div.CodeMirror-selected { background: #b36539 !important; } 3 | .cm-s-erlang-dark .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } 4 | .cm-s-erlang-dark .CodeMirror-linenumber { color: #d0d0d0; } 5 | .cm-s-erlang-dark .CodeMirror-cursor { border-left: 1px solid white !important; } 6 | 7 | .cm-s-erlang-dark span.cm-atom { color: #f133f1; } 8 | .cm-s-erlang-dark span.cm-attribute { color: #ff80e1; } 9 | .cm-s-erlang-dark span.cm-bracket { color: #ff9d00; } 10 | .cm-s-erlang-dark span.cm-builtin { color: #eaa; } 11 | .cm-s-erlang-dark span.cm-comment { color: #77f; } 12 | .cm-s-erlang-dark span.cm-def { color: #e7a; } 13 | .cm-s-erlang-dark span.cm-keyword { color: #ffee80; } 14 | .cm-s-erlang-dark span.cm-meta { color: #50fefe; } 15 | .cm-s-erlang-dark span.cm-number { color: #ffd0d0; } 16 | .cm-s-erlang-dark span.cm-operator { color: #d55; } 17 | .cm-s-erlang-dark span.cm-property { color: #ccc; } 18 | .cm-s-erlang-dark span.cm-qualifier { color: #ccc; } 19 | .cm-s-erlang-dark span.cm-quote { color: #ccc; } 20 | .cm-s-erlang-dark span.cm-special { color: #ffbbbb; } 21 | .cm-s-erlang-dark span.cm-string { color: #3ad900; } 22 | .cm-s-erlang-dark span.cm-string-2 { color: #ccc; } 23 | .cm-s-erlang-dark span.cm-tag { color: #9effff; } 24 | .cm-s-erlang-dark span.cm-variable { color: #50fe50; } 25 | .cm-s-erlang-dark span.cm-variable-2 { color: #e0e; } 26 | .cm-s-erlang-dark span.cm-variable-3 { color: #ccc; } 27 | .cm-s-erlang-dark span.cm-error { color: #9d1e15; } 28 | 29 | .cm-s-erlang-dark .CodeMirror-activeline-background {background: #013461 !important;} 30 | .cm-s-erlang-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} 31 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/lesser-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | http://lesscss.org/ dark theme 3 | Ported to CodeMirror by Peter Kroon 4 | */ 5 | .cm-s-lesser-dark { 6 | line-height: 1.3em; 7 | } 8 | .cm-s-lesser-dark { 9 | font-family: 'Bitstream Vera Sans Mono', 'DejaVu Sans Mono', 'Monaco', Courier, monospace !important; 10 | } 11 | 12 | .cm-s-lesser-dark.CodeMirror { background: #262626; color: #EBEFE7; text-shadow: 0 -1px 1px #262626; } 13 | .cm-s-lesser-dark div.CodeMirror-selected {background: #45443B !important;} /* 33322B*/ 14 | .cm-s-lesser-dark .CodeMirror-cursor { border-left: 1px solid white !important; } 15 | .cm-s-lesser-dark pre { padding: 0 8px; }/*editable code holder*/ 16 | 17 | .cm-s-lesser-dark.CodeMirror span.CodeMirror-matchingbracket { color: #7EFC7E; }/*65FC65*/ 18 | 19 | .cm-s-lesser-dark .CodeMirror-gutters { background: #262626; border-right:1px solid #aaa; } 20 | .cm-s-lesser-dark .CodeMirror-linenumber { color: #777; } 21 | 22 | .cm-s-lesser-dark span.cm-keyword { color: #599eff; } 23 | .cm-s-lesser-dark span.cm-atom { color: #C2B470; } 24 | .cm-s-lesser-dark span.cm-number { color: #B35E4D; } 25 | .cm-s-lesser-dark span.cm-def {color: white;} 26 | .cm-s-lesser-dark span.cm-variable { color:#D9BF8C; } 27 | .cm-s-lesser-dark span.cm-variable-2 { color: #669199; } 28 | .cm-s-lesser-dark span.cm-variable-3 { color: white; } 29 | .cm-s-lesser-dark span.cm-property {color: #92A75C;} 30 | .cm-s-lesser-dark span.cm-operator {color: #92A75C;} 31 | .cm-s-lesser-dark span.cm-comment { color: #666; } 32 | .cm-s-lesser-dark span.cm-string { color: #BCD279; } 33 | .cm-s-lesser-dark span.cm-string-2 {color: #f50;} 34 | .cm-s-lesser-dark span.cm-meta { color: #738C73; } 35 | .cm-s-lesser-dark span.cm-qualifier {color: #555;} 36 | .cm-s-lesser-dark span.cm-builtin { color: #ff9e59; } 37 | .cm-s-lesser-dark span.cm-bracket { color: #EBEFE7; } 38 | .cm-s-lesser-dark span.cm-tag { color: #669199; } 39 | .cm-s-lesser-dark span.cm-attribute {color: #00c;} 40 | .cm-s-lesser-dark span.cm-header {color: #a0a;} 41 | .cm-s-lesser-dark span.cm-quote {color: #090;} 42 | .cm-s-lesser-dark span.cm-hr {color: #999;} 43 | .cm-s-lesser-dark span.cm-link {color: #00c;} 44 | .cm-s-lesser-dark span.cm-error { color: #9d1e15; } 45 | 46 | .cm-s-lesser-dark .CodeMirror-activeline-background {background: #3C3A3A !important;} 47 | .cm-s-lesser-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} 48 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/mbo.css: -------------------------------------------------------------------------------- 1 | /* Based on mbonaci's Brackets mbo theme */ 2 | 3 | .cm-s-mbo.CodeMirror {background: #2c2c2c; color: #ffffe9;} 4 | .cm-s-mbo div.CodeMirror-selected {background: #716C62 !important;} 5 | .cm-s-mbo .CodeMirror-gutters {background: #4e4e4e; border-right: 0px;} 6 | .cm-s-mbo .CodeMirror-linenumber {color: #dadada;} 7 | .cm-s-mbo .CodeMirror-cursor {border-left: 1px solid #ffffec !important;} 8 | 9 | .cm-s-mbo span.cm-comment {color: #95958a;} 10 | .cm-s-mbo span.cm-atom {color: #00a8c6;} 11 | .cm-s-mbo span.cm-number {color: #00a8c6;} 12 | 13 | .cm-s-mbo span.cm-property, .cm-s-mbo span.cm-attribute {color: #9ddfe9;} 14 | .cm-s-mbo span.cm-keyword {color: #ffb928;} 15 | .cm-s-mbo span.cm-string {color: #ffcf6c;} 16 | 17 | .cm-s-mbo span.cm-variable {color: #ffffec;} 18 | .cm-s-mbo span.cm-variable-2 {color: #00a8c6;} 19 | .cm-s-mbo span.cm-def {color: #ffffec;} 20 | .cm-s-mbo span.cm-bracket {color: #fffffc; font-weight: bold;} 21 | .cm-s-mbo span.cm-tag {color: #9ddfe9;} 22 | .cm-s-mbo span.cm-link {color: #f54b07;} 23 | .cm-s-mbo span.cm-error {background: #636363; color: #ffffec;} 24 | 25 | .cm-s-mbo .CodeMirror-activeline-background {background: #494b41 !important;} 26 | .cm-s-mbo .CodeMirror-matchingbracket { 27 | text-decoration: underline; 28 | color: #f5e107 !important; 29 | } 30 | 31 | .cm-s-mbo .CodeMirror-matchingtag {background: #4e4e4e;} 32 | 33 | .cm-s-mbo span.cm-searching { 34 | background-color: none; 35 | background: none; 36 | box-shadow: 0 0 0 1px #ffffec; 37 | } 38 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/midnight.css: -------------------------------------------------------------------------------- 1 | /* Based on the theme at http://bonsaiden.github.com/JavaScript-Garden */ 2 | 3 | /**/ 4 | .cm-s-midnight span.CodeMirror-matchhighlight { background: #494949; } 5 | .cm-s-midnight.CodeMirror-focused span.CodeMirror-matchhighlight { background: #314D67 !important; } 6 | 7 | /**/ 8 | .cm-s-midnight .CodeMirror-activeline-background {background: #253540 !important;} 9 | 10 | .cm-s-midnight.CodeMirror { 11 | background: #0F192A; 12 | color: #D1EDFF; 13 | } 14 | 15 | .cm-s-midnight.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;} 16 | 17 | .cm-s-midnight div.CodeMirror-selected {background: #314D67 !important;} 18 | .cm-s-midnight .CodeMirror-gutters {background: #0F192A; border-right: 1px solid;} 19 | .cm-s-midnight .CodeMirror-linenumber {color: #D0D0D0;} 20 | .cm-s-midnight .CodeMirror-cursor { 21 | border-left: 1px solid #F8F8F0 !important; 22 | } 23 | 24 | .cm-s-midnight span.cm-comment {color: #428BDD;} 25 | .cm-s-midnight span.cm-atom {color: #AE81FF;} 26 | .cm-s-midnight span.cm-number {color: #D1EDFF;} 27 | 28 | .cm-s-midnight span.cm-property, .cm-s-midnight span.cm-attribute {color: #A6E22E;} 29 | .cm-s-midnight span.cm-keyword {color: #E83737;} 30 | .cm-s-midnight span.cm-string {color: #1DC116;} 31 | 32 | .cm-s-midnight span.cm-variable {color: #FFAA3E;} 33 | .cm-s-midnight span.cm-variable-2 {color: #FFAA3E;} 34 | .cm-s-midnight span.cm-def {color: #4DD;} 35 | .cm-s-midnight span.cm-bracket {color: #D1EDFF;} 36 | .cm-s-midnight span.cm-tag {color: #449;} 37 | .cm-s-midnight span.cm-link {color: #AE81FF;} 38 | .cm-s-midnight span.cm-error {background: #F92672; color: #F8F8F0;} 39 | 40 | .cm-s-midnight .CodeMirror-matchingbracket { 41 | text-decoration: underline; 42 | color: white !important; 43 | } 44 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/monokai.css: -------------------------------------------------------------------------------- 1 | /* Based on Sublime Text's Monokai theme */ 2 | 3 | .cm-s-monokai.CodeMirror {background: #272822; color: #f8f8f2;} 4 | .cm-s-monokai div.CodeMirror-selected {background: #49483E !important;} 5 | .cm-s-monokai .CodeMirror-gutters {background: #272822; border-right: 0px;} 6 | .cm-s-monokai .CodeMirror-linenumber {color: #d0d0d0;} 7 | .cm-s-monokai .CodeMirror-cursor {border-left: 1px solid #f8f8f0 !important;} 8 | 9 | .cm-s-monokai span.cm-comment {color: #75715e;} 10 | .cm-s-monokai span.cm-atom {color: #ae81ff;} 11 | .cm-s-monokai span.cm-number {color: #ae81ff;} 12 | 13 | .cm-s-monokai span.cm-property, .cm-s-monokai span.cm-attribute {color: #a6e22e;} 14 | .cm-s-monokai span.cm-keyword {color: #f92672;} 15 | .cm-s-monokai span.cm-string {color: #e6db74;} 16 | 17 | .cm-s-monokai span.cm-variable {color: #a6e22e;} 18 | .cm-s-monokai span.cm-variable-2 {color: #9effff;} 19 | .cm-s-monokai span.cm-def {color: #fd971f;} 20 | .cm-s-monokai span.cm-bracket {color: #f8f8f2;} 21 | .cm-s-monokai span.cm-tag {color: #f92672;} 22 | .cm-s-monokai span.cm-link {color: #ae81ff;} 23 | .cm-s-monokai span.cm-error {background: #f92672; color: #f8f8f0;} 24 | 25 | .cm-s-monokai .CodeMirror-activeline-background {background: #373831 !important;} 26 | .cm-s-monokai .CodeMirror-matchingbracket { 27 | text-decoration: underline; 28 | color: white !important; 29 | } 30 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/neat.css: -------------------------------------------------------------------------------- 1 | .cm-s-neat span.cm-comment { color: #a86; } 2 | .cm-s-neat span.cm-keyword { line-height: 1em; font-weight: bold; color: blue; } 3 | .cm-s-neat span.cm-string { color: #a22; } 4 | .cm-s-neat span.cm-builtin { line-height: 1em; font-weight: bold; color: #077; } 5 | .cm-s-neat span.cm-special { line-height: 1em; font-weight: bold; color: #0aa; } 6 | .cm-s-neat span.cm-variable { color: black; } 7 | .cm-s-neat span.cm-number, .cm-s-neat span.cm-atom { color: #3a3; } 8 | .cm-s-neat span.cm-meta {color: #555;} 9 | .cm-s-neat span.cm-link { color: #3a3; } 10 | 11 | .cm-s-neat .CodeMirror-activeline-background {background: #e8f2ff !important;} 12 | .cm-s-neat .CodeMirror-matchingbracket {outline:1px solid grey; color:black !important;} 13 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/night.css: -------------------------------------------------------------------------------- 1 | /* Loosely based on the Midnight Textmate theme */ 2 | 3 | .cm-s-night.CodeMirror { background: #0a001f; color: #f8f8f8; } 4 | .cm-s-night div.CodeMirror-selected { background: #447 !important; } 5 | .cm-s-night .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } 6 | .cm-s-night .CodeMirror-linenumber { color: #f8f8f8; } 7 | .cm-s-night .CodeMirror-cursor { border-left: 1px solid white !important; } 8 | 9 | .cm-s-night span.cm-comment { color: #6900a1; } 10 | .cm-s-night span.cm-atom { color: #845dc4; } 11 | .cm-s-night span.cm-number, .cm-s-night span.cm-attribute { color: #ffd500; } 12 | .cm-s-night span.cm-keyword { color: #599eff; } 13 | .cm-s-night span.cm-string { color: #37f14a; } 14 | .cm-s-night span.cm-meta { color: #7678e2; } 15 | .cm-s-night span.cm-variable-2, .cm-s-night span.cm-tag { color: #99b2ff; } 16 | .cm-s-night span.cm-variable-3, .cm-s-night span.cm-def { color: white; } 17 | .cm-s-night span.cm-bracket { color: #8da6ce; } 18 | .cm-s-night span.cm-comment { color: #6900a1; } 19 | .cm-s-night span.cm-builtin, .cm-s-night span.cm-special { color: #ff9e59; } 20 | .cm-s-night span.cm-link { color: #845dc4; } 21 | .cm-s-night span.cm-error { color: #9d1e15; } 22 | 23 | .cm-s-night .CodeMirror-activeline-background {background: #1C005A !important;} 24 | .cm-s-night .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} 25 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/paraiso-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Paraíso (Dark) 4 | Author: Jan T. Sott 5 | 6 | Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) 7 | Inspired by the art of Rubens LP (http://www.rubenslp.com.br) 8 | 9 | */ 10 | 11 | .cm-s-paraiso-dark.CodeMirror {background: #2f1e2e; color: #b9b6b0;} 12 | .cm-s-paraiso-dark div.CodeMirror-selected {background: #41323f !important;} 13 | .cm-s-paraiso-dark .CodeMirror-gutters {background: #2f1e2e; border-right: 0px;} 14 | .cm-s-paraiso-dark .CodeMirror-linenumber {color: #776e71;} 15 | .cm-s-paraiso-dark .CodeMirror-cursor {border-left: 1px solid #8d8687 !important;} 16 | 17 | .cm-s-paraiso-dark span.cm-comment {color: #e96ba8;} 18 | .cm-s-paraiso-dark span.cm-atom {color: #815ba4;} 19 | .cm-s-paraiso-dark span.cm-number {color: #815ba4;} 20 | 21 | .cm-s-paraiso-dark span.cm-property, .cm-s-paraiso-dark span.cm-attribute {color: #48b685;} 22 | .cm-s-paraiso-dark span.cm-keyword {color: #ef6155;} 23 | .cm-s-paraiso-dark span.cm-string {color: #fec418;} 24 | 25 | .cm-s-paraiso-dark span.cm-variable {color: #48b685;} 26 | .cm-s-paraiso-dark span.cm-variable-2 {color: #06b6ef;} 27 | .cm-s-paraiso-dark span.cm-def {color: #f99b15;} 28 | .cm-s-paraiso-dark span.cm-bracket {color: #b9b6b0;} 29 | .cm-s-paraiso-dark span.cm-tag {color: #ef6155;} 30 | .cm-s-paraiso-dark span.cm-link {color: #815ba4;} 31 | .cm-s-paraiso-dark span.cm-error {background: #ef6155; color: #8d8687;} 32 | 33 | .cm-s-paraiso-dark .CodeMirror-activeline-background {background: #4D344A !important;} 34 | .cm-s-paraiso-dark .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 35 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/paraiso-light.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Paraíso (Light) 4 | Author: Jan T. Sott 5 | 6 | Color scheme by Jan T. Sott (https://github.com/idleberg/Paraiso-CodeMirror) 7 | Inspired by the art of Rubens LP (http://www.rubenslp.com.br) 8 | 9 | */ 10 | 11 | .cm-s-paraiso-light.CodeMirror {background: #e7e9db; color: #41323f;} 12 | .cm-s-paraiso-light div.CodeMirror-selected {background: #b9b6b0 !important;} 13 | .cm-s-paraiso-light .CodeMirror-gutters {background: #e7e9db; border-right: 0px;} 14 | .cm-s-paraiso-light .CodeMirror-linenumber {color: #8d8687;} 15 | .cm-s-paraiso-light .CodeMirror-cursor {border-left: 1px solid #776e71 !important;} 16 | 17 | .cm-s-paraiso-light span.cm-comment {color: #e96ba8;} 18 | .cm-s-paraiso-light span.cm-atom {color: #815ba4;} 19 | .cm-s-paraiso-light span.cm-number {color: #815ba4;} 20 | 21 | .cm-s-paraiso-light span.cm-property, .cm-s-paraiso-light span.cm-attribute {color: #48b685;} 22 | .cm-s-paraiso-light span.cm-keyword {color: #ef6155;} 23 | .cm-s-paraiso-light span.cm-string {color: #fec418;} 24 | 25 | .cm-s-paraiso-light span.cm-variable {color: #48b685;} 26 | .cm-s-paraiso-light span.cm-variable-2 {color: #06b6ef;} 27 | .cm-s-paraiso-light span.cm-def {color: #f99b15;} 28 | .cm-s-paraiso-light span.cm-bracket {color: #41323f;} 29 | .cm-s-paraiso-light span.cm-tag {color: #ef6155;} 30 | .cm-s-paraiso-light span.cm-link {color: #815ba4;} 31 | .cm-s-paraiso-light span.cm-error {background: #ef6155; color: #776e71;} 32 | 33 | .cm-s-paraiso-light .CodeMirror-activeline-background {background: #CFD1C4 !important;} 34 | .cm-s-paraiso-light .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 35 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/pastel-on-dark.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Pastel On Dark theme ported from ACE editor 3 | * @license MIT 4 | * @copyright AtomicPages LLC 2014 5 | * @author Dennis Thompson, AtomicPages LLC 6 | * @version 1.1 7 | * @source https://github.com/atomicpages/codemirror-pastel-on-dark-theme 8 | */ 9 | 10 | .cm-s-pastel-on-dark.CodeMirror { 11 | background: #2c2827; 12 | color: #8F938F; 13 | line-height: 1.5; 14 | font-family: consolas, Courier, monospace; 15 | font-size: 14px; 16 | } 17 | .cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2) !important; } 18 | .cm-s-pastel-on-dark .CodeMirror-gutters { 19 | background: #34302f; 20 | border-right: 0px; 21 | padding: 0 3px; 22 | } 23 | .cm-s-pastel-on-dark .CodeMirror-linenumber { color: #8F938F; } 24 | .cm-s-pastel-on-dark .CodeMirror-cursor { border-left: 1px solid #A7A7A7 !important; } 25 | .cm-s-pastel-on-dark span.cm-comment { color: #A6C6FF; } 26 | .cm-s-pastel-on-dark span.cm-atom { color: #DE8E30; } 27 | .cm-s-pastel-on-dark span.cm-number { color: #CCCCCC; } 28 | .cm-s-pastel-on-dark span.cm-property { color: #8F938F; } 29 | .cm-s-pastel-on-dark span.cm-attribute { color: #a6e22e; } 30 | .cm-s-pastel-on-dark span.cm-keyword { color: #AEB2F8; } 31 | .cm-s-pastel-on-dark span.cm-string { color: #66A968; } 32 | .cm-s-pastel-on-dark span.cm-variable { color: #AEB2F8; } 33 | .cm-s-pastel-on-dark span.cm-variable-2 { color: #BEBF55; } 34 | .cm-s-pastel-on-dark span.cm-variable-3 { color: #DE8E30; } 35 | .cm-s-pastel-on-dark span.cm-def { color: #757aD8; } 36 | .cm-s-pastel-on-dark span.cm-bracket { color: #f8f8f2; } 37 | .cm-s-pastel-on-dark span.cm-tag { color: #C1C144; } 38 | .cm-s-pastel-on-dark span.cm-link { color: #ae81ff; } 39 | .cm-s-pastel-on-dark span.cm-qualifier,.cm-s-pastel-on-dark span.cm-builtin { color: #C1C144; } 40 | .cm-s-pastel-on-dark span.cm-error { 41 | background: #757aD8; 42 | color: #f8f8f0; 43 | } 44 | .cm-s-pastel-on-dark .CodeMirror-activeline-background { background: rgba(255, 255, 255, 0.031) !important; } 45 | .cm-s-pastel-on-dark .CodeMirror-matchingbracket { 46 | border: 1px solid rgba(255,255,255,0.25); 47 | color: #8F938F !important; 48 | margin: -1px -1px 0 -1px; 49 | } 50 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/rubyblue.css: -------------------------------------------------------------------------------- 1 | .cm-s-rubyblue { font-family: Trebuchet, Verdana, sans-serif; } /* - customized editor font - */ 2 | 3 | .cm-s-rubyblue.CodeMirror { background: #112435; color: white; } 4 | .cm-s-rubyblue div.CodeMirror-selected { background: #38566F !important; } 5 | .cm-s-rubyblue .CodeMirror-gutters { background: #1F4661; border-right: 7px solid #3E7087; } 6 | .cm-s-rubyblue .CodeMirror-linenumber { color: white; } 7 | .cm-s-rubyblue .CodeMirror-cursor { border-left: 1px solid white !important; } 8 | 9 | .cm-s-rubyblue span.cm-comment { color: #999; font-style:italic; line-height: 1em; } 10 | .cm-s-rubyblue span.cm-atom { color: #F4C20B; } 11 | .cm-s-rubyblue span.cm-number, .cm-s-rubyblue span.cm-attribute { color: #82C6E0; } 12 | .cm-s-rubyblue span.cm-keyword { color: #F0F; } 13 | .cm-s-rubyblue span.cm-string { color: #F08047; } 14 | .cm-s-rubyblue span.cm-meta { color: #F0F; } 15 | .cm-s-rubyblue span.cm-variable-2, .cm-s-rubyblue span.cm-tag { color: #7BD827; } 16 | .cm-s-rubyblue span.cm-variable-3, .cm-s-rubyblue span.cm-def { color: white; } 17 | .cm-s-rubyblue span.cm-bracket { color: #F0F; } 18 | .cm-s-rubyblue span.cm-link { color: #F4C20B; } 19 | .cm-s-rubyblue span.CodeMirror-matchingbracket { color:#F0F !important; } 20 | .cm-s-rubyblue span.cm-builtin, .cm-s-rubyblue span.cm-special { color: #FF9D00; } 21 | .cm-s-rubyblue span.cm-error { color: #AF2018; } 22 | 23 | .cm-s-rubyblue .CodeMirror-activeline-background {background: #173047 !important;} 24 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/the-matrix.css: -------------------------------------------------------------------------------- 1 | .cm-s-the-matrix.CodeMirror { background: #000000; color: #00FF00; } 2 | .cm-s-the-matrix div.CodeMirror-selected { background: #2D2D2D !important; } 3 | .cm-s-the-matrix .CodeMirror-gutters { background: #060; border-right: 2px solid #00FF00; } 4 | .cm-s-the-matrix .CodeMirror-linenumber { color: #FFFFFF; } 5 | .cm-s-the-matrix .CodeMirror-cursor { border-left: 1px solid #00FF00 !important; } 6 | 7 | .cm-s-the-matrix span.cm-keyword {color: #008803; font-weight: bold;} 8 | .cm-s-the-matrix span.cm-atom {color: #3FF;} 9 | .cm-s-the-matrix span.cm-number {color: #FFB94F;} 10 | .cm-s-the-matrix span.cm-def {color: #99C;} 11 | .cm-s-the-matrix span.cm-variable {color: #F6C;} 12 | .cm-s-the-matrix span.cm-variable-2 {color: #C6F;} 13 | .cm-s-the-matrix span.cm-variable-3 {color: #96F;} 14 | .cm-s-the-matrix span.cm-property {color: #62FFA0;} 15 | .cm-s-the-matrix span.cm-operator {color: #999} 16 | .cm-s-the-matrix span.cm-comment {color: #CCCCCC;} 17 | .cm-s-the-matrix span.cm-string {color: #39C;} 18 | .cm-s-the-matrix span.cm-meta {color: #C9F;} 19 | .cm-s-the-matrix span.cm-qualifier {color: #FFF700;} 20 | .cm-s-the-matrix span.cm-builtin {color: #30a;} 21 | .cm-s-the-matrix span.cm-bracket {color: #cc7;} 22 | .cm-s-the-matrix span.cm-tag {color: #FFBD40;} 23 | .cm-s-the-matrix span.cm-attribute {color: #FFF700;} 24 | .cm-s-the-matrix span.cm-error {color: #FF0000;} 25 | 26 | .cm-s-the-matrix .CodeMirror-activeline-background {background: #040;} 27 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/tomorrow-night-eighties.css: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Name: Tomorrow Night - Eighties 4 | Author: Chris Kempson 5 | 6 | CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) 7 | Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) 8 | 9 | */ 10 | 11 | .cm-s-tomorrow-night-eighties.CodeMirror {background: #000000; color: #CCCCCC;} 12 | .cm-s-tomorrow-night-eighties div.CodeMirror-selected {background: #2D2D2D !important;} 13 | .cm-s-tomorrow-night-eighties .CodeMirror-gutters {background: #000000; border-right: 0px;} 14 | .cm-s-tomorrow-night-eighties .CodeMirror-linenumber {color: #515151;} 15 | .cm-s-tomorrow-night-eighties .CodeMirror-cursor {border-left: 1px solid #6A6A6A !important;} 16 | 17 | .cm-s-tomorrow-night-eighties span.cm-comment {color: #d27b53;} 18 | .cm-s-tomorrow-night-eighties span.cm-atom {color: #a16a94;} 19 | .cm-s-tomorrow-night-eighties span.cm-number {color: #a16a94;} 20 | 21 | .cm-s-tomorrow-night-eighties span.cm-property, .cm-s-tomorrow-night-eighties span.cm-attribute {color: #99cc99;} 22 | .cm-s-tomorrow-night-eighties span.cm-keyword {color: #f2777a;} 23 | .cm-s-tomorrow-night-eighties span.cm-string {color: #ffcc66;} 24 | 25 | .cm-s-tomorrow-night-eighties span.cm-variable {color: #99cc99;} 26 | .cm-s-tomorrow-night-eighties span.cm-variable-2 {color: #6699cc;} 27 | .cm-s-tomorrow-night-eighties span.cm-def {color: #f99157;} 28 | .cm-s-tomorrow-night-eighties span.cm-bracket {color: #CCCCCC;} 29 | .cm-s-tomorrow-night-eighties span.cm-tag {color: #f2777a;} 30 | .cm-s-tomorrow-night-eighties span.cm-link {color: #a16a94;} 31 | .cm-s-tomorrow-night-eighties span.cm-error {background: #f2777a; color: #6A6A6A;} 32 | 33 | .cm-s-tomorrow-night-eighties .CodeMirror-activeline-background {background: #343600 !important;} 34 | .cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { text-decoration: underline; color: white !important;} 35 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/twilight.css: -------------------------------------------------------------------------------- 1 | .cm-s-twilight.CodeMirror { background: #141414; color: #f7f7f7; } /**/ 2 | .cm-s-twilight .CodeMirror-selected { background: #323232 !important; } /**/ 3 | 4 | .cm-s-twilight .CodeMirror-gutters { background: #222; border-right: 1px solid #aaa; } 5 | .cm-s-twilight .CodeMirror-linenumber { color: #aaa; } 6 | .cm-s-twilight .CodeMirror-cursor { border-left: 1px solid white !important; } 7 | 8 | .cm-s-twilight .cm-keyword { color: #f9ee98; } /**/ 9 | .cm-s-twilight .cm-atom { color: #FC0; } 10 | .cm-s-twilight .cm-number { color: #ca7841; } /**/ 11 | .cm-s-twilight .cm-def { color: #8DA6CE; } 12 | .cm-s-twilight span.cm-variable-2, .cm-s-twilight span.cm-tag { color: #607392; } /**/ 13 | .cm-s-twilight span.cm-variable-3, .cm-s-twilight span.cm-def { color: #607392; } /**/ 14 | .cm-s-twilight .cm-operator { color: #cda869; } /**/ 15 | .cm-s-twilight .cm-comment { color:#777; font-style:italic; font-weight:normal; } /**/ 16 | .cm-s-twilight .cm-string { color:#8f9d6a; font-style:italic; } /**/ 17 | .cm-s-twilight .cm-string-2 { color:#bd6b18 } /*?*/ 18 | .cm-s-twilight .cm-meta { background-color:#141414; color:#f7f7f7; } /*?*/ 19 | .cm-s-twilight .cm-builtin { color: #cda869; } /*?*/ 20 | .cm-s-twilight .cm-tag { color: #997643; } /**/ 21 | .cm-s-twilight .cm-attribute { color: #d6bb6d; } /*?*/ 22 | .cm-s-twilight .cm-header { color: #FF6400; } 23 | .cm-s-twilight .cm-hr { color: #AEAEAE; } 24 | .cm-s-twilight .cm-link { color:#ad9361; font-style:italic; text-decoration:none; } /**/ 25 | .cm-s-twilight .cm-error { border-bottom: 1px solid red; } 26 | 27 | .cm-s-twilight .CodeMirror-activeline-background {background: #27282E !important;} 28 | .cm-s-twilight .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} 29 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/vibrant-ink.css: -------------------------------------------------------------------------------- 1 | /* Taken from the popular Visual Studio Vibrant Ink Schema */ 2 | 3 | .cm-s-vibrant-ink.CodeMirror { background: black; color: white; } 4 | .cm-s-vibrant-ink .CodeMirror-selected { background: #35493c !important; } 5 | 6 | .cm-s-vibrant-ink .CodeMirror-gutters { background: #002240; border-right: 1px solid #aaa; } 7 | .cm-s-vibrant-ink .CodeMirror-linenumber { color: #d0d0d0; } 8 | .cm-s-vibrant-ink .CodeMirror-cursor { border-left: 1px solid white !important; } 9 | 10 | .cm-s-vibrant-ink .cm-keyword { color: #CC7832; } 11 | .cm-s-vibrant-ink .cm-atom { color: #FC0; } 12 | .cm-s-vibrant-ink .cm-number { color: #FFEE98; } 13 | .cm-s-vibrant-ink .cm-def { color: #8DA6CE; } 14 | .cm-s-vibrant-ink span.cm-variable-2, .cm-s-vibrant span.cm-tag { color: #FFC66D } 15 | .cm-s-vibrant-ink span.cm-variable-3, .cm-s-vibrant span.cm-def { color: #FFC66D } 16 | .cm-s-vibrant-ink .cm-operator { color: #888; } 17 | .cm-s-vibrant-ink .cm-comment { color: gray; font-weight: bold; } 18 | .cm-s-vibrant-ink .cm-string { color: #A5C25C } 19 | .cm-s-vibrant-ink .cm-string-2 { color: red } 20 | .cm-s-vibrant-ink .cm-meta { color: #D8FA3C; } 21 | .cm-s-vibrant-ink .cm-builtin { color: #8DA6CE; } 22 | .cm-s-vibrant-ink .cm-tag { color: #8DA6CE; } 23 | .cm-s-vibrant-ink .cm-attribute { color: #8DA6CE; } 24 | .cm-s-vibrant-ink .cm-header { color: #FF6400; } 25 | .cm-s-vibrant-ink .cm-hr { color: #AEAEAE; } 26 | .cm-s-vibrant-ink .cm-link { color: blue; } 27 | .cm-s-vibrant-ink .cm-error { border-bottom: 1px solid red; } 28 | 29 | .cm-s-vibrant-ink .CodeMirror-activeline-background {background: #27282E !important;} 30 | .cm-s-vibrant-ink .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} 31 | -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/xq-dark.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 by MarkLogic Corporation 3 | Author: Mike Brevoort 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 13 | all 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 21 | THE SOFTWARE. 22 | */ 23 | .cm-s-xq-dark.CodeMirror { background: #0a001f; color: #f8f8f8; } 24 | .cm-s-xq-dark .CodeMirror-selected { background: #27007A !important; } 25 | .cm-s-xq-dark .CodeMirror-gutters { background: #0a001f; border-right: 1px solid #aaa; } 26 | .cm-s-xq-dark .CodeMirror-linenumber { color: #f8f8f8; } 27 | .cm-s-xq-dark .CodeMirror-cursor { border-left: 1px solid white !important; } 28 | 29 | .cm-s-xq-dark span.cm-keyword {color: #FFBD40;} 30 | .cm-s-xq-dark span.cm-atom {color: #6C8CD5;} 31 | .cm-s-xq-dark span.cm-number {color: #164;} 32 | .cm-s-xq-dark span.cm-def {color: #FFF; text-decoration:underline;} 33 | .cm-s-xq-dark span.cm-variable {color: #FFF;} 34 | .cm-s-xq-dark span.cm-variable-2 {color: #EEE;} 35 | .cm-s-xq-dark span.cm-variable-3 {color: #DDD;} 36 | .cm-s-xq-dark span.cm-property {} 37 | .cm-s-xq-dark span.cm-operator {} 38 | .cm-s-xq-dark span.cm-comment {color: gray;} 39 | .cm-s-xq-dark span.cm-string {color: #9FEE00;} 40 | .cm-s-xq-dark span.cm-meta {color: yellow;} 41 | .cm-s-xq-dark span.cm-qualifier {color: #FFF700;} 42 | .cm-s-xq-dark span.cm-builtin {color: #30a;} 43 | .cm-s-xq-dark span.cm-bracket {color: #cc7;} 44 | .cm-s-xq-dark span.cm-tag {color: #FFBD40;} 45 | .cm-s-xq-dark span.cm-attribute {color: #FFF700;} 46 | .cm-s-xq-dark span.cm-error {color: #f00;} 47 | 48 | .cm-s-xq-dark .CodeMirror-activeline-background {background: #27282E !important;} 49 | .cm-s-xq-dark .CodeMirror-matchingbracket {outline:1px solid grey; color:white !important;} -------------------------------------------------------------------------------- /ipynbviewer/components/codemirror/theme/xq-light.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 by MarkLogic Corporation 3 | Author: Mike Brevoort 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 13 | all 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 21 | THE SOFTWARE. 22 | */ 23 | .cm-s-xq-light span.cm-keyword {line-height: 1em; font-weight: bold; color: #5A5CAD; } 24 | .cm-s-xq-light span.cm-atom {color: #6C8CD5;} 25 | .cm-s-xq-light span.cm-number {color: #164;} 26 | .cm-s-xq-light span.cm-def {text-decoration:underline;} 27 | .cm-s-xq-light span.cm-variable {color: black; } 28 | .cm-s-xq-light span.cm-variable-2 {color:black;} 29 | .cm-s-xq-light span.cm-variable-3 {color: black; } 30 | .cm-s-xq-light span.cm-property {} 31 | .cm-s-xq-light span.cm-operator {} 32 | .cm-s-xq-light span.cm-comment {color: #0080FF; font-style: italic;} 33 | .cm-s-xq-light span.cm-string {color: red;} 34 | .cm-s-xq-light span.cm-meta {color: yellow;} 35 | .cm-s-xq-light span.cm-qualifier {color: grey} 36 | .cm-s-xq-light span.cm-builtin {color: #7EA656;} 37 | .cm-s-xq-light span.cm-bracket {color: #cc7;} 38 | .cm-s-xq-light span.cm-tag {color: #3F7F7F;} 39 | .cm-s-xq-light span.cm-attribute {color: #7F007F;} 40 | .cm-s-xq-light span.cm-error {color: #f00;} 41 | 42 | .cm-s-xq-light .CodeMirror-activeline-background {background: #e8f2ff !important;} 43 | .cm-s-xq-light .CodeMirror-matchingbracket {outline:1px solid grey;color:black !important;background:yellow;} -------------------------------------------------------------------------------- /ipynbviewer/components/font-awesome/font/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/font-awesome/font/FontAwesome.otf -------------------------------------------------------------------------------- /ipynbviewer/components/font-awesome/font/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/font-awesome/font/fontawesome-webfont.eot -------------------------------------------------------------------------------- /ipynbviewer/components/font-awesome/font/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/font-awesome/font/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /ipynbviewer/components/font-awesome/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/font-awesome/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/animated-overlay.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/animated-overlay.gif -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_flat_75_ffffff_40x100.png -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/components/jquery-ui/themes/smoothness/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /ipynbviewer/static/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "static", 3 | "version": "0.0.0", 4 | "dependencies": { 5 | "Font-Awesome": "~4.0.3", 6 | "animate.css": "~3.0.0", 7 | "headroom.js": "~0.3.9", 8 | "requirejs": "~2.1", 9 | "moment": "~2.6.0" 10 | } 11 | } -------------------------------------------------------------------------------- /ipynbviewer/static/components/Font-Awesome/fonts/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/components/Font-Awesome/fonts/FontAwesome.otf -------------------------------------------------------------------------------- /ipynbviewer/static/components/Font-Awesome/fonts/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/components/Font-Awesome/fonts/fontawesome-webfont.eot -------------------------------------------------------------------------------- /ipynbviewer/static/components/Font-Awesome/fonts/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/components/Font-Awesome/fonts/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /ipynbviewer/static/components/Font-Awesome/fonts/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/components/Font-Awesome/fonts/fontawesome-webfont.woff -------------------------------------------------------------------------------- /ipynbviewer/static/components/requirejs/README.md: -------------------------------------------------------------------------------- 1 | # requirejs-bower 2 | 3 | Bower packaging for [RequireJS](http://requirejs.org). 4 | 5 | -------------------------------------------------------------------------------- /ipynbviewer/static/components/requirejs/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "requirejs", 3 | "version": "2.1.11", 4 | "homepage": "http://requirejs.org", 5 | "authors": [ 6 | "jrburke.com" 7 | ], 8 | "description": "A file and module loader for JavaScript", 9 | "main": "require.js", 10 | "keywords": [ 11 | "AMD" 12 | ], 13 | "license": "new BSD, and MIT", 14 | "gitHead": "78b2855258a2bb18ee8584fe3cb743f6b94a5bb1", 15 | "readme": "# requirejs-bower\n\nBower packaging for [RequireJS](http://requirejs.org).\n\n", 16 | "readmeFilename": "README.md", 17 | "_id": "requirejs@2.1.11", 18 | "repository": { 19 | "type": "git", 20 | "url": "git://github.com/jrburke/requirejs-bower.git" 21 | } 22 | } -------------------------------------------------------------------------------- /ipynbviewer/static/css/boilerplate.css: -------------------------------------------------------------------------------- 1 | /** 2 | * HTML5 ✰ Boilerplate 3 | * 4 | * style.css contains a reset, font normalization and some base styles. 5 | * 6 | * Credit is left where credit is due. 7 | * Much inspiration was taken from these projects: 8 | * - yui.yahooapis.com/2.8.1/build/base/base.css 9 | * - camendesign.com/design/ 10 | * - praegnanz.de/weblog/htmlcssjs-kickstart 11 | */ 12 | 13 | 14 | /** 15 | * html5doctor.com Reset Stylesheet (Eric Meyer's Reset Reloaded + HTML5 baseline) 16 | * v1.6.1 2010-09-17 | Authors: Eric Meyer & Richard Clark 17 | * html5doctor.com/html-5-reset-stylesheet/ 18 | */ 19 | 20 | html, body, div, span, object, iframe, 21 | h1, h2, h3, h4, h5, h6, p, blockquote, pre, 22 | abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, 23 | small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, 24 | fieldset, form, label, legend, 25 | table, caption, tbody, tfoot, thead, tr, th, td, 26 | article, aside, canvas, details, figcaption, figure, 27 | footer, header, hgroup, menu, nav, section, summary, 28 | time, mark, audio, video { 29 | margin: 0; 30 | padding: 0; 31 | border: 0; 32 | font-size: 100%; 33 | font: inherit; 34 | vertical-align: baseline; 35 | } 36 | 37 | sup { vertical-align: super; } 38 | sub { vertical-align: sub; } 39 | 40 | article, aside, details, figcaption, figure, 41 | footer, header, hgroup, menu, nav, section { 42 | display: block; 43 | } 44 | 45 | blockquote, q { quotes: none; } 46 | 47 | blockquote:before, blockquote:after, 48 | q:before, q:after { content: ""; content: none; } 49 | 50 | ins { background-color: #ff9; color: #000; text-decoration: none; } 51 | 52 | mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; } 53 | 54 | del { text-decoration: line-through; } 55 | 56 | abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; } 57 | 58 | table { border-collapse: collapse; border-spacing: 0; } 59 | 60 | hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; } 61 | 62 | input, select { vertical-align: middle; } 63 | 64 | 65 | /** 66 | * Font normalization inspired by YUI Library's fonts.css: developer.yahoo.com/yui/ 67 | */ 68 | 69 | body { font:13px/1.231 sans-serif; *font-size:small; } /* Hack retained to preserve specificity */ 70 | select, input, textarea, button { font:99% sans-serif; } 71 | 72 | /* Normalize monospace sizing: 73 | en.wikipedia.org/wiki/MediaWiki_talk:Common.css/Archive_11#Teletype_style_fix_for_Chrome */ 74 | pre, code, kbd, samp { font-family: monospace, sans-serif; } 75 | 76 | em,i { font-style: italic; } 77 | b,strong { font-weight: bold; } 78 | -------------------------------------------------------------------------------- /ipynbviewer/static/css/nbviewer.css: -------------------------------------------------------------------------------- 1 | // get fixed navbar on mobiles 2 | @media (max-width: 767px) /* @grid-float-breakpoint -1 */ 3 | { 4 | .navbar-fixed-top 5 | { 6 | position: fixed; 7 | top: 0; 8 | margin-left:0; 9 | margin-right:0; 10 | } 11 | } 12 | 13 | .masthead { 14 | margin: 30px 0px; 15 | } 16 | 17 | .masthead p { 18 | margin-bottom: 25px; 19 | } 20 | 21 | .masthead h1 { 22 | margin-bottom: 10px; 23 | } 24 | 25 | 26 | .menu-icon { 27 | line-height: 8px; 28 | margin-right: 5px; 29 | position:relative; 30 | top:5px; 31 | } 32 | 33 | h3.section-heading { 34 | text-align: center; 35 | } 36 | 37 | 38 | 39 | input#main-input { 40 | /* This matches the width of the Go button to properly center things */ 41 | margin-left: -25px; 42 | } 43 | 44 | @media (min-width: 768px){ 45 | .menu-text{ 46 | display:none 47 | } 48 | } 49 | pre, code { 50 | /* restore default mono font */ 51 | font-family: monospace; 52 | } 53 | 54 | .footer { 55 | padding-top: 0px; 56 | padding-bottom: 0px; 57 | margin-top: 15px; 58 | } 59 | 60 | .footer-row { 61 | margin-top: 25px; 62 | margin-bottom: 25px; 63 | } 64 | 65 | td.page_links { 66 | text-align: center; 67 | } 68 | -------------------------------------------------------------------------------- /ipynbviewer/static/css/override.css: -------------------------------------------------------------------------------- 1 | #header { 2 | display: block; 3 | } 4 | 5 | #site { 6 | display: block; 7 | } 8 | 9 | #header-spacer { 10 | height: 65px; 11 | } 12 | 13 | #tab_content { 14 | padding-top: 0; 15 | } -------------------------------------------------------------------------------- /ipynbviewer/static/css/theme/cdp_1.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "Computer Modern"; 3 | src: url('http://mirrors.ctan.org/fonts/cm-unicode/fonts/otf/cmunss.otf'); 4 | } 5 | div.cell{ 6 | width:800px; 7 | margin-left:auto; 8 | margin-right:auto; 9 | } 10 | h1 { 11 | font-family: "Charis SIL", Palatino, serif; 12 | } 13 | div.text_cell_render{ 14 | font-family: Computer Modern, "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; 15 | line-height: 145%; 16 | font-size: 120%; 17 | width:800px; 18 | margin-left:auto; 19 | margin-right:auto; 20 | } 21 | .CodeMirror{ 22 | font-family: "Source Code Pro", source-code-pro,Consolas, monospace; 23 | } 24 | .prompt{ 25 | display: None; 26 | } 27 | .text_cell_render h5 { 28 | font-weight: 300; 29 | font-size: 16pt; 30 | color: #4057A1; 31 | font-style: italic; 32 | margin-bottom: .5em; 33 | margin-top: 0.5em; 34 | display: block; 35 | } 36 | 37 | .warning{ 38 | color: rgb( 240, 20, 20 ) 39 | } 40 | -------------------------------------------------------------------------------- /ipynbviewer/static/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/favicon.ico -------------------------------------------------------------------------------- /ipynbviewer/static/ico/apple-touch-icon-114-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/ico/apple-touch-icon-114-precomposed.png -------------------------------------------------------------------------------- /ipynbviewer/static/ico/apple-touch-icon-144-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/ico/apple-touch-icon-144-precomposed.png -------------------------------------------------------------------------------- /ipynbviewer/static/ico/apple-touch-icon-57-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/ico/apple-touch-icon-57-precomposed.png -------------------------------------------------------------------------------- /ipynbviewer/static/ico/apple-touch-icon-72-precomposed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/ico/apple-touch-icon-72-precomposed.png -------------------------------------------------------------------------------- /ipynbviewer/static/ico/ipynb_icon_16x16.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/ico/ipynb_icon_16x16.ico -------------------------------------------------------------------------------- /ipynbviewer/static/ico/ipynb_icon_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/ico/ipynb_icon_16x16.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/Python-logo-notext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/Python-logo-notext.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/bird.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/bird.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/XKCD-Matplotlib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/XKCD-Matplotlib.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/bayesian-chap1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/bayesian-chap1.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/bokeh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/bokeh.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/covariance.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/covariance.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/data-cleanup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/data-cleanup.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/exploring_r_formula.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/exploring_r_formula.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/fitting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/fitting.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/gaza.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/gaza.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/ijulia-preview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/ijulia-preview.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/ip-examples-list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/ip-examples-list.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/ipython-thumb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/ipython-thumb.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/iruby-nb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/iruby-nb.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/jaynes-cummings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/jaynes-cummings.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/mining-slice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/mining-slice.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/nose_testing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/nose_testing.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/numpy_tests.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/numpy_tests.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/pandas_timeseries.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/pandas_timeseries.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/pde_solver_with_numpy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/pde_solver_with_numpy.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/plotly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/plotly.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/probabilistic-bayesian.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/probabilistic-bayesian.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/python-signal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/python-signal.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/python_for_visres.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/python_for_visres.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/r_magic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/r_magic.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/readme.md: -------------------------------------------------------------------------------- 1 | # Images for frontpage 2 | 3 | This contain images for the frontpage of nbviewer. 4 | 5 | at most thoses images will be show with a size of 360x225 (W x H), aspect ratio 6 | (W/H) of 1.6. As they might be show on retina display, consider using a double 7 | resolution. Resizing will be handled by browser, so to avoid artifact images 8 | shoudl be of size multiple of maximum size ie (720 width) by (450 height), 9 | preferentially in png, and passed to png crusher as the number of request for 10 | thoses images will be heigh. 11 | 12 | 13 | -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/sympy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/sympy.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/example-nb/working_with_pandas.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/example-nb/working_with_pandas.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/github-16px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/github-16px.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/glyphicons/glyphicons_009_magic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/glyphicons/glyphicons_009_magic.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/glyphicons/glyphicons_042_group.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/glyphicons/glyphicons_042_group.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/glyphicons/glyphicons_079_podium.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/glyphicons/glyphicons_079_podium.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/glyphicons/glyphicons_082_roundabout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/glyphicons/glyphicons_082_roundabout.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/glyphicons/glyphicons_155_show_thumbnails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/glyphicons/glyphicons_155_show_thumbnails.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/glyphicons/glyphicons_163_iphone.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/glyphicons/glyphicons_163_iphone.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/glyphicons/glyphicons_214_resize_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/glyphicons/glyphicons_214_resize_small.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/glyphicons/glyphicons_266_book_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/glyphicons/glyphicons_266_book_open.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/grid-18px-masked.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/grid-18px-masked.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/icon-css3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/icon-css3.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/icon-github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/icon-github.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/icon-html5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/icon-html5.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/icon-twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/icon-twitter.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/ipynblogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/ipynblogo.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/less-logo-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/less-logo-large.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/less-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/less-small.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/responsive-illustrations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/responsive-illustrations.png -------------------------------------------------------------------------------- /ipynbviewer/static/img/th_github.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dongweiming/Ipynb-viewer/df08ef9db7676985042bbbf952b9f0b4c3ce2186/ipynbviewer/static/img/th_github.jpeg -------------------------------------------------------------------------------- /ipynbviewer/static/js/README.md: -------------------------------------------------------------------------------- 1 | ## 2.0 BOOTSTRAP JS PHILOSOPHY 2 | These are the high-level design rules which guide the development of Bootstrap's plugin apis. 3 | 4 | --- 5 | 6 | ### DATA-ATTRIBUTE API 7 | 8 | We believe you should be able to use all plugins provided by Bootstrap purely through the markup API without writing a single line of javascript. 9 | 10 | We acknowledge that this isn't always the most performant and sometimes it may be desirable to turn this functionality off altogether. Therefore, as of 2.0 we provide the ability to disable the data attribute API by unbinding all events on the body namespaced with `'data-api'`. This looks like this: 11 | 12 | $('body').off('.data-api') 13 | 14 | To target a specific plugin, just include the plugins name as a namespace along with the data-api namespace like this: 15 | 16 | $('body').off('.alert.data-api') 17 | 18 | --- 19 | 20 | ### PROGRAMATIC API 21 | 22 | We also believe you should be able to use all plugins provided by Bootstrap purely through the JS API. 23 | 24 | All public APIs should be single, chainable methods, and return the collection acted upon. 25 | 26 | $(".btn.danger").button("toggle").addClass("fat") 27 | 28 | All methods should accept an optional options object, a string which targets a particular method, or null which initiates the default behavior: 29 | 30 | $("#myModal").modal() // initialized with defaults 31 | $("#myModal").modal({ keyboard: false }) // initialized with now keyboard 32 | $("#myModal").modal('show') // initializes and invokes show immediately afterqwe2 33 | 34 | --- 35 | 36 | ### OPTIONS 37 | 38 | Options should be sparse and add universal value. We should pick the right defaults. 39 | 40 | All plugins should have a default object which can be modified to effect all instance's default options. The defaults object should be available via `$.fn.plugin.defaults`. 41 | 42 | $.fn.modal.defaults = { … } 43 | 44 | An options definition should take the following form: 45 | 46 | *noun*: *adjective* - describes or modifies a quality of an instance 47 | 48 | examples: 49 | 50 | backdrop: true 51 | keyboard: false 52 | placement: 'top' 53 | 54 | --- 55 | 56 | ### EVENTS 57 | 58 | All events should have an infinitive and past participle form. The infinitive is fired just before an action takes place, the past participle on completion of the action. 59 | 60 | show | shown 61 | hide | hidden 62 | 63 | --- 64 | 65 | ### CONSTRUCTORS 66 | 67 | Each plugin should expose it's raw constructor on a `Constructor` property -- accessed in the following way: 68 | 69 | 70 | $.fn.popover.Constructor 71 | 72 | --- 73 | 74 | ### DATA ACCESSOR 75 | 76 | Each plugin stores a copy of the invoked class on an object. This class instance can be accessed directly through jQuery's data API like this: 77 | 78 | $('[rel=popover]').data('popover') instanceof $.fn.popover.Constructor 79 | 80 | --- 81 | 82 | ### DATA ATTRIBUTES 83 | 84 | Data attributes should take the following form: 85 | 86 | - data-{{verb}}={{plugin}} - defines main interaction 87 | - data-target || href^=# - defined on "control" element (if element controls an element other than self) 88 | - data-{{noun}} - defines class instance options 89 | 90 | examples: 91 | 92 | // control other targets 93 | data-toggle="modal" data-target="#foo" 94 | data-toggle="collapse" data-target="#foo" data-parent="#bar" 95 | 96 | // defined on element they control 97 | data-spy="scroll" 98 | 99 | data-dismiss="modal" 100 | data-dismiss="alert" 101 | 102 | data-toggle="dropdown" 103 | 104 | data-toggle="button" 105 | data-toggle="buttons-checkbox" 106 | data-toggle="buttons-radio" -------------------------------------------------------------------------------- /ipynbviewer/static/js/bootstrap-alert.js: -------------------------------------------------------------------------------- 1 | /* ========================================================== 2 | * bootstrap-alert.js v2.0.4 3 | * http://twitter.github.com/bootstrap/javascript.html#alerts 4 | * ========================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================== */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* ALERT CLASS DEFINITION 27 | * ====================== */ 28 | 29 | var dismiss = '[data-dismiss="alert"]' 30 | , Alert = function (el) { 31 | $(el).on('click', dismiss, this.close) 32 | } 33 | 34 | Alert.prototype.close = function (e) { 35 | var $this = $(this) 36 | , selector = $this.attr('data-target') 37 | , $parent 38 | 39 | if (!selector) { 40 | selector = $this.attr('href') 41 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 42 | } 43 | 44 | $parent = $(selector) 45 | 46 | e && e.preventDefault() 47 | 48 | $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) 49 | 50 | $parent.trigger(e = $.Event('close')) 51 | 52 | if (e.isDefaultPrevented()) return 53 | 54 | $parent.removeClass('in') 55 | 56 | function removeElement() { 57 | $parent 58 | .trigger('closed') 59 | .remove() 60 | } 61 | 62 | $.support.transition && $parent.hasClass('fade') ? 63 | $parent.on($.support.transition.end, removeElement) : 64 | removeElement() 65 | } 66 | 67 | 68 | /* ALERT PLUGIN DEFINITION 69 | * ======================= */ 70 | 71 | $.fn.alert = function (option) { 72 | return this.each(function () { 73 | var $this = $(this) 74 | , data = $this.data('alert') 75 | if (!data) $this.data('alert', (data = new Alert(this))) 76 | if (typeof option == 'string') data[option].call($this) 77 | }) 78 | } 79 | 80 | $.fn.alert.Constructor = Alert 81 | 82 | 83 | /* ALERT DATA-API 84 | * ============== */ 85 | 86 | $(function () { 87 | $('body').on('click.alert.data-api', dismiss, Alert.prototype.close) 88 | }) 89 | 90 | }(window.jQuery); -------------------------------------------------------------------------------- /ipynbviewer/static/js/bootstrap-button.js: -------------------------------------------------------------------------------- 1 | /* ============================================================ 2 | * bootstrap-button.js v2.0.4 3 | * http://twitter.github.com/bootstrap/javascript.html#buttons 4 | * ============================================================ 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ============================================================ */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* BUTTON PUBLIC CLASS DEFINITION 27 | * ============================== */ 28 | 29 | var Button = function (element, options) { 30 | this.$element = $(element) 31 | this.options = $.extend({}, $.fn.button.defaults, options) 32 | } 33 | 34 | Button.prototype.setState = function (state) { 35 | var d = 'disabled' 36 | , $el = this.$element 37 | , data = $el.data() 38 | , val = $el.is('input') ? 'val' : 'html' 39 | 40 | state = state + 'Text' 41 | data.resetText || $el.data('resetText', $el[val]()) 42 | 43 | $el[val](data[state] || this.options[state]) 44 | 45 | // push to event loop to allow forms to submit 46 | setTimeout(function () { 47 | state == 'loadingText' ? 48 | $el.addClass(d).attr(d, d) : 49 | $el.removeClass(d).removeAttr(d) 50 | }, 0) 51 | } 52 | 53 | Button.prototype.toggle = function () { 54 | var $parent = this.$element.parent('[data-toggle="buttons-radio"]') 55 | 56 | $parent && $parent 57 | .find('.active') 58 | .removeClass('active') 59 | 60 | this.$element.toggleClass('active') 61 | } 62 | 63 | 64 | /* BUTTON PLUGIN DEFINITION 65 | * ======================== */ 66 | 67 | $.fn.button = function (option) { 68 | return this.each(function () { 69 | var $this = $(this) 70 | , data = $this.data('button') 71 | , options = typeof option == 'object' && option 72 | if (!data) $this.data('button', (data = new Button(this, options))) 73 | if (option == 'toggle') data.toggle() 74 | else if (option) data.setState(option) 75 | }) 76 | } 77 | 78 | $.fn.button.defaults = { 79 | loadingText: 'loading...' 80 | } 81 | 82 | $.fn.button.Constructor = Button 83 | 84 | 85 | /* BUTTON DATA-API 86 | * =============== */ 87 | 88 | $(function () { 89 | $('body').on('click.button.data-api', '[data-toggle^=button]', function ( e ) { 90 | var $btn = $(e.target) 91 | if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') 92 | $btn.button('toggle') 93 | }) 94 | }) 95 | 96 | }(window.jQuery); -------------------------------------------------------------------------------- /ipynbviewer/static/js/bootstrap-dropdown.js: -------------------------------------------------------------------------------- 1 | /* ============================================================ 2 | * bootstrap-dropdown.js v2.0.4 3 | * http://twitter.github.com/bootstrap/javascript.html#dropdowns 4 | * ============================================================ 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ============================================================ */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* DROPDOWN CLASS DEFINITION 27 | * ========================= */ 28 | 29 | var toggle = '[data-toggle="dropdown"]' 30 | , Dropdown = function (element) { 31 | var $el = $(element).on('click.dropdown.data-api', this.toggle) 32 | $('html').on('click.dropdown.data-api', function () { 33 | $el.parent().removeClass('open') 34 | }) 35 | } 36 | 37 | Dropdown.prototype = { 38 | 39 | constructor: Dropdown 40 | 41 | , toggle: function (e) { 42 | var $this = $(this) 43 | , $parent 44 | , selector 45 | , isActive 46 | 47 | if ($this.is('.disabled, :disabled')) return 48 | 49 | selector = $this.attr('data-target') 50 | 51 | if (!selector) { 52 | selector = $this.attr('href') 53 | selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 54 | } 55 | 56 | $parent = $(selector) 57 | $parent.length || ($parent = $this.parent()) 58 | 59 | isActive = $parent.hasClass('open') 60 | 61 | clearMenus() 62 | 63 | if (!isActive) $parent.toggleClass('open') 64 | 65 | return false 66 | } 67 | 68 | } 69 | 70 | function clearMenus() { 71 | $(toggle).parent().removeClass('open') 72 | } 73 | 74 | 75 | /* DROPDOWN PLUGIN DEFINITION 76 | * ========================== */ 77 | 78 | $.fn.dropdown = function (option) { 79 | return this.each(function () { 80 | var $this = $(this) 81 | , data = $this.data('dropdown') 82 | if (!data) $this.data('dropdown', (data = new Dropdown(this))) 83 | if (typeof option == 'string') data[option].call($this) 84 | }) 85 | } 86 | 87 | $.fn.dropdown.Constructor = Dropdown 88 | 89 | 90 | /* APPLY TO STANDARD DROPDOWN ELEMENTS 91 | * =================================== */ 92 | 93 | $(function () { 94 | $('html').on('click.dropdown.data-api', clearMenus) 95 | $('body') 96 | .on('click.dropdown', '.dropdown form', function (e) { e.stopPropagation() }) 97 | .on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle) 98 | }) 99 | 100 | }(window.jQuery); -------------------------------------------------------------------------------- /ipynbviewer/static/js/bootstrap-popover.js: -------------------------------------------------------------------------------- 1 | /* =========================================================== 2 | * bootstrap-popover.js v2.0.4 3 | * http://twitter.github.com/bootstrap/javascript.html#popovers 4 | * =========================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * =========================================================== */ 19 | 20 | 21 | !function ($) { 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* POPOVER PUBLIC CLASS DEFINITION 27 | * =============================== */ 28 | 29 | var Popover = function ( element, options ) { 30 | this.init('popover', element, options) 31 | } 32 | 33 | 34 | /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js 35 | ========================================== */ 36 | 37 | Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { 38 | 39 | constructor: Popover 40 | 41 | , setContent: function () { 42 | var $tip = this.tip() 43 | , title = this.getTitle() 44 | , content = this.getContent() 45 | 46 | $tip.find('.popover-title')[this.isHTML(title) ? 'html' : 'text'](title) 47 | $tip.find('.popover-content > *')[this.isHTML(content) ? 'html' : 'text'](content) 48 | 49 | $tip.removeClass('fade top bottom left right in') 50 | } 51 | 52 | , hasContent: function () { 53 | return this.getTitle() || this.getContent() 54 | } 55 | 56 | , getContent: function () { 57 | var content 58 | , $e = this.$element 59 | , o = this.options 60 | 61 | content = $e.attr('data-content') 62 | || (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) 63 | 64 | return content 65 | } 66 | 67 | , tip: function () { 68 | if (!this.$tip) { 69 | this.$tip = $(this.options.template) 70 | } 71 | return this.$tip 72 | } 73 | 74 | }) 75 | 76 | 77 | /* POPOVER PLUGIN DEFINITION 78 | * ======================= */ 79 | 80 | $.fn.popover = function (option) { 81 | return this.each(function () { 82 | var $this = $(this) 83 | , data = $this.data('popover') 84 | , options = typeof option == 'object' && option 85 | if (!data) $this.data('popover', (data = new Popover(this, options))) 86 | if (typeof option == 'string') data[option]() 87 | }) 88 | } 89 | 90 | $.fn.popover.Constructor = Popover 91 | 92 | $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { 93 | placement: 'right' 94 | , content: '' 95 | , template: '

' 96 | }) 97 | 98 | }(window.jQuery); -------------------------------------------------------------------------------- /ipynbviewer/static/js/bootstrap-transition.js: -------------------------------------------------------------------------------- 1 | /* =================================================== 2 | * bootstrap-transition.js v2.0.4 3 | * http://twitter.github.com/bootstrap/javascript.html#transitions 4 | * =================================================== 5 | * Copyright 2012 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ========================================================== */ 19 | 20 | 21 | !function ($) { 22 | 23 | $(function () { 24 | 25 | "use strict"; // jshint ;_; 26 | 27 | 28 | /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) 29 | * ======================================================= */ 30 | 31 | $.support.transition = (function () { 32 | 33 | var transitionEnd = (function () { 34 | 35 | var el = document.createElement('bootstrap') 36 | , transEndEventNames = { 37 | 'WebkitTransition' : 'webkitTransitionEnd' 38 | , 'MozTransition' : 'transitionend' 39 | , 'OTransition' : 'oTransitionEnd' 40 | , 'msTransition' : 'MSTransitionEnd' 41 | , 'transition' : 'transitionend' 42 | } 43 | , name 44 | 45 | for (name in transEndEventNames){ 46 | if (el.style[name] !== undefined) { 47 | return transEndEventNames[name] 48 | } 49 | } 50 | 51 | }()) 52 | 53 | return transitionEnd && { 54 | end: transitionEnd 55 | } 56 | 57 | })() 58 | 59 | }) 60 | 61 | }(window.jQuery); -------------------------------------------------------------------------------- /ipynbviewer/static/js/google-code-prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .com { color: #93a1a1; } 2 | .lit { color: #195f91; } 3 | .pun, .opn, .clo { color: #93a1a1; } 4 | .fun { color: #dc322f; } 5 | .str, .atv { color: #D14; } 6 | .kwd, .linenums .tag { color: #1e347b; } 7 | .typ, .atn, .dec, .var { color: teal; } 8 | .pln { color: #48484c; } 9 | 10 | .prettyprint { 11 | padding: 8px; 12 | background-color: #f7f7f9; 13 | border: 1px solid #e1e1e8; 14 | } 15 | .prettyprint.linenums { 16 | -webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 17 | -moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 18 | box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0; 19 | } 20 | 21 | /* Specify class=linenums on a pre to get line numbering */ 22 | ol.linenums { 23 | margin: 0 0 0 33px; /* IE indents via margin-left */ 24 | } 25 | ol.linenums li { 26 | padding-left: 12px; 27 | color: #bebec5; 28 | line-height: 18px; 29 | text-shadow: 0 1px 0 #fff; 30 | } -------------------------------------------------------------------------------- /ipynbviewer/static/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: 3 | -------------------------------------------------------------------------------- /ipynbviewer/templates/404.html: -------------------------------------------------------------------------------- 1 | {% extends "error.html" %} 2 | {% block error_detail %} 3 |

You are requesting a page that does not exist!

4 | {% if 'HTTP 404' in message %} 5 | 6 | {% elif message %} 7 | 8 | {% endif %} 9 | {% endblock %} 10 | 11 | -------------------------------------------------------------------------------- /ipynbviewer/templates/error.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | {% block body %} 3 | 4 |
5 |
6 | {% block h1_error %} 7 |

{{status_code}} : {{status_message}}

8 | {% endblock h1_error %} 9 | {% block error_detail %} 10 | {% endblock %} 11 |
12 |
13 | 14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /ipynbviewer/templates/slow_notebook.html: -------------------------------------------------------------------------------- 1 | {% extends "layout.html" %} 2 | {% block body %} 3 |
4 |
5 |

Working...

6 |

This notebook is taking a long time to render.

7 |

Please wait, the page will reload in a few seconds.

8 |
9 |
10 | 11 | 14 | {% endblock %} 15 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | futures 2 | pygments 3 | markdown 4 | ipython 5 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | pjoin = os.path.join 3 | 4 | from setuptools import setup 5 | 6 | 7 | def walk_subpkg(name): 8 | data_files = [] 9 | package_dir = 'ipynbviewer' 10 | for parent, dirs, files in os.walk(os.path.join(package_dir, name)): 11 | # remove package_dir from the path 12 | sub_dir = os.sep.join(parent.split(os.sep)[1:]) 13 | for f in files: 14 | data_files.append(os.path.join(sub_dir, f)) 15 | return data_files 16 | 17 | pkg_data = { 18 | "ipynbviewer": walk_subpkg('static') + walk_subpkg('templates') 19 | } 20 | 21 | setup_args = dict( 22 | name="ipynbviewer", 23 | version='0.3', 24 | packages=["ipynbviewer"], 25 | package_data=pkg_data, 26 | author="Dongweiming", 27 | author_email="ciici123@gmail.com", 28 | url='https://github.com/dongweiming/ipynb-viewer', 29 | description="Rendering local ipynb to static HTML", 30 | long_description="nbconvert as a web service", 31 | license="BSD", 32 | classifiers=[ 33 | 'License :: OSI Approved :: BSD License', 34 | 'Programming Language :: Python :: 2', 35 | 'Programming Language :: Python :: 2.7', 36 | 'Programming Language :: Python :: 3', 37 | 'Programming Language :: Python :: 3.3', 38 | ], 39 | install_requires=[ 40 | 'futures', 41 | 'pygments', 42 | 'markdown', 43 | 'ipython', 44 | ], 45 | ) 46 | 47 | setup(**setup_args) 48 | --------------------------------------------------------------------------------