Show More
@@ -119,11 +119,6 b' class IPythonHandler(AuthenticatedHandler):' | |||||
119 | else: |
|
119 | else: | |
120 | return app_log |
|
120 | return app_log | |
121 |
|
121 | |||
122 | @property |
|
|||
123 | def use_less(self): |
|
|||
124 | """Use less instead of css in templates""" |
|
|||
125 | return self.settings.get('use_less', False) |
|
|||
126 |
|
||||
127 | #--------------------------------------------------------------- |
|
122 | #--------------------------------------------------------------- | |
128 | # URLs |
|
123 | # URLs | |
129 | #--------------------------------------------------------------- |
|
124 | #--------------------------------------------------------------- | |
@@ -193,7 +188,6 b' class IPythonHandler(AuthenticatedHandler):' | |||||
193 | base_kernel_url=self.base_kernel_url, |
|
188 | base_kernel_url=self.base_kernel_url, | |
194 | logged_in=self.logged_in, |
|
189 | logged_in=self.logged_in, | |
195 | login_available=self.login_available, |
|
190 | login_available=self.login_available, | |
196 | use_less=self.use_less, |
|
|||
197 | static_url=self.static_url, |
|
191 | static_url=self.static_url, | |
198 | ) |
|
192 | ) | |
199 |
|
193 |
@@ -27,7 +27,6 b' def _compile_less(source, target, minify=True, verbose=False):' | |||||
27 | verbose = _to_bool(verbose) |
|
27 | verbose = _to_bool(verbose) | |
28 | min_flag = '-x' if minify is True else '' |
|
28 | min_flag = '-x' if minify is True else '' | |
29 | ver_flag = '--verbose' if verbose is True else '' |
|
29 | ver_flag = '--verbose' if verbose is True else '' | |
30 | lessc = os.path.join('components', 'less.js', 'bin', 'lessc') |
|
|||
31 | with lcd(static_dir): |
|
30 | with lcd(static_dir): | |
32 |
local(' |
|
31 | local('lessc {min_flag} {ver_flag} {source} {target}'.format(**locals())) | |
33 |
|
32 |
@@ -180,7 +180,6 b' class NotebookWebApplication(web.Application):' | |||||
180 | nbextensions_path = ipython_app.nbextensions_path, |
|
180 | nbextensions_path = ipython_app.nbextensions_path, | |
181 | mathjax_url=ipython_app.mathjax_url, |
|
181 | mathjax_url=ipython_app.mathjax_url, | |
182 | config=ipython_app.config, |
|
182 | config=ipython_app.config, | |
183 | use_less=ipython_app.use_less, |
|
|||
184 | jinja2_env=Environment(loader=FileSystemLoader(template_path)), |
|
183 | jinja2_env=Environment(loader=FileSystemLoader(template_path)), | |
185 | ) |
|
184 | ) | |
186 |
|
185 | |||
@@ -395,18 +394,6 b' class NotebookApp(BaseIPythonApplication):' | |||||
395 | BROWSER environment variable to override it. |
|
394 | BROWSER environment variable to override it. | |
396 | """) |
|
395 | """) | |
397 |
|
396 | |||
398 | use_less = Bool(False, config=True, |
|
|||
399 | help="""Wether to use Browser Side less-css parsing |
|
|||
400 | instead of compiled css version in templates that allows |
|
|||
401 | it. This is mainly convenient when working on the less |
|
|||
402 | file to avoid a build step, or if user want to overwrite |
|
|||
403 | some of the less variables without having to recompile |
|
|||
404 | everything. |
|
|||
405 |
|
||||
406 | You will need to install the less.js component in the static directory |
|
|||
407 | either in the source tree or in your profile folder. |
|
|||
408 | """) |
|
|||
409 |
|
||||
410 | webapp_settings = Dict(config=True, |
|
397 | webapp_settings = Dict(config=True, | |
411 | help="Supply overrides for the tornado.web.Application that the " |
|
398 | help="Supply overrides for the tornado.web.Application that the " | |
412 | "IPython notebook uses.") |
|
399 | "IPython notebook uses.") |
@@ -1,1 +1,1 b'' | |||||
1 | Subproject commit 1977b852048ecb05f66d3b8980221080c5decc49 |
|
1 | Subproject commit 0972b5683e1300f378537aa8eb6350a55070cbb9 |
@@ -13,13 +13,7 b'' | |||||
13 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
13 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
14 |
|
14 | |||
15 | {% block stylesheet %} |
|
15 | {% block stylesheet %} | |
16 | {% block lesscss %} |
|
16 | <link rel="stylesheet" href="{{ static_url("style/style.min.css") }}" type="text/css"/> | |
17 | {% if use_less %} |
|
|||
18 | <link rel="stylesheet/less" href="{{ static_url("style/style.less") }}" type="text/css" /> |
|
|||
19 | {% else %} |
|
|||
20 | <link rel="stylesheet" href="{{ static_url("style/style.min.css") }}" type="text/css"/> |
|
|||
21 | {% endif %} |
|
|||
22 | {% endblock %} |
|
|||
23 | {% endblock %} |
|
17 | {% endblock %} | |
24 | <link rel="stylesheet" href="{{ static_url("custom/custom.css") }}" type="text/css" /> |
|
18 | <link rel="stylesheet" href="{{ static_url("custom/custom.css") }}" type="text/css" /> | |
25 | <script src="{{static_url("components/requirejs/require.js") }}" type="text/javascript" charset="utf-8"></script> |
|
19 | <script src="{{static_url("components/requirejs/require.js") }}" type="text/javascript" charset="utf-8"></script> | |
@@ -82,9 +76,6 b'' | |||||
82 | <script src="{{static_url("auth/js/loginwidget.js") }}" type="text/javascript" charset="utf-8"></script> |
|
76 | <script src="{{static_url("auth/js/loginwidget.js") }}" type="text/javascript" charset="utf-8"></script> | |
83 |
|
77 | |||
84 | {% block script %} |
|
78 | {% block script %} | |
85 | {% if use_less %} |
|
|||
86 | <script src="{{ static_url("components/less.js/dist/less-1.3.3.min.js") }}" charset="utf-8"></script> |
|
|||
87 | {% endif %} |
|
|||
88 | {% endblock %} |
|
79 | {% endblock %} | |
89 |
|
80 | |||
90 | <script src="{{static_url("custom/custom.js") }}" type="text/javascript" charset="utf-8"></script> |
|
81 | <script src="{{static_url("custom/custom.js") }}" type="text/javascript" charset="utf-8"></script> |
@@ -10,7 +10,7 b' casper.notebook_test(function () {' | |||||
10 | cell.render(); |
|
10 | cell.render(); | |
11 | return cell.get_rendered(); |
|
11 | return cell.get_rendered(); | |
12 | }); |
|
12 | }); | |
13 | this.test.assertEquals(output, '<h1>Foo</h1>', 'Markdown JS API works.'); |
|
13 | this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown JS API works.'); | |
14 |
|
14 | |||
15 | // Test menubar entries. |
|
15 | // Test menubar entries. | |
16 | output = this.evaluate(function () { |
|
16 | output = this.evaluate(function () { | |
@@ -21,7 +21,7 b' casper.notebook_test(function () {' | |||||
21 | $('#run_cell').mouseenter().click(); |
|
21 | $('#run_cell').mouseenter().click(); | |
22 | return cell.get_rendered(); |
|
22 | return cell.get_rendered(); | |
23 | }); |
|
23 | }); | |
24 | this.test.assertEquals(output, '<h1>Foo</h1>', 'Markdown menubar items work.'); |
|
24 | this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown menubar items work.'); | |
25 |
|
25 | |||
26 | // Test toolbar buttons. |
|
26 | // Test toolbar buttons. | |
27 | output = this.evaluate(function () { |
|
27 | output = this.evaluate(function () { | |
@@ -32,5 +32,5 b' casper.notebook_test(function () {' | |||||
32 | $('#run_b').click(); |
|
32 | $('#run_b').click(); | |
33 | return cell.get_rendered(); |
|
33 | return cell.get_rendered(); | |
34 | }); |
|
34 | }); | |
35 | this.test.assertEquals(output, '<h1>Foo</h1>', 'Markdown toolbar items work.'); |
|
35 | this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown toolbar items work.'); | |
36 | }); |
|
36 | }); |
General Comments 0
You need to be logged in to leave comments.
Login now