[Python-modules-team] Bug#901662: sphinx: RTD theme users FTBFS with dh_sphinxdoc: DOCUMENTATION_OPTIONS does not define URL_ROOT

Dmitry Shachnev mitya57 at debian.org
Sat Jun 16 20:13:21 BST 2018


Hi Rebecca!

On Sat, Jun 16, 2018 at 01:10:22PM +0100, Rebecca N. Palmer wrote:
> sphinx's included themes have layout.html reference a separate file
> documentation_options.js (for compatibility with strict CSS policies
> [0]).  However, sphinx-rtd-theme (and possibly other 3rd party themes -
> I haven't checked) still uses the old method of defining
> DOCUMENTATION_OPTIONS as inline JavaScript within the layout.html file
> [1].  In documentation using this theme, documentation_options.js exists
> (presumably from sphinx's default template) but isn't actually used.
> [...]
>
> Possible (but very minimally tested) fix:
>
> --- a/debian/dh-sphinxdoc/dh_sphinxdoc
> +++ b/debian/dh-sphinxdoc/dh_sphinxdoc
> @@ -252,7 +252,7 @@ sub sanity_check($$)
>      grep { s/[?#].*//; $js{$_} = 1 unless m/^[a-z][a-z0-9.+-]*:/i or excludefile("$path/$_"); } $search =~ m{<script type="text/javascript" src="([^"]++)"></script>}g;
>      my $documentation_options;
>      my $documentation_options_fn = "$path/_static/documentation_options.js";
> -    if (-f $documentation_options_fn)
> +    if ($search =~ $documentation_options_fn)
>      {
>          open(my $fh, '<', $documentation_options_fn) or error("cannot open $documentation_options_fn");
>          $documentation_options = <$fh>;
> 

Thanks for your bug report and for the patch.

I slightly modified it, because search.html will reference the JS file by
a relative path (_static/documentation_options.js), without the $path/ part.

Otherwise your idea was correct. I am doing a new upload now.

--
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://alioth-lists.debian.net/pipermail/python-modules-team/attachments/20180616/d1f06239/attachment-0001.sig>


More information about the Python-modules-team mailing list