Repository: ipython/ipython

Issue:
missing build script for highlight.js
The highlight.js folder is missing tools/build.py required to build it from source.
This is annoying for packaging so please add it, also in the 1.x branch. For debian the embedded yuicompressor is not needed as the packaged one can be used.



Discussion:
how is this inconvenient for packaging?

I have to add the script to the package manually, its not a big deal, but neither is doing it in ipython directly.

I am just wondering why the script has to be added at all.

it just saves nerves being able to run a build fabfile that actually works.

distribution rules, no minified javascript without being built from source.

ok, I'll make sure the change gets into ipython-components

going to be a pain for 1.x

hm I overlooked highlight.js is actually already packaged in debian so I can use that instead.
So from my point of view 1.x can be skipped if it is too inconvinient, but please do it in master.

any other changes you have noticed that we need in the js?

is less.js used at runtime? I didn't test that under the assumption that its only used a buildtime.

jquery is an gray area unminified version is there but not the separate files, I guess I can get away with that.
does ipython run ok with 1.7.2?

bootstrap seems to build ok (unfortunately recess is utterly broken with recent less.js ...)
require.js does not seem to need a build, unminified source there.
font-awesome I can use a package, source seem available, so shouldn't be a problem.

- less is only used for development, not at runtime.
- I don't know about jquery 1.7.2, but it's worth testing. I would expect it to work fine.

Okay, I won't make any other changes. Thanks.


Resolving patch:
diff --git a/IPython/html/base/handlers.py b/IPython/html/base/handlers.py
--- a/IPython/html/base/handlers.py
+++ b/IPython/html/base/handlers.py
@@ -119,11 +119,6 @@ def log(self):
         else:
             return app_log
     
-    @property
-    def use_less(self):
-        """Use less instead of css in templates"""
-        return self.settings.get('use_less', False)
-    
     #---------------------------------------------------------------
     # URLs
     #---------------------------------------------------------------
@@ -193,7 +188,6 @@ def template_namespace(self):
             base_kernel_url=self.base_kernel_url,
             logged_in=self.logged_in,
             login_available=self.login_available,
-            use_less=self.use_less,
             static_url=self.static_url,
         )
     
diff --git a/IPython/html/fabfile.py b/IPython/html/fabfile.py
--- a/IPython/html/fabfile.py
+++ b/IPython/html/fabfile.py
@@ -27,7 +27,6 @@ def _compile_less(source, target, minify=True, verbose=False):
     verbose = _to_bool(verbose)
     min_flag = '-x' if minify is True else ''
     ver_flag = '--verbose' if verbose is True else ''
-    lessc = os.path.join('components', 'less.js', 'bin', 'lessc')
     with lcd(static_dir):
-        local('{lessc} {min_flag} {ver_flag} {source} {target}'.format(**locals()))
+        local('lessc {min_flag} {ver_flag} {source} {target}'.format(**locals()))
 
diff --git a/IPython/html/notebookapp.py b/IPython/html/notebookapp.py
--- a/IPython/html/notebookapp.py
+++ b/IPython/html/notebookapp.py
@@ -177,7 +177,6 @@ def init_settings(self, ipython_app, kernel_manager, notebook_manager,
             nbextensions_path = ipython_app.nbextensions_path,
             mathjax_url=ipython_app.mathjax_url,
             config=ipython_app.config,
-            use_less=ipython_app.use_less,
             jinja2_env=Environment(loader=FileSystemLoader(template_path)),
         )
 
@@ -367,18 +366,6 @@ def _cookie_secret_default(self):
                       BROWSER environment variable to override it.
                       """)
     
-    use_less = Bool(False, config=True,
-                       help="""Wether to use Browser Side less-css parsing
-                       instead of compiled css version in templates that allows
-                       it. This is mainly convenient when working on the less
-                       file to avoid a build step, or if user want to overwrite
-                       some of the less variables without having to recompile
-                       everything.
-                       
-                       You will need to install the less.js component in the static directory
-                       either in the source tree or in your profile folder.
-                       """)
-
     webapp_settings = Dict(config=True,
             help="Supply overrides for the tornado.web.Application that the "
                  "IPython notebook uses.")


Test patch:
diff --git a/IPython/html/tests/casperjs/test_cases/render_markdown.js b/IPython/html/tests/casperjs/test_cases/render_markdown.js
--- a/IPython/html/tests/casperjs/test_cases/render_markdown.js
+++ b/IPython/html/tests/casperjs/test_cases/render_markdown.js
@@ -10,7 +10,7 @@ casper.notebook_test(function () {
         cell.render();
         return cell.get_rendered();
     });
-    this.test.assertEquals(output, '<h1>Foo</h1>', 'Markdown JS API works.');
+    this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown JS API works.');
     
     // Test menubar entries.
     output = this.evaluate(function () {
@@ -21,7 +21,7 @@ casper.notebook_test(function () {
         $('#run_cell').mouseenter().click();
         return cell.get_rendered();
     });
-    this.test.assertEquals(output, '<h1>Foo</h1>', 'Markdown menubar items work.');
+    this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown menubar items work.');
     
     // Test toolbar buttons.
     output = this.evaluate(function () {
@@ -32,5 +32,5 @@ casper.notebook_test(function () {
         $('#run_b').click();
         return cell.get_rendered();
     });
-    this.test.assertEquals(output, '<h1>Foo</h1>', 'Markdown toolbar items work.');
+    this.test.assertEquals(output, '<h1 id=\"foo\">Foo</h1>', 'Markdown toolbar items work.');
 });