Opened 4 years ago

Closed 17 months ago

#14950 closed Bug (duplicate)

Javascript errors when building CHM file from django docs using Sphinx

Reported by: Aryeh Leib Taurog <vim@…> Owned by: nobody
Component: Documentation Version: 1.2
Severity: Normal Keywords: chm javascript
Cc: vim@… Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Sphinx 1.0.3
Python 2.5.2
Django 1.2.3 and 1.2.4

I tried generating a chm of the django documentation, but when I opened it, I got a js error 'jQuery' is undefined.
I can see that the only script referenced in the html is templatebuiltins.js, (it seems that is generated by a django extension which isn't used for htmlhelp).

I tried changing the link in the html files to point to a js bundle with the contents of the following files (in order):

_static/jquery.js
_static/underscore.js
_static/doctools.js
_static/searchtools.js

I also threw in a declaration of django_template_builtins, but I'm still getting other errors. My guess is that most of the javascript isn't really necessary in the chm, which is very easy to navigate and search as is.

Ultimately, I just removed all the script tags from the html files and recompiled the chm.

I think it would be nice to be able to generate an error-free chm without so much effort.

Change History (8)

comment:1 Changed 4 years ago by Aryeh Leib Taurog <vim@…>

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

Looks like it is just a question of pointing the htmlhelp builder to a version of the layout.html template which doesn't contain the script tags.

Is there an easy way to specify different templates for different builders?

comment:2 Changed 4 years ago by gabrielhurley

  • Summary changed from Javascript errors in django docs chm to Javascript errors when building CHM file from django docs using Sphinx
  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 4 years ago by Aryeh Leib Taurog <vim@…>

  • Cc vim@… added

comment:4 Changed 4 years ago by anonymous

  • Severity set to Normal
  • Type set to Bug

comment:5 Changed 3 years ago by aaugustin

  • UI/UX unset

Change UI/UX from NULL to False.

comment:6 Changed 3 years ago by aaugustin

  • Easy pickings unset

Change Easy pickings from NULL to False.

comment:7 Changed 17 months ago by mpasternak

Hi,

I know, 3 years are a long time.

Anyways, here's a patch, that makes CHM compilation readily available out of box https://github.com/mpasternak/django/commit/1336d8f8599f8d0571893c0bbd03f52f66eb36ef ,
and here's an issue I created for it https://code.djangoproject.com/ticket/21558

With kind regards,
Michal

comment:8 Changed 17 months ago by ramiro

  • Resolution set to duplicate
  • Status changed from new to closed

I'm going to close this as duplicate of #21558 that, even if newer, has a patch and renewed energies.

Note: See TracTickets for help on using tickets.
Back to Top