Skip to content

Commit 7d35f4f

Browse files
thomasjpfanNicolasHug
authored andcommitted
[DOC] Removes "documentation" page and adds Other version in nav bar (scikit-learn#15121)
1 parent 4a93aa8 commit 7d35f4f

File tree

5 files changed

+17
-128
lines changed

5 files changed

+17
-128
lines changed

build_tools/circle/list_versions.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def get_pdf_size(version):
4949
print()
5050

5151
ROOT_URL = 'https://api.github.com/repos/scikit-learn/scikit-learn.github.io/contents/' # noqa
52-
RAW_FMT = 'https://raw.githubusercontent.com/scikit-learn/scikit-learn.github.io/master/%s/documentation.html' # noqa
52+
RAW_FMT = 'https://raw.githubusercontent.com/scikit-learn/scikit-learn.github.io/master/%s/index.html' # noqa
5353
VERSION_RE = re.compile(r"scikit-learn ([\w\.\-]+) documentation</title>")
5454
NAMED_DIRS = ['dev', 'stable']
5555

@@ -88,8 +88,8 @@ def get_pdf_size(version):
8888
else:
8989
seen.add(version_num)
9090
name_display = '' if name[:1].isdigit() else ' (%s)' % name
91-
path = 'http://scikit-learn.org/%s' % name
92-
out = ('* `Scikit-learn %s%s documentation <%s/documentation.html>`_'
91+
path = 'https://scikit-learn.org/%s/' % name
92+
out = ('* `Scikit-learn %s%s documentation <%s>`_'
9393
% (version_num, name_display, path))
9494
if pdf_size is not None:
9595
out += (' (`PDF %s <%s/_downloads/scikit-learn-docs.pdf>`_)'

doc/conf.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@
171171

172172
# Additional templates that should be rendered to pages, maps page names to
173173
# template names.
174-
html_additional_pages = {'index': 'index.html',
175-
'documentation': 'documentation.html'}
174+
html_additional_pages = {'index': 'index.html'}
176175

177176
# If false, no module index is generated.
178177
html_domain_indices = False

doc/templates/documentation.html

Lines changed: 0 additions & 111 deletions
This file was deleted.

doc/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ <h1 class="sk-landing-header text-white text-monospace">scikit-learn</h1>
99
<h4 class="sk-landing-subheader text-white font-italic mb-3">Machine Learning in Python</h4>
1010
<a class="btn sk-landing-btn mb-1" href="{{ pathto('getting_started') }}" role="button">Getting Started</a>
1111
<a class="btn sk-landing-btn mb-1" href="whats_new.html" role="button">Whats New in {{ version }}</a>
12-
<a class="btn sk-landing-btn mb-1" href="{{ pathto('documentation') }}" role="button">Documentation</a>
12+
<a class="btn sk-landing-btn mb-1" href="https://github.com/scikit-learn/scikit-learn" role="button">GitHub</a>
1313
</div>
1414
<div class="col-md-6 d-flex">
1515
<ul class="sk-landing-header-body">

doc/themes/scikit-learn-modern/nav.html

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@
77
{%- endif %}
88

99
{%- set drop_down_navigation = [
10-
('Getting Started', 'getting_started'),
11-
('Tutorial', 'tutorial/index'),
12-
('Glossary', 'glossary'),
13-
('Development', 'developers/index'),
14-
('FAQ', 'faq'),
15-
('Related packages', 'related_projects'),
16-
('Roadmap', 'roadmap'),
17-
('About us', 'about'),
18-
('Documentation', 'documentation')]
10+
('Getting Started', pathto('getting_started')),
11+
('Tutorial', pathto('tutorial/index')),
12+
('Glossary', pathto('glossary')),
13+
('Development', pathto('developers/index')),
14+
('FAQ', pathto('faq')),
15+
('Related packages', pathto('related_projects')),
16+
('Roadmap', pathto('roadmap')),
17+
('About us', pathto('about')),
18+
('GitHub', 'https://github.com/scikit-learn/scikit-learn'),
19+
('Other Versions', 'https://scikit-learn.org/dev/versions.html')]
1920
-%}
2021

2122
<nav id="navbar" class="{{ nav_bar_class }} navbar navbar-expand-md navbar-light bg-light py-0">
@@ -57,14 +58,14 @@
5758
</li>
5859
{%- for title, link in drop_down_navigation %}
5960
<li class="nav-item">
60-
<a class="sk-nav-link nav-link nav-more-item-mobile-items" href="{{ pathto(link) }}">{{ title }}</a>
61+
<a class="sk-nav-link nav-link nav-more-item-mobile-items" href="{{ link }}">{{ title }}</a>
6162
</li>
6263
{%- endfor %}
6364
<li class="nav-item dropdown nav-more-item-dropdown">
6465
<a class="sk-nav-link nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">More</a>
6566
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
6667
{%- for title, link in drop_down_navigation %}
67-
<a class="sk-nav-dropdown-item dropdown-item" href="{{ pathto(link) }}">{{ title}}</a>
68+
<a class="sk-nav-dropdown-item dropdown-item" href="{{ link }}">{{ title}}</a>
6869
{%- endfor %}
6970
</div>
7071
</li>

0 commit comments

Comments
 (0)