Justace,
I apologize I was traveling out of the country yesterday I missed that this was about the built docs. We currently have a sphinx plugin that generates the plots, and it actually uses monkey patching to override the user-specified resources to always use CDN (because otherwise inline resources with alot of plots makes pages impossibly large). So the short answer is that there is no easy way to do that. Here are the places that the overriding happens:
[https://github.com/bokeh/bokeh/blob/master/bokeh/sphinxext/bokeh_plot.py#L285](https://github.com/bokeh/bokeh/blob/master/bokeh/sphinxext/bokeh_plot.py#L285)
[https://github.com/bokeh/bokeh/blob/master/bokeh/sphinxext/bokeh_plot.py#L301](https://github.com/bokeh/bokeh/blob/master/bokeh/sphinxext/bokeh_plot.py#L301)
As a short term fix you can edit that file to use whatever resources you want (probably relative). It would be great to make this a configurable option to the bokeh-plot Sphinx directive. It’s not something I will be able to look at while I am traveling, but if you’d care to work on a PR that does that it would be very welcome.
Thanks,
Bryan
On Oct 20, 2015, at 5:18 AM, Justace Clutter justacec@gmail.com wrote:
I am still trying to figure out how to build the documentation locally such that it uses my locally built js library…
In that effort I was setting the environment variable BOKEH_RESOURCES to various modes of ‘inline’, ‘relative’, and ‘relative-div’ in addition to the environment variable BOKEH_ROOTDIR. Even though I had the BOKEH_RESOURCES set to ‘relative-dev’, I received an error from the console telling me that the setting of the root directory only makes sense if the resources mode is set to either ‘relative’ or ‘relative-dev’. In this case I had and the error was not making sense. I took a look at the Resources class and noticed that the error logic was using the function parameter vice the instance variable to do its logic. This does not seem correct. I have placed a smipplet of the relevant code below.
///// BEGIN SNIP (https://github.com/bokeh/bokeh/blob/master/bokeh/resources.py, line 110)
raise ValueError("wrong value for ‘mode’ parameter, expected ", “‘inline’, ‘cdn’, ‘server(-dev)’, ‘relative(-dev)’ or ‘absolute(-dev)’, got %r” % self.mode)
if self.root_dir and not mode.startswith(“relative”):
raise ValueError("setting 'root_dir' makes sense only when 'mode' is set to 'relative'")
if self.version and not mode.startswith(‘cdn’):
raise ValueError("setting 'version' makes sense only when 'mode' is set to 'cdn'")
if root_url and not mode.startswith(‘server’):
raise ValueError("setting 'root_url' makes sense only when 'mode' is set to 'server'")
////// END SNIP
Should all of the cases of ‘mode’ in the above be replaced with ‘self.mode’? I would have made this an issue right away but I wanted to make sure there was no black magic at play here. If there is in fact an issue here, I will create an issue and then make a small pull request.
Also, as an aside, if anybody here can tell me how to build the docs using a the local version of the js library I would be very grateful. Setting the env var BOKEH_RESOURCES to ‘inline’ does not seem to do the trick.
Justace
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/6701b9b8-0420-41d3-8bd7-bbe009866a8d%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
–
You received this message because you are subscribed to the Google Groups “Bokeh Discussion - Public” group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.