[Python-modules-team] Bug#739300: dh_sphinxdoc: Please replace MathJax.js with links to the packaged libjs-mathjax

Dmitry Shachnev mitya57 at debian.org
Sun Dec 4 08:51:38 UTC 2016


Hi Ximin!

On Sat, Dec 03, 2016 at 01:49:00AM +0000, Ximin Luo wrote:
> Could dh_sphinxdoc not scan the html files for <script src="$that_value"...
> and replace it with a link to Debian's MathJax instead? It already does some
> pretty sophisticated regex-based sanity checks (e.g. relating to #841141
> which I filed recently) - so adding a replacement rule shouldn't be too hard
> right?
>
> I can try to write this patch too, when I have some time.

Actually, I just haven’t thought about the idea of replacing that by regex.
This seemed less sane to me than modifying conf files.

However, as you volunteered to write a patch, I will accept it. Ideally that
regex should be smart enough to replace only actually included JS files
in the HTML head, i.e. it should not touch the examples of using MathJax in
MathJax’ own documentation. I don’t know whether that is easy to implement,
though.

> BTW can someone point me to some discussion/documentation on precisely
> how/why symlinks to directories mess with dpkg? I was not aware of this -
> I have added quite a lot of directory-symlinks to some of my recent JS
> packages, and we will likely have to do this for ipywidgets, with mathjax...

See [1]. You can use dpkg-maintscript-helper’s “symlink_to_dir” command to
deal with that in your packages.

Note that for MathJax you should not create any symlinks, just specify the
path to packaged MathJax in your conf.py, as described in [2].

[1]: https://wiki.debian.org/Teams/Dpkg/FAQ#Q:_Will_dpkg_replace_a_symlink_with_a_directory_or_vice_versa.3F
[2]: http://www.sphinx-doc.org/en/stable/ext/math.html#confval-mathjax_path

--
Dmitry Shachnev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/python-modules-team/attachments/20161204/9d6bc22d/attachment.sig>


More information about the Python-modules-team mailing list