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

ENH: Add logo_link theme option #246

Merged
merged 10 commits into from
Dec 28, 2020

Conversation

leonarduschen
Copy link
Contributor

@leonarduschen leonarduschen commented Sep 8, 2020

Closes #245

Add logo_link option to specify the page linked to logo (default is master_doc)

logo_link is treated as a URL if it starts with "http" otherwise treat it as RST doc.

@choldgraf
Copy link
Collaborator

What is the expected behavior if somebody changes their master_doc to be something other than index? Won't this result in a broken link? Or will an index file always be created?

@leonarduschen
Copy link
Contributor Author

I think it would still be okay as long as that person writes the following (will confirm this locally)

html_additional_pages = {
    'index': '<template>.html',
}

which as far as I know is how people usually do it when they make custom HTML landing page.

That said, it'll probably result in a broken link if the project does not have an index page at all. Do you think it is a better idea to add an option to link logo to other than master_doc in theme.html ?

@choldgraf
Copy link
Collaborator

yeah I'd rather provide a theme option to over-ride the logo link...I think that's a bit less-hacky than asking people to define a custom template mapping

@jorisvandenbossche
Copy link
Member

@leonarduschen thanks for looking into this!

One thing I am wondering: how do other themes handle this? Eg readthedocs theme also has a logo that points to the "home"/"index" page.

@jorisvandenbossche
Copy link
Member

@leonarduschen
Copy link
Contributor Author

Hmm, seems they are also using master_doc .. https://github.com/readthedocs/sphinx_rtd_theme/blob/1d856256676d2b801a12c30e4a849c5abc466da9/sphinx_rtd_theme/layout.html#L119

Yep it seems so. Alabaster does too https://github.com/bitprophet/alabaster/blob/master/alabaster/about.html

But I guess it can't hurt to add a logo theme option though (instead of the problematic original idea to change it to index)

@leonarduschen leonarduschen changed the title Change logo href from master_doc back to index Add logo_doc theme option Sep 12, 2020
@leonarduschen
Copy link
Contributor Author

@choldgraf

yeah I'd rather provide a theme option to over-ride the logo link...I think that's a bit less-hacky than asking people to define a custom template mapping

Done!

@leonarduschen leonarduschen changed the title Add logo_doc theme option Add logo_link theme option Sep 12, 2020
@leonarduschen
Copy link
Contributor Author

@choldgraf I have tested locally and can confirm it works for both external link and local doc.

@leonarduschen
Copy link
Contributor Author

ping

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

@leonarduschen sorry for the slow follow-up, but this looks good to me!

Could you add a small section about this option in configuring.rst ?

@leonarduschen leonarduschen changed the title Add logo_link theme option ENH: Add logo_link theme option Oct 25, 2020
@leonarduschen
Copy link
Contributor Author

done!

@@ -19,6 +19,15 @@ doc path's _static folder, and use the following configuration:

html_logo = "_static/logo.png"

The logo links to ``master_doc`` by default. If you'd like to link to other page
Copy link
Collaborator

@choldgraf choldgraf Oct 25, 2020

Choose a reason for hiding this comment

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

Suggested change
The logo links to ``master_doc`` by default. If you'd like to link to other page
The logo links to ``master_doc`` (usually the first page of your documentation) by default. If you'd like to link to another page

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree on "other page" to "another page" but the logo really links to master_doc by default though and sometimes master_doc is not the landing page (e.g. numpy dev docs).

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmmm - fair enough, what do you think about the new language suggestion? The thing is that most users don't know what master_doc is so I prefer using terminology that the "average" user will likely understand

Copy link
Collaborator

Choose a reason for hiding this comment

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

another thing we could do instead is include a link to the Sphinx documentation for master_doc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the new language suggestion is pretty informative!

@leonarduschen
Copy link
Contributor Author

@jorisvandenbossche let me know if you'd like me to change anything :)

@mattip
Copy link

mattip commented Dec 28, 2020

ping

Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

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

Sorry for the slow follow-up, @mattip thanks for the ping, and @leonarduschen thanks for the updates! Looking good!

docs/user_guide/configuring.rst Outdated Show resolved Hide resolved
@jorisvandenbossche jorisvandenbossche merged commit f2c33be into pydata:master Dec 28, 2020
@bryevdv
Copy link
Contributor

bryevdv commented Feb 28, 2021

Just confirming, this is not in a release yet? This option is described in the published docs, but I get an error about logo_link being an unknown theme option when I try to use it, and I can't actually see this PR in the 0.4.x commit history, either. (But it is in the master commit history) Will this be released soon?

@jorisvandenbossche
Copy link
Member

This option is described in the published docs,

What you link to are the development docs .. (we should maybe link to the stable docs on the github landing page / make it the default readthedocs url).
But so, indeed not yet in a release. We should urgently release, but there are a few things I want to finish before doing that (but have been a bit busy with other work lately). I just mentioned it on the bokeh issues as well, but for testing out the upstream theme for the bokeh docs, I would suggest to use the development version for now until we do a release (you can pip install it from the git url, and eg put that in an environment.yml file)

@bryevdv
Copy link
Contributor

bryevdv commented Feb 28, 2021

Ah yes, I just clicked through from the link in the GitHub README (also I assumed "latest" means "latest release" but forgot RTD has a strange (to me) convention about that). Thanks for clarifying!

@choldgraf
Copy link
Collaborator

@jorisvandenbossche is there a reason you don't want to release? I am always worried when I see sentences like

We should urgently release, but there are a few things I want to finish before doing that

Cutting a release only takes like 2 minutes, so we should just make a release unless there's a strong reason that we want to block it!

@leonarduschen
Copy link
Contributor Author

I don't know much about release workflows but if QA is the concern I can quickly write some tests to cover this feature

@jorisvandenbossche
Copy link
Member

@jorisvandenbossche is there a reason you don't want to release? I am always worried when I see sentences like

Actually yes ;) #312 needs to go in, because I don't want to have people start relying on variables names we are going to change. Now, that's a trivial PR and I rebased it now, so I can release later this evening.

@bollwyvl
Copy link
Collaborator

bollwyvl commented Mar 9, 2021

👍 to progress, I'll also get #294 back in fighting shape.

"latest" means "latest release" but forgot RTD has a strange (to me) convention about that

Yeah, perhaps adjusting the RTD workflow to reflect that, and having to Push The Button to "activate" a tag as a latest would reduce the dissonance...

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.

Change logo href from master_doc back to index
6 participants