New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: Exclude documentation_options.js from default theme #61044
Conversation
`documentation_options.js` from the default theme sets the option `URL_ROOT` to: ``` document.getElementById("documentation_options").getAttribute('data-url_root') ``` This requires that the script element for `documentation_options.js` includes the tag `id="documentation_options"` and sets the `data-url_root` tag. Otherwise evaluating `URL_ROOT` will fail and building the documentation during the Debian package build will fail: ``` dh_sphinxdoc: error: DOCUMENTATION_OPTIONS does not define URL_ROOT ``` The variable `DOCUMENTATION_OPTIONS` is directly set `layout.html` and therefore `documentation_options.js` does not need to be included. So just exclude it. Forwarded: saltstack#61044 Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
`documentation_options.js` from the default theme sets the option `URL_ROOT` to: ``` document.getElementById("documentation_options").getAttribute('data-url_root') ``` This requires that the script element for `documentation_options.js` includes the tag `id="documentation_options"` and sets the `data-url_root` tag. Otherwise evaluating `URL_ROOT` will fail and building the documentation during the Debian package build will fail: ``` dh_sphinxdoc: error: DOCUMENTATION_OPTIONS does not define URL_ROOT ``` The variable `DOCUMENTATION_OPTIONS` is directly set `layout.html` and therefore `documentation_options.js` does not need to be included. So just exclude it. Forwarded: saltstack#61044 Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
c7b7aea
to
0f6fd63
Compare
0f6fd63
to
029f6ec
Compare
029f6ec
to
e754f64
Compare
Rebased on master. |
812755f
to
2764359
Compare
795d70c
to
2d5e050
Compare
Rebased on master. Let's see if all tests passes or if unrelated test cases fail. |
`documentation_options.js` from the default theme sets the option `URL_ROOT` to: ``` document.getElementById("documentation_options").getAttribute('data-url_root') ``` This requires that the script element for `documentation_options.js` includes the tag `id="documentation_options"` and sets the `data-url_root` tag. Otherwise evaluating `URL_ROOT` will fail and building the documentation during the Debian package build will fail: ``` dh_sphinxdoc: error: DOCUMENTATION_OPTIONS does not define URL_ROOT ``` The variable `DOCUMENTATION_OPTIONS` is directly set `layout.html` and therefore `documentation_options.js` does not need to be included. So just exclude it. Forwarded: saltstack#61044 Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com> Gbp-Pq: Name doc-Exclude-documentation_options.js-from-default-th.patch
`documentation_options.js` from the default theme sets the option `URL_ROOT` to: ``` document.getElementById("documentation_options").getAttribute('data-url_root') ``` This requires that the script element for `documentation_options.js` includes the tag `id="documentation_options"` and sets the `data-url_root` tag. Otherwise evaluating `URL_ROOT` will fail and building the documentation during the Debian package build will fail: ``` dh_sphinxdoc: error: DOCUMENTATION_OPTIONS does not define URL_ROOT ``` The variable `DOCUMENTATION_OPTIONS` is directly set `layout.html` and therefore `documentation_options.js` does not need to be included. So just exclude it. Forwarded: saltstack#61044 Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com> Gbp-Pq: Name doc-Exclude-documentation_options.js-from-default-th.patch
`documentation_options.js` from the default theme sets the option `URL_ROOT` to: ``` document.getElementById("documentation_options").getAttribute('data-url_root') ``` This requires that the script element for `documentation_options.js` includes the tag `id="documentation_options"` and sets the `data-url_root` tag. Otherwise evaluating `URL_ROOT` will fail and building the documentation during the Debian package build will fail: ``` dh_sphinxdoc: error: DOCUMENTATION_OPTIONS does not define URL_ROOT ``` The variable `DOCUMENTATION_OPTIONS` is directly set `layout.html` and therefore `documentation_options.js` does not need to be included. So just exclude it. Forwarded: saltstack#61044 Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com> Gbp-Pq: Name doc-Exclude-documentation_options.js-from-default-th.patch
@barbaricyawps can you review here please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommend closing this PR as the fix appears to have been merged in by someone else, possibly later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bdrung , I'm afraid I don't understand enough about javascript to understand why this PR is necessary and your description doesn't seem to help me. One thing that I'm confused about is why you're adding a reference to a file named _static/documentation_options.js
when this file doesn't exist in the root folder being referenced.
What does setting the js_blacklist do?
`documentation_options.js` from the default theme sets the option `URL_ROOT` to: ``` document.getElementById("documentation_options").getAttribute('data-url_root') ``` This requires that the script element for `documentation_options.js` includes the tag `id="documentation_options"` and sets the `data-url_root` tag. Otherwise evaluating `URL_ROOT` will fail and building the documentation during the Debian package build will fail: ``` dh_sphinxdoc: error: DOCUMENTATION_OPTIONS does not define URL_ROOT ``` The variable `DOCUMENTATION_OPTIONS` is directly set `layout.html` and therefore `documentation_options.js` does not need to be included. So just exclude it. Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com>
f0c8490
to
e2ee56f
Compare
js_blacklist is used in layout.html: {% if scriptfile not in js_blacklist %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
{% endif %}
<script>
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ url_root }}',
VERSION: '{{ release|e }}',
LANGUAGE: '{{ language }}',
COLLAPSE_INDEX: false,
BUILDER: '{{ builder }}',
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
LINK_SUFFIX: '{{ link_suffix }}',
HAS_SOURCE: {{ has_source|lower }},
SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}',
NAVIGATION_WITH_KEYS: {{ 'true' if theme_navigation_with_keys|tobool else 'false'}}
};
</script> |
@bdrung Would you be able to provide an example of this causing the failure you described? Logs, screenshots, whatever works. |
`documentation_options.js` from the default theme sets the option `URL_ROOT` to: ``` document.getElementById("documentation_options").getAttribute('data-url_root') ``` This requires that the script element for `documentation_options.js` includes the tag `id="documentation_options"` and sets the `data-url_root` tag. Otherwise evaluating `URL_ROOT` will fail and building the documentation during the Debian package build will fail: ``` dh_sphinxdoc: error: DOCUMENTATION_OPTIONS does not define URL_ROOT ``` The variable `DOCUMENTATION_OPTIONS` is directly set `layout.html` and therefore `documentation_options.js` does not need to be included. So just exclude it. Forwarded: saltstack#61044 Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com> Gbp-Pq: Name doc-Exclude-documentation_options.js-from-default-th.patch
documentation_options.js
from the default theme sets the optionURL_ROOT
to:This requires that the script element for
documentation_options.js
includes the tagid="documentation_options"
and sets thedata-url_root
tag. Otherwise evaluatingURL_ROOT
will fail and building the documentation during the Debian package build will fail:The variable
DOCUMENTATION_OPTIONS
is directly setlayout.html
and thereforedocumentation_options.js
does not need to be included. So just exclude it.