From 08cbe7f770db162fee22c5eede72758aa6af340b Mon Sep 17 00:00:00 2001 From: Volker Braun Date: Fri, 15 Jan 2016 01:37:11 +0100 Subject: [PATCH] Use require.toUrl for help_links The kernel doesn't know about the base_url of the notebook, so he cannot generate local urls. This is important if you want to serve documentation locally, for example see http://trac.sagemath.org/ticket/19885 Require.toUrl rewrites non-relative paths according to the path configuration. For example, a help_link defined like { 'text': 'Sage Documentation', 'url': 'kernelspecs/foo/bar.html', }, is then correctly transformed to /base_url/kernelspecs/foo/bar.html --- notebook/static/notebook/js/menubar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notebook/static/notebook/js/menubar.js b/notebook/static/notebook/js/menubar.js index 6ae6fc785..ae4a432af 100644 --- a/notebook/static/notebook/js/menubar.js +++ b/notebook/static/notebook/js/menubar.js @@ -402,7 +402,7 @@ define([ .append($("") .attr('target', '_blank') .attr('title', 'Opens in a new window') - .attr('href', link.url) + .attr('href', require.toUrl(link.url)) .append($("") .addClass("fa fa-external-link menu-icon pull-right") )