Skip to content

[MRG+1] Updates entire website design #14849

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

Merged
merged 155 commits into from
Sep 21, 2019

Conversation

thomasjpfan
Copy link
Member

@thomasjpfan thomasjpfan commented Aug 30, 2019

Here is a hosted version that follows this PR.

This PR:

  1. Updates the entire design of the website.
  2. Keeps all features from the original website.
  3. Adds custom sidebar with button on the lower left. (Mobile friendly)
  4. Completely custom sphinx theme that does not inherit from basic. There were a bunch of js/css we did not use, this is no longer loaded.
  5. There are no images in the new theme.
  6. Small images were generated for the logos on the bottom of the page in the index.
  7. Uses bootstrap 4.

Enjoy! :)

@jnothman
Copy link
Member

jnothman commented Aug 30, 2019 via email

@rth
Copy link
Member

rth commented Aug 30, 2019

Very impressive @thomasjpfan !

Completely custom sphinx theme

I think overall this is great, though if we can afford a professional web-designer (cc @amueller) at least to review this and maybe propose some improvements on top this PR it would be ideal. Personally, I can say that the rendering looks good for me, but I really don't know to review it (with respect to cross-browser compatibility, best web-design practices etc). @cmarmo was also working on improving the website and if there is a way to collaborate on it somehow it would be great.

A side note, do we want to bundle minified jquery and bootstrap (as opposed to using a CDN)? I get they this allows to use the doc offline, but they are not that small and a prone to be updated frequently.

@rth
Copy link
Member

rth commented Aug 30, 2019

For instance, I also wonder if bootstrap is still the best way to go in the frontend world. Though I agree it's a clear improvement over our current website in any case.

@rth
Copy link
Member

rth commented Aug 30, 2019

For instance, I also wonder if bootstrap is still the best way to go in the frontend world. Though I agree it's a clear improvement over our current website in any case.

FWIW, pytorch also uses bootstrap but their theme is very customized.

@thomasjpfan
Copy link
Member Author

Personally, I can say that the rendering looks good for me, but I really don't know to review it

Not having something like webpack to do auto prefixing is a little rough. I have been developing in firefox/chrome/safari. (edge is moving to chromium) I will get my hands on IE and see what it looks like.

FWIW, pytorch also uses bootstrap but their theme is very customized.

They vendor their bootstrap as well and not use the bootstrap CDN. (It is pretty nice to view docs locally)

For instance, I also wonder if bootstrap is still the best way to go in the frontend world. Though I agree it's a clear improvement over our current website in any case.

Bootstrap is really nice to prototype design in because I was most familiar with it. Now that we have a design, I think it is possible to use something smaller, like purecss. We would only need custom js for the "who uses scikit-learn" carousel and maybe for the navbar folding in mobile. Although, using a familiar/popular css framework like Bootstrap makes it easier for others to contribute/modify.

@ogrisel
Copy link
Member

ogrisel commented Sep 18, 2019

@jnothman any further comments? merge?

@GaelVaroquaux
Copy link
Member

GaelVaroquaux commented Sep 18, 2019 via email

Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise, good to merge!!

Wow, @thomasjpfan

doc/conf.py Outdated
@@ -314,8 +309,8 @@ def make_carousel_thumbs(app, exception):

def setup(app):
# to hide/show the prompt in code examples:
app.add_javascript('js/copybutton.js')
app.add_javascript('js/extra.js')
# app.add_javascript('js/copybutton.js')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this about? I don't thnk we should have commented-out code lying around

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

@@ -0,0 +1,111 @@
{% extends "layout.html" %}
{% set title = 'Documentation scikit-learn: machine learning in Python' %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{% set title = 'Documentation scikit-learn: machine learning in Python' %}
{% set title = 'Documentation of scikit-learn: machine learning in Python' %}

<div class="card h-100 sk-documentation-index-card mx-md-2">
<a href="{{ pathto('tutorial/basic/tutorial') }}" class="stretched-link sk-documentation-index-anchor"></a><h4 class="card-header">Quick Start</h4>
<div class="card-body p-3">
<p class="card-text">A very short introduction into machine learning problems and how to solve them using scikit-learn. Presents basic concepts and conventions.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p class="card-text">A very short introduction into machine learning problems and how to solve them using scikit-learn. Presents basic concepts and conventions.</p>
<p class="card-text">A very short introduction to machine learning problems and how to solve them using scikit-learn. Presents basic concepts and conventions.</p>

<div class="card h-100 sk-documentation-index-card mx-md-2">
<a href="{{ pathto('modules/classes') }}" class="stretched-link sk-documentation-index-anchor"></a><h4 class="card-header">API</h4>
<div class="card-body p-3">
<p class="card-text">The exact API of all functions and classes, as given by the docstrings. The API documents expected types and allowed features for all functions, and all parameters available for the algorithms.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p class="card-text">The exact API of all functions and classes, as given by the docstrings. The API documents expected types and allowed features for all functions, and all parameters available for the algorithms.</p>
<p class="card-text">The exact API of all functions and classes, as given by the docstrings. The API describes expected types and allowed features for all functions, and all parameters available for the algorithms.</p>

"The API documents" was a garden path sentence, since "documents" is ambiguously a noun and verb.

<div class="card h-100">
<div class="card-body">
<a href="supervised_learning.html#supervised-learning"><h4 class="sk-card-title card-title">Classification</h4></a>
<p class="card-text">Identifying to which category an object belongs to.</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<p class="card-text">Identifying to which category an object belongs to.</p>
<p class="card-text">Identifying which category an object belongs to.</p>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these are typos in the original.

I'd like to change these all to imperative mod: "Identify which category..." but perhaps in the next PR.

<a class="btn btn-warning btn-big sk-donate-btn mb-1" onclick="document.getElementById('paypal-form').submit(); ">Help us, <strong>donate!</strong></a>
<a class="btn btn-warning btn-big mb-1" href="about.html#citing-scikit-learn"><strong>Cite us!</strong></a>
<p class="mt-2">
<a href="about.html#funding">Read more about donations</a>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(this seems to be a poor link target)

Copy link
Member Author

@thomasjpfan thomasjpfan Sep 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Poor as in...its too small?

});

