Bug#989649: libjs-mathjax: integrate with dh_sphinxdoc
OK, update on this... On Sun, Nov 21, 2021 at 12:24:15PM +, Julian Gilbey wrote: > On Mon, Oct 04, 2021 at 12:26:35PM +0200, Drew Parsons wrote: > > Source: mathjax > > Followup-For: Bug #989649 > > > > It's not always so simple as adding the conf.py patch. > > > > For the example of fenics-dolfinx 0.3.0-3 (in experimental), the > > lintian privacy-breach-generic warning complains about > > > > https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js > > > > But there is no local tex-mml-chtml.js file to replace it with. > > That shouldn't be a problem; have a look at > /usr/lib/python3/dist-packages/sphinx/ext/mathjax.py > This is where the tex-mml-chtml.js file is referred to, but that is > overridden by the mathjax_path config file variable. So all you have to do is add: mathjax_path = 'file:///usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML' to docs/conf.py > Unfortunately, though, this completely fails to work with Firefox: > [...] The rest of this turns out to be a bug in version 94.0-1 of Debian Firefox (at least on my machine). Upgrading to 94.0-2 fixed the issue, and the Sphinx-generated documentation (with the mathjax_path patch) now works fine. Best wishes, Julian
Bug#989649: libjs-mathjax: integrate with dh_sphinxdoc
On Mon, Oct 04, 2021 at 12:26:35PM +0200, Drew Parsons wrote: > Source: mathjax > Followup-For: Bug #989649 > > It's not always so simple as adding the conf.py patch. > > For the example of fenics-dolfinx 0.3.0-3 (in experimental), the > lintian privacy-breach-generic warning complains about > > https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js > > But there is no local tex-mml-chtml.js file to replace it with. That shouldn't be a problem; have a look at /usr/lib/python3/dist-packages/sphinx/ext/mathjax.py This is where the tex-mml-chtml.js file is referred to, but that is overridden by the mathjax_path config file variable. Unfortunately, though, this completely fails to work with Firefox: http://docs.mathjax.org/en/v2.7-latest/installation.html#firefox-and-local-fonts MathJax.js tries to load "file:///extensions/MathMenu.js?V=2.7.9" and similar, and I cannot fathom how to set things up so that the [MathJax] path becomes "/usr/share/javascript/mathjax" rather than "". I also tried putting a symlink to /usr/share/javascript/mathjax in the documentation directory and setting mathjax_path to there, but that fails in the same way. Any suggestions would be most welcome! I might post a query to the Debian MathJax maintainers to see if they have any idea. Best wishes, Julian
Bug#989649: libjs-mathjax: integrate with dh_sphinxdoc
On Sun, Nov 21, 2021 at 12:24:15PM +, Julian Gilbey wrote: > I might post a query to the Debian MathJax maintainers to see if they > have any idea. Oh, this is a bug report against libjs-mathjax already ;-) Best wishes, Julian
Bug#989649: libjs-mathjax: integrate with dh_sphinxdoc
Source: mathjax Followup-For: Bug #989649 It's not always so simple as adding the conf.py patch. For the example of fenics-dolfinx 0.3.0-3 (in experimental), the lintian privacy-breach-generic warning complains about https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js But there is no local tex-mml-chtml.js file to replace it with.
Bug#989649: libjs-mathjax: integrate with dh_sphinxdoc
Dear Dmitry, what looked strange to me is that previously I was able to build my packages (pyresample in particular) without problems. Now I get warnings about privacy breach so I had the impression that something is moving in the wrong direction. By the way adding small patch a patch to conf.py is not a problem for me, so no problem. kind regards antonio On Sat, 25 Sep 2021 21:53:27 +0300 Dmitry Shachnev wrote: Hi Drew, Antonio and all! On Wed, Jun 09, 2021 at 03:13:47PM +0200, Drew Parsons wrote: > Package: libjs-mathjax > Version: 2.7.9+dfsg-1 > Severity: normal > > dh_sphinxdoc provides aids for automatically updating references to > .js scripts used in docs generated through sphinx. In particular it > helps maintain privacy policies by removing the need to reference > external websites such as > https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js > from documentation. > > At the moment mathjax is not integrating into the dh_sphinxdoc > capabilities. This means privacy hacks need to be made manually for > every package that uses math formatting in its rst or md docs. > > Can mathjax be introduced to the dh_sphinxdoc system? My recommendation is to add this line to your conf.py (using a patch): mathjax_path = 'file:///usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML' This is better than letting Sphinx generate URLs to some CDN and then replacing them in dh_sphinxdoc. Any code to do automatic replacement is error-prone, may not always detect the tags correctly, and may break when something in Sphinx changes. With this approach you will have correct URLs in tags from the very beginning. -- Dmitry Shachnev -- Antonio Valentino
Bug#989649: libjs-mathjax: integrate with dh_sphinxdoc
Hi Drew, Antonio and all! On Wed, Jun 09, 2021 at 03:13:47PM +0200, Drew Parsons wrote: > Package: libjs-mathjax > Version: 2.7.9+dfsg-1 > Severity: normal > > dh_sphinxdoc provides aids for automatically updating references to > .js scripts used in docs generated through sphinx. In particular it > helps maintain privacy policies by removing the need to reference > external websites such as > https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js > from documentation. > > At the moment mathjax is not integrating into the dh_sphinxdoc > capabilities. This means privacy hacks need to be made manually for > every package that uses math formatting in its rst or md docs. > > Can mathjax be introduced to the dh_sphinxdoc system? My recommendation is to add this line to your conf.py (using a patch): mathjax_path = 'file:///usr/share/javascript/mathjax/MathJax.js?config=TeX-AMS-MML_HTMLorMML' This is better than letting Sphinx generate URLs to some CDN and then replacing them in dh_sphinxdoc. Any code to do automatic replacement is error-prone, may not always detect the tags correctly, and may break when something in Sphinx changes. With this approach you will have correct URLs in tags from the very beginning. -- Dmitry Shachnev signature.asc Description: PGP signature
Bug#989649: libjs-mathjax: integrate with dh_sphinxdoc
Hi, there is any news on this? Also pyresample is impacted by this issue. kind regards antonio On Wed, 09 Jun 2021 15:13:47 +0200 Drew Parsons wrote: Package: libjs-mathjax Version: 2.7.9+dfsg-1 Severity: normal dh_sphinxdoc provides aids for automatically updating references to .js scripts used in docs generated through sphinx. In particular it helps maintain privacy policies by removing the need to reference external websites such as https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js from documentation. At the moment mathjax is not integrating into the dh_sphinxdoc capabilities. This means privacy hacks need to be made manually for every package that uses math formatting in its rst or md docs. Can mathjax be introduced to the dh_sphinxdoc system? -- System Information: Debian Release: 11.0 APT prefers testing-security APT policy: (500, 'testing-security'), (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 5.10.0-7-amd64 (SMP w/8 CPU threads) Kernel taint flags: TAINT_OOT_MODULE Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE=en_AU:en Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages libjs-mathjax depends on: ii fonts-mathjax 2.7.9+dfsg-1 libjs-mathjax recommends no packages. Versions of packages libjs-mathjax suggests: pn fonts-mathjax-extras ii fonts-stix1.1.1-4.1 pn libjs-mathjax-doc -- no debconf information -- Antonio Valentino
Bug#989649: libjs-mathjax: integrate with dh_sphinxdoc
Package: libjs-mathjax Version: 2.7.9+dfsg-1 Severity: normal dh_sphinxdoc provides aids for automatically updating references to .js scripts used in docs generated through sphinx. In particular it helps maintain privacy policies by removing the need to reference external websites such as https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/MathJax.js from documentation. At the moment mathjax is not integrating into the dh_sphinxdoc capabilities. This means privacy hacks need to be made manually for every package that uses math formatting in its rst or md docs. Can mathjax be introduced to the dh_sphinxdoc system? -- System Information: Debian Release: 11.0 APT prefers testing-security APT policy: (500, 'testing-security'), (500, 'unstable'), (1, 'experimental') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 5.10.0-7-amd64 (SMP w/8 CPU threads) Kernel taint flags: TAINT_OOT_MODULE Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), LANGUAGE=en_AU:en Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages libjs-mathjax depends on: ii fonts-mathjax 2.7.9+dfsg-1 libjs-mathjax recommends no packages. Versions of packages libjs-mathjax suggests: pn fonts-mathjax-extras ii fonts-stix1.1.1-4.1 pn libjs-mathjax-doc -- no debconf information