Change request #1052

GammaLib local sphinx docs sometimes load slowly because they fetch Google fonts and Mathjax online

Added by Deil Christoph over 10 years ago. Updated almost 10 years ago.

Status:NewStart date:01/04/2014
Priority:LowDue date:01/31/2014
Assigned To:Deil Christoph% Done:

0%

Category:-
Target version:-
Duration: 28

Description

I’m currently on a sluggish internet connection and noticed that sometimes loading a local GammaLib Sphinx docs page takes a few seconds.

The reason is that Google fonts and Mathjax files are loaded from the internet (see attached screenshot).

This should be changed so that either all required files are bundled in the GammaLib repo or there is an option to fetch them once e.g. when ``make sphinx`` executes,
so that browsing the local docs doesn’t hit the network.

Screen Shot 2014-01-04 at 12.27.01.png (931 KB) Deil Christoph, 01/04/2014 12:35 PM

Screen%20shot%202014-01-04%20at%2012.27.01

Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 10 years ago

Any clues how to package the needed things in GammaLib?

#2 Updated by Deil Christoph over 10 years ago

  • Due date set to 01/31/2014
  • Assigned To set to Deil Christoph
  • Target version set to 2nd coding sprint

No clue. I’ll have to investigate.

#3 Updated by Knödlseder Jürgen over 10 years ago

  • Tracker changed from Bug to Change request

#4 Updated by Deil Christoph over 10 years ago

In principle using a local copy of Mathjax with Sphinx and Doxygen is easy: In detail I'm not sure how best to implement this:
  • How should the download be done? Add a separate make download-mathjax target? Use curl or wget or Python to do the download?
  • When should the download be done? Automatically with make doc because fast local docs is what most developers want?
  • For the online docs and users that don’t want to download Mathjax, the Sphinx and Doxygen docs still need to point to the Mathjax version on the web, so the use of local Mathjax needs to be optional somehow.

IPython has a script to download Mathjax that we could maybe adapt if you want to use Python for the download:
http://ipython.org/ipython-doc/stable/install/install.html#mathjax
https://github.com/ipython/ipython/blob/master/IPython/external/mathjax.py

Shark adds some JavaScript lines in the Sphinx and Doxygen header to optionally load the local or online version of Mathjax:
http://image.diku.dk/shark/sphinx_pages/build/html/rest_sources/tutorials/for_developers/managing_the_documentation.html#mathjax
https://github.com/chrisvana/shark_copy/blob/master/doc/doxygen_pages/templates/header.html
https://github.com/chrisvana/shark_copy/blob/master/doc/sphinx_pages/templates/layout.html#L6

I think this is a nice solution, although I think the default should be to use a local version if available so that it’s fast and no web request is made if the local version is available.

I won’t have time to implement and test this before the coding sprint, if someone else wants to do it, please go ahead.

#5 Updated by Knödlseder Jürgen over 10 years ago

The only problem I see with the download during making is that you’ll miss the download in case that the machine is not connected to internet during installation. So ideally, the stuff should be shipped with GammaLib.

We may not do this for developers (they could use indeed a specific target to download the fonts), but when building the release packages we should just add the fonts to the package before building the tarball.

On the other hand, I see that MathJax-2.3 comprises 32.9 MB of data, which I would prefer not having within gammalib (this would make the tarball very large). So we may use the download during make, but eventually alert the user when the download did not work.

#6 Updated by Knödlseder Jürgen almost 10 years ago

  • Target version deleted (2nd coding sprint)

Also available in: Atom PDF