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

Enable optional links to *next* and *previous* items #101

Merged
merged 3 commits into from May 14, 2018

Conversation

MinchinWeb
Copy link
Contributor

Fixes #18. I finally got annoyed enough at the feature not being there that I added it myself.

The links are optional, and off by default. Under theme options, set show_relbars = True to enable them.

The top and bottom bars can be individually toggled. The border color can also be customized. Documentation is also included.

image

image

Provides *next* and *previous* links above and below main page content. They are disabled by default. Includes documentation.
Closes sphinx-doc#18.
@bitprophet bitprophet merged commit ef6a82e into sphinx-doc:master May 14, 2018
bitprophet added a commit that referenced this pull request May 14, 2018
Also, this closes #101 and closes #18
@MinchinWeb
Copy link
Contributor Author

Awesome, thanks!

@MinchinWeb MinchinWeb deleted the relbars branch May 15, 2018 16:12
@asmeurer
Copy link

asmeurer commented Jun 7, 2018

How soon until a release that has this? It's already live on the readthedocs site (which shows the dev docs).

@asmeurer
Copy link

asmeurer commented Jun 8, 2018

It also would be nice if the prev and next links had different css ids so that one could style them separately (I'd prefer to make the prev links float left).

@MinchinWeb
Copy link
Contributor Author

MinchinWeb commented Jun 10, 2018

@asmeurer : You can already target the CSS for the top and bottom links separately, and this is actually done by the theme.

.related {
    // applies to both sets of links
}

.related.top {
    // applies to only the top links
}

.related.bottom {
    // applies to only the bottom links
}

@asmeurer
Copy link

No I want to style the previous and next separately, not the top and bottom. I want to put the previous link on the left.

@MinchinWeb
Copy link
Contributor Author

@asmeurer try using the pseudo-classes :first and :last

@asmeurer
Copy link

@MinchinWeb I assume you mean :first-child and :last-child. :first seems to be related to printing.

I'm pretty new to CSS, but I can't figure out how to make this work. Note that on both the first and last page, there is only one link in the rellinks nav, but in the two cases I would want them to be on opposite sides. I thought I could use attribute selectors to select based on the title, but that doesn't select the arrow.

I'm sure there's a way to do it, but I don't know enough CSS to get it done. It would be much simpler if the previous and next links had separate CSS classes.

(also FWIW, I think what I'm trying to do should be the default in the theme, but I'll leave that decision up to @bitprophet)

@bitprophet
Copy link
Collaborator

Having extra classes seems reasonable if it's easy to do (haven't looked myself yet). I think that should be a separate ticket, however - feel free to make one.

Re: release of this merge: I'll try to pop out an 0.7.11 sometime, there's outstanding release process issues but AFAIK this is backwards compatible so we should still be able to put out a tertiary release.

asmeurer added a commit to asmeurer/alabaster that referenced this pull request Jun 14, 2018
This is as suggested at sphinx-doc#101. This makes them easier to style separately, such
as making the previous link float left.
@asmeurer
Copy link

I went ahead and implemented it #135. I put the CSS I'm using there so you can decide which you prefer as the default.

@MinchinWeb
Copy link
Contributor Author

@asmeurer I glad you could get something with CSS working. I tried a couple of things, I couldn't get it working on my end...

@asmeurer
Copy link

@MinchinWeb
Copy link
Contributor Author

@asmeurer No, I was trying to hack my own code to get it to display like you were wanting it to. I thought I'd managed to do that at one point early in my work on this, but couldn't figure it out again; maybe it never worked for me, I don't know. So I'm glad you found a working solution, and that it made it into the newest release!

@asmeurer
Copy link

Is it actually in the release? #135 wasn't merged.

@MinchinWeb
Copy link
Contributor Author

Apparently I'm not paying quite enough attention, but it looks like it's (#135) slated for the next release.

@bitprophet
Copy link
Collaborator

I'll be releasing soon, been tied up with other thing and projects, but I intend to sweep through all repos and put any unreleased code out on PyPI this week.

@jab
Copy link

jab commented Sep 16, 2018

Thanks for the update @bitprophet, psyched for this to get released. Btw #125 has already been approved and should just be a matter of clicking merge in case you can land that too before the release.

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

Successfully merging this pull request may close these issues.

None yet

4 participants