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