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

Ximin Luo infinity0 at debian.org
Sat Feb 10 10:20:00 UTC 2018


Nicholas D Steeves:
> Hi!
> 
> On Sun, Dec 04, 2016 at 11:51:38AM +0300, Dmitry Shachnev wrote:
>> 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
> 
> Any progress on this patch?  I'd like to use this method to solve bug
> #829361
> 

Hi, I forgot about this in the meantime. I don't have time to work on the patch right now, so anyone can feel free to take it over. I guess Dmitry is happy to apply it no matter who writes it, as long as it's good.

X

-- 
GPG: ed25519/56034877E1F87C35
GPG: rsa4096/1318EFAC5FBBDBCE
https://github.com/infinity0/pubkeys.git



More information about the Python-modules-team mailing list