{%- if pagename != 'index' and pagename != 'documentation' %}
/*** Had navbar when scrolling down ***/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "Had navbar"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It meant to "Hide"

stylesheet = css/theme.css

[options]
google_analytics = false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about this. It seems to be in contradiction to conf.py

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sets the default. I can change it to true by default.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was changed to true.

{% endif %}

<script>
$(document).ready(function() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it preferably to include this in the page, rather than by src?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reduces the number of HTTP requests.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The total number of bytes the javascript.html is small (in bytes), so I thought it was worth it to inline the javascript.

@GaelVaroquaux
Copy link
Member

LGTM.

Merge? @jnothman : you had comments. I'll leave you some time to voice any other comments if you have some. If I don't hear from you, I'll merge.

@jnothman jnothman merged commit 89332d3 into scikit-learn:master Sep 21, 2019
@jnothman
Copy link
Member

Awesome work, @thomasjpfan!

@amueller
Copy link
Member

Sorry I didn't follow the discussion.
If I click on "install" the sidebar has a toc of install, and similarly for examples and API. But if I click on User Guide, the sidebar has a toc for the full page that includes the API and examples. That's a bit confusing. Here the sidebar doesn't correspond to the things on the left (which kind of makes sense since you don't want to show the same thing twice), but I find it confusing.

@amueller
Copy link
Member

also, the "documentation" page now seems a bit useless, right?

@amueller
Copy link
Member

also weird line-wrap:
image

@amueller
Copy link
Member

Also, I would maybe remove the testimonials. They are mostly confusing if anything. Linking to the sklearn consortium or the google scholar citations would be more informative, I think.

@thomasjpfan
Copy link
Member Author

If I click on "install" the sidebar has a toc of install, and similarly for examples and API. But if I click on User Guide, the sidebar has a toc for the full page that includes the API and examples. That's a bit confusing. Here the sidebar doesn't correspond to the things on the left (which kind of makes sense since you don't want to show the same thing twice), but I find it confusing.

The sidebar changes based on context. Before the sidebar was just useless: https://scikit-learn.org/stable/user_guide.html

also, the "documentation" page now seems a bit useless, right?

It is less useful now. It still gives a little context to each link.

@amueller
Copy link
Member

There has been a discussion on how to structure numpy, scipy and pandas websites here:
numpy/numpy.org#43

It might make sense to join the discussion and/or follow suite.

@amueller
Copy link
Member

It is less useful now. It still gives a little context to each link.

well but when/how would a user end up there? like if they don't know what of the other links to click? seems like a strange path to take.

@thomasjpfan
Copy link
Member Author

well but when/how would a user end up there

They can end up there from the landing page if they click "Documentation":

Screen Shot 2019-09-23 at 4 41 24 PM

well but when/how would a user end up there? like if they don't know what of the other links to click? seems like a strange path to take.

It kind of serves as a global index. I am okay with removing it.

@amueller
Copy link
Member

Ah, I hadn't seen that. I'm not opposed to keeping it but it seems less useful now.

@ogrisel
Copy link
Member

ogrisel commented Oct 2, 2019

Same feeling.

@thomasjpfan
Copy link
Member Author

One of the ways we are using the documentation page is to outline all the versions in the all versions page (It shows the version number on the top of the page)



@media screen and (min-width: 1540px) {
.sphx-glr-download-link-note {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff! I just noticed that the note about the binder link is floated right, I wish I had the web skills to think of this in the first place and then execute it as well.
image

@GaelVaroquaux
Copy link
Member

GaelVaroquaux commented Oct 23, 2019 via email

@lesteve
Copy link
Member

lesteve commented Oct 23, 2019

Should we consider backporting this to sphinx-gallery?

Sounds like a good idea indeed.

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

Successfully merging this pull request may close these issues.