Bug#1060897: Bug #1060897: furo: documentation generated with Debian's furo package doesn't work standalone
Hi, I patched the file src/furo/__init__.py, to enforce the attribute type="module" when the script furo.js is embedded in a web page. Then the syntax import * as Gumshoe from "./gumshoe-patched.js" is accepted. I hope that the release 2023.09.10+dfsg-4 can fix the bug definitely. Best regards, Georges. On Fri, 19 Jan 2024 14:16:31 +0100 Raphael Hertzog wrote: > Control: reopen -1 > > On Fri, 19 Jan 2024, Debian Bug Tracking System wrote: > > furo (2023.09.10+dfsg-3) unstable; urgency=medium > > . > >* included the code from normalize.css into furo.css instead of > > the include directive. Closes: #1060897 > > Thanks for this fix! Unfortunately, this only solves one of the two > problems that I reported in #1060897 (I know that I should have opened two > bugs...). > > The other one was about the javascript in furo.js failing to execute (at > least in Firefox in unstable) with this error message: > > Uncaught SyntaxError: import declarations may only appear at top level of a > module > > As I said in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1060897#10 > that import statement is not present in a regular furo.js as built > by the upstream build system because the file is post-processed and > minified. Ex here: > https://pradyunsg.me/furo/_static/scripts/furo.js > > So I assume we need to post-process the file in some similar way to get it > to work or tweak the way we import the code to allow the import statement > to work but I'm not a big fan of diverting too much from upstream and we > are doing this a lot here (but it's often unavoidable with all packages > relying on the node ecosystem in some way). :-( > > Cheers, > -- > ⢀⣴⠾⠻⢶⣦⠀ Raphaël Hertzog > ⣾⠁⢠⠒⠀⣿⡁ > ⢿⡄⠘⠷⠚⠋The Debian Handbook: https://debian-handbook.info/get/ > ⠈⠳⣄ Debian Long Term Support: https://deb.li/LTS > > -- Georges KHAZNADAR et Jocelyne FOURNIER 22 rue des mouettes, 59240 Dunkerque France. Téléphone +33 (0)3 28 29 17 70 signature.asc Description: PGP signature
Bug#1060897: Bug #1060897: furo: documentation generated with Debian's furo package doesn't work standalone
Control: reopen -1 On Fri, 19 Jan 2024, Debian Bug Tracking System wrote: > furo (2023.09.10+dfsg-3) unstable; urgency=medium > . >* included the code from normalize.css into furo.css instead of > the include directive. Closes: #1060897 Thanks for this fix! Unfortunately, this only solves one of the two problems that I reported in #1060897 (I know that I should have opened two bugs...). The other one was about the javascript in furo.js failing to execute (at least in Firefox in unstable) with this error message: Uncaught SyntaxError: import declarations may only appear at top level of a module As I said in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1060897#10 that import statement is not present in a regular furo.js as built by the upstream build system because the file is post-processed and minified. Ex here: https://pradyunsg.me/furo/_static/scripts/furo.js So I assume we need to post-process the file in some similar way to get it to work or tweak the way we import the code to allow the import statement to work but I'm not a big fan of diverting too much from upstream and we are doing this a lot here (but it's often unavoidable with all packages relying on the node ecosystem in some way). :-( Cheers, -- ⢀⣴⠾⠻⢶⣦⠀ Raphaël Hertzog ⣾⠁⢠⠒⠀⣿⡁ ⢿⡄⠘⠷⠚⠋The Debian Handbook: https://debian-handbook.info/get/ ⠈⠳⣄ Debian Long Term Support: https://deb.li/LTS
Bug#1060897: furo: documentation generated with Debian's furo package doesn't work standalone
On Tue, 16 Jan 2024, Raphaël Hertzog wrote: > - the dark/light theme switcher is hidden because I have a ".no-js" class > that is not removed by _static/scripts/furo.js because that script fails > on the first import line (Uncaught SyntaxError: import declarations may > only appear at top level of a module). This line has been patched > by the Debian packaging, but I'm not sure if the change is the source of > the problem. FWIW the official version post-process the javascript file and there's no visible import in the file there. So the issue seems to be that we are copying javascript files without any post-processing. Cheers, -- ⢀⣴⠾⠻⢶⣦⠀ Raphaël Hertzog ⣾⠁⢠⠒⠀⣿⡁ ⢿⡄⠘⠷⠚⠋The Debian Handbook: https://debian-handbook.info/get/ ⠈⠳⣄ Debian Long Term Support: https://deb.li/LTS
Bug#1060897: furo: documentation generated with Debian's furo package doesn't work standalone
Package: furo Version: 2023.09.10+dfsg-2 Severity: important X-Debbugs-Cc: raph...@freexian.com Hello Georges, I was trying to use "furo" (as packaged in Debian) to build the debusine documentation but I figured out that multiple things were not working right: https://hertzog.pages.debian.net/-/debusine/-/jobs/5153568/artifacts/docs/_build/html/index.html - I have unwanted margins around the page, that's because "normalize.css" is not found, the Debian package hardcodes "/javascript/normalize.css/normalize.css" as the path... it's totally unreasonable to make that assumption for random documentation. It's great to reuse the Debian packaged version, but it should be reused in a way where it gets duplicated in the generated documentation so that the documentation is self-contained. - the dark/light theme switcher is hidden because I have a ".no-js" class that is not removed by _static/scripts/furo.js because that script fails on the first import line (Uncaught SyntaxError: import declarations may only appear at top level of a module). This line has been patched by the Debian packaging, but I'm not sure if the change is the source of the problem. Cheers, -- System Information: Debian Release: trixie/sid APT prefers unstable APT policy: (500, 'unstable') Architecture: amd64 (x86_64) Kernel: Linux 6.6.8-amd64 (SMP w/16 CPU threads; PREEMPT) Kernel taint flags: TAINT_WARN Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), LANGUAGE not set Shell: /bin/sh linked to /usr/bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages furo depends on: ii node-normalize.css 8.0.1-5 ii python3 3.11.6-1 ii python3-bs4 4.12.2-2 ii python3-pygments2.15.1+dfsg-1 ii python3-sphinx 7.2.6-3 ii sphinx-basic-ng 1.0.0~beta2-1 furo recommends no packages. furo suggests no packages. -- no debconf information