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

Attachment: signature.asc
Description: PGP signature

Reply via email to