Skip to content
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

Switch to the latest sphinx #6177

Closed
wRAR opened this issue Dec 12, 2023 · 9 comments
Closed

Switch to the latest sphinx #6177

wRAR opened this issue Dec 12, 2023 · 9 comments

Comments

@wRAR
Copy link
Member

wRAR commented Dec 12, 2023

The docs fail to build with the current Sphinx (7.2.6):

reading sources... [ 48%] topics/downloader-middleware
Extension error (scrapydocs):
Handler <function collect_scrapy_settings_refs at 0x7f81fc663a60> for event 'doctree-read' threw an exception (exception: Next node is not a target)

So we should update deps in docs/requirements.txt, fix this (and maybe others) problem and make sure the docs are built correctly.

@wRAR
Copy link
Member Author

wRAR commented Dec 13, 2023

The exception is caused by some change in Sphinx 7.2.0 that leads to a different order of nodes when there are two .. setting directives in a row (index,target,index,target in older versions but index,index,target,target in newer ones) which breaks our code. No idea yet why this happens and if it's expected.

@wRAR
Copy link
Member Author

wRAR commented Dec 13, 2023

Bisected to sphinx-doc/sphinx#10478

@wRAR
Copy link
Member Author

wRAR commented Dec 13, 2023

sphinx-doc/sphinx#11797

@wRAR
Copy link
Member Author

wRAR commented Dec 24, 2023

Per the comment in the upstream issue we need to change the logic in get_setting_target() and it should be relatively easy to do that.

As an aside, I'm not sure if the HTML that is currently generated for multiple setting directives in a row is correct, see e.g. https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#httpproxymiddleware-settings and where are the #std-setting-HTTPPROXY_ENABLED and #std-setting-HTTPPROXY_AUTH_ENCODING elements.

@Gallaecio
Copy link
Member

As an aside, I'm not sure if the HTML that is currently generated for multiple setting directives in a row is correct, see e.g. https://docs.scrapy.org/en/latest/topics/downloader-middleware.html#httpproxymiddleware-settings and where are the #std-setting-HTTPPROXY_ENABLED and #std-setting-HTTPPROXY_AUTH_ENCODING elements.

As far as I know, <span id="…"></span> is a valid approach to set an anchor anywhere on an HTML document.

@wRAR
Copy link
Member Author

wRAR commented Dec 26, 2023

@Gallaecio I mean those two elements even have different depth, and #std-setting-HTTPPROXY_AUTH_ENCODING is inside #httpproxy-enabled, so this HTML looks like something that works approximately (because the links are near the place we want) but is not strictly what we want.

@Rotzbua
Copy link
Contributor

Rotzbua commented Jan 5, 2024

@wRAR With Sphinx v7 a lot is being reworked. This leads to many side effects. I would advise you to migrate to the latest v6.

@wRAR
Copy link
Member Author

wRAR commented Jan 5, 2024

@Rotzbua do you suggest migrating to 7.x later?

@Gallaecio
Copy link
Member

Fixed by #6200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants