Show More
@@ -15,6 +15,7 b' before_install:' | |||
|
15 | 15 | - time sudo apt-get update |
|
16 | 16 | - time sudo apt-get install pandoc casperjs nodejs libzmq3-dev |
|
17 | 17 | - time pip install -f https://nipy.bic.berkeley.edu/wheelhouse/travis jinja2 sphinx pygments tornado requests mock pyzmq jsonschema jsonpointer |
|
18 | - time npm install requirejs r.js jquery | |
|
18 | 19 | install: |
|
19 | 20 | - time python setup.py install -q |
|
20 | 21 | script: |
@@ -8,7 +8,8 b' define([' | |||
|
8 | 8 | 'base/js/security', |
|
9 | 9 | 'notebook/js/mathjaxutils', |
|
10 | 10 | 'notebook/js/celltoolbar', |
|
11 | ], function(IPython, $, cell, security, mathjaxutils, celltoolbar) { | |
|
11 | 'components/marked/lib/marked', | |
|
12 | ], function(IPython, $, cell, security, mathjaxutils, celltoolbar, marked) { | |
|
12 | 13 | "use strict"; |
|
13 | 14 | var Cell = cell.Cell; |
|
14 | 15 |
@@ -5,17 +5,24 b'' | |||
|
5 | 5 | // IPython static_path dir relative to here: |
|
6 | 6 | var static_path = __dirname + "/../../html/static/"; |
|
7 | 7 | |
|
8 | var fs = require('fs'); | |
|
9 | var IPython; | |
|
10 | // marked can be loaded with require, | |
|
11 | // the others must be execfiled | |
|
12 | var marked = require(static_path + 'components/marked/lib/marked.js'); | |
|
13 | ||
|
14 | eval(fs.readFileSync(static_path + "components/highlight.js/build/highlight.pack.js", 'utf8')); | |
|
15 | eval(fs.readFileSync(static_path + "base/js/namespace.js", 'utf8')); | |
|
8 | // Excerpt from the example in require.js docs | |
|
9 | // http://requirejs.org/docs/node.html | |
|
10 | var requirejs = require('requirejs'); | |
|
11 | requirejs.config({ | |
|
12 | //Pass the top-level main.js/index.js require | |
|
13 | //function to requirejs so that node modules | |
|
14 | //are loaded relative to the top-level JS file. | |
|
15 | nodeRequire: require, | |
|
16 | baseUrl: static_path, | |
|
17 | }); | |
|
16 | 18 | |
|
17 | eval(fs.readFileSync(static_path + "base/js/utils.js", 'utf8')); | |
|
18 | eval(fs.readFileSync(static_path + "notebook/js/mathjaxutils.js", 'utf8')); | |
|
19 | requirejs([ | |
|
20 | 'fs', | |
|
21 | 'components/marked/lib/marked', | |
|
22 | 'components/highlight.js/build/highlight.pack', | |
|
23 | 'base/js/utils', | |
|
24 | 'notebook/js/mathjaxutils', | |
|
25 | ], function(fs, marked, hljs, utils, mathjaxutils) { | |
|
19 | 26 | |
|
20 | 27 | // this is copied from notebook.main. Should it be moved somewhere we can reuse it? |
|
21 | 28 | marked.setOptions({ |
@@ -45,10 +52,12 b' process.stdin.on("data", function (data) {' | |||
|
45 | 52 | |
|
46 | 53 | // perform the md2html transform once stdin is complete |
|
47 | 54 | process.stdin.on("end", function () { |
|
48 |
var text_and_math = |
|
|
55 | var text_and_math = mathjaxutils.remove_math(md); | |
|
49 | 56 | var text = text_and_math[0]; |
|
50 | 57 | var math = text_and_math[1]; |
|
51 | 58 | var html = marked.parser(marked.lexer(text)); |
|
52 |
html = |
|
|
59 | html = mathjaxutils.replace_math(html, math); | |
|
53 | 60 | process.stdout.write(html); |
|
54 | 61 | }); |
|
62 | ||
|
63 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now