From 6d6a71a551eedd26e9a5fac01b438e998bf45c5b Mon Sep 17 00:00:00 2001 From: Yao Xiao <108576690+Charlie-XIAO@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:26:36 +0800 Subject: [PATCH 1/6] remove contents and preface; let index do their job --- doc/conf.py | 4 +++- doc/{contents.rst => index.rst} | 12 ++---------- doc/preface.rst | 32 -------------------------------- 3 files changed, 5 insertions(+), 43 deletions(-) rename doc/{contents.rst => index.rst} (73%) delete mode 100644 doc/preface.rst diff --git a/doc/conf.py b/doc/conf.py index 9992c582e6b68..58a5d333edc32 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -128,7 +128,7 @@ source_encoding = "utf-8" # The main toctree document. -root_doc = "contents" +root_doc = master_doc = "index" # General information about the project. project = "scikit-learn" @@ -373,6 +373,8 @@ # redirects dictionary maps from old links to new links redirects = { "documentation": "index", + "contents": "index", + "preface": "index", "auto_examples/feature_selection/plot_permutation_test_for_classification": ( "auto_examples/model_selection/plot_permutation_tests_for_classification" ), diff --git a/doc/contents.rst b/doc/index.rst similarity index 73% rename from doc/contents.rst rename to doc/index.rst index f37aad8c5547b..ebc491150f75b 100644 --- a/doc/contents.rst +++ b/doc/index.rst @@ -1,17 +1,9 @@ -.. include:: includes/big_toc_css.rst -.. include:: tune_toc.rst - -.. Places global toc into the sidebar - -:globalsidebartoc: True - -================= -Table Of Contents -================= +.. title:: Index .. Define an order for the Table of Contents: .. toctree:: + :hidden: :maxdepth: 2 Install diff --git a/doc/preface.rst b/doc/preface.rst deleted file mode 100644 index 447083a3a8136..0000000000000 --- a/doc/preface.rst +++ /dev/null @@ -1,32 +0,0 @@ -.. This helps define the TOC ordering for "about us" sections. Particularly - useful for PDF output as this section is not linked from elsewhere. - -.. Places global toc into the sidebar - -:globalsidebartoc: True - -.. _preface_menu: - -.. include:: includes/big_toc_css.rst -.. include:: tune_toc.rst - -======================= -Welcome to scikit-learn -======================= - -| - -.. toctree:: - :maxdepth: 2 - - install - faq - support - related_projects - about - testimonials/testimonials - whats_new - roadmap - governance - -| From b0d2aca542b52face2e4b78a0d6a89cb9414b6a7 Mon Sep 17 00:00:00 2001 From: Yao Xiao <108576690+Charlie-XIAO@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:36:56 +0800 Subject: [PATCH 2/6] remove outdated comment --- doc/conf.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 58a5d333edc32..1b4b3a5eda26d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -245,13 +245,6 @@ "pygment_light_style": "tango", "pygment_dark_style": "monokai", "logo": { - # TODO: we should put "link": "index" here, but it is not currently working - # because the navbar-logo component is using hasdoc() to determine if the link - # is an internal link or an external url, while html_additional_pages do not - # seem to pass hasdoc(). See - # https://github.com/pydata/pydata-sphinx-theme/issues/1647 - # If this cannot be fixed we can consider vendoring the navbar-logo component - # and fixing it ourselves. "alt_text": "scikit-learn homepage", "image_relative": "logos/scikit-learn-logo-small.png", "image_light": "logos/scikit-learn-logo-small.png", From 2a9364e7bc1af51d350469de410287a2bc132f34 Mon Sep 17 00:00:00 2001 From: Yao Xiao <108576690+Charlie-XIAO@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:43:20 +0800 Subject: [PATCH 3/6] remove experimental stuff that are unnecessary --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 1b4b3a5eda26d..e61fb876643d0 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -128,7 +128,7 @@ source_encoding = "utf-8" # The main toctree document. -root_doc = master_doc = "index" +root_doc = "index" # General information about the project. project = "scikit-learn" From af6a16ec013f4d0e92032b34163bea099e737595 Mon Sep 17 00:00:00 2001 From: Yao Xiao <108576690+Charlie-XIAO@users.noreply.github.com> Date: Wed, 17 Jan 2024 11:57:09 +0800 Subject: [PATCH 4/6] index no longer needs to be an additional page --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index e61fb876643d0..aef41abd53c2f 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -303,7 +303,7 @@ # Additional templates that should be rendered to pages, maps page names to # template names. -html_additional_pages = {"index": "index.html"} +html_additional_pages = {} # Additional JS files html_js_files = ["scripts/details-permalink.js"] From c1a4e9980ff7ae60e959f6ed4546c727c8345c9c Mon Sep 17 00:00:00 2001 From: Yao Xiao <108576690+Charlie-XIAO@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:02:49 +0800 Subject: [PATCH 5/6] some comments --- doc/index.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/index.rst b/doc/index.rst index ebc491150f75b..afe15ae4f044f 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -1,6 +1,7 @@ .. title:: Index -.. Define an order for the Table of Contents: +.. Define the overall structure, that affects the prev-next buttons and the order + of the sections in the top navbar. .. toctree:: :hidden: From 3cdedf862f1350fbc73bc44cb6068696251d99f5 Mon Sep 17 00:00:00 2001 From: Yao Xiao <108576690+Charlie-XIAO@users.noreply.github.com> Date: Wed, 17 Jan 2024 12:41:06 +0800 Subject: [PATCH 6/6] revert removing index from html_additional_pages --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index aef41abd53c2f..e61fb876643d0 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -303,7 +303,7 @@ # Additional templates that should be rendered to pages, maps page names to # template names. -html_additional_pages = {} +html_additional_pages = {"index": "index.html"} # Additional JS files html_js_files = ["scripts/details-permalink.js"]