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

Expire support for root_doc "contents" rewriting #13082

Open
timhoffm opened this issue Oct 29, 2024 · 0 comments
Open

Expire support for root_doc "contents" rewriting #13082

timhoffm opened this issue Oct 29, 2024 · 0 comments
Labels
type:proposal a feature suggestion

Comments

@timhoffm
Copy link
Contributor

Since 2.0, there has been special code to support a root doc "contents", which has not been specified in the config:

sphinx/sphinx/config.py

Lines 769 to 781 in 116a430

def check_root_doc(app: Sphinx, env: BuildEnvironment, added: Set[str],
changed: Set[str], removed: Set[str]) -> Iterable[str]:
"""Adjust root_doc to 'contents' to support an old project which does not have
any root_doc setting.
"""
if (app.config.root_doc == 'index' and
'index' not in app.project.docnames and
'contents' in app.project.docnames):
logger.warning(__('Since v2.0, Sphinx uses "index" as root_doc by default. '
'Please add "root_doc = \'contents\'" to your conf.py.'))
app.config.root_doc = "contents"
return changed

As cleanup / maintanance, I'd like to remove this code. Question: Is the log warning sufficient so that we can immediately remove, or do you want a formal deprecation?

@timhoffm timhoffm added the type:proposal a feature suggestion label Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:proposal a feature suggestion
Projects
None yet
Development

No branches or pull requests

1 participant