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

👌 IMPROVE: RHS TOC sticky when scrolling option #144

Open
wants to merge 38 commits into
base: main
Choose a base branch
from

Conversation

DrDrij
Copy link
Member

@DrDrij DrDrij commented Jun 6, 2021

Fixes #133

  • Add config option to make the in-page-TOC in the right column sticky (stays in view when scrolling)
  • Highlight respective TOC items when scrolling

The page TOC will now highlight as the user scrolls.

A config option is required to activate the sticky feature and highlighting functionality. This defaults to False where the page TOC is not sticky.

sphinx:
  config:
    html_theme_options:
      sticky_contents: true
Screen.Recording.2021-06-22.at.4.04.08.pm.mov

@DrDrij DrDrij requested review from AakashGfude and mmcky June 6, 2021 01:01
@github-actions github-actions bot temporarily deployed to commit June 6, 2021 01:03 Inactive
@mmcky
Copy link
Contributor

mmcky commented Jun 6, 2021

nice work @DrDrij -- it would be good to get the preview building with the updated RHS toc. Is that possible?

@codecov
Copy link

codecov bot commented Jun 11, 2021

Codecov Report

Merging #144 (a75930f) into master (976718a) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #144   +/-   ##
=======================================
  Coverage   71.12%   71.12%           
=======================================
  Files           2        2           
  Lines         239      239           
=======================================
  Hits          170      170           
  Misses         69       69           
Flag Coverage Δ
pytests 71.12% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@github-actions github-actions bot temporarily deployed to commit June 11, 2021 01:40 Inactive
@mmcky
Copy link
Contributor

mmcky commented Jun 18, 2021

@DrDrij is the outstanding checkbox still in work?

@mmcky mmcky marked this pull request as draft June 21, 2021 06:09
@github-actions github-actions bot temporarily deployed to commit June 22, 2021 05:32 Inactive
@github-actions github-actions bot temporarily deployed to commit June 22, 2021 05:52 Inactive
@mmcky
Copy link
Contributor

mmcky commented Jun 22, 2021

re: option name perhaps we need to specify rhs perhaps.

The main toc is persistent_toc: true

So perhaps we need to differentiate these toc objects a bit more clearly. Maybe LHS == TOC and RHS == CONTENTS

@mmcky
Copy link
Contributor

mmcky commented Jul 20, 2021

@DrDrij what do you think re: comments / names?

@mmcky
Copy link
Contributor

mmcky commented Sep 7, 2021

@DrDrij do you think you would have some time in the next two weeks to see if we can close this?

@github-actions github-actions bot temporarily deployed to commit September 9, 2021 04:19 Inactive
@github-actions github-actions bot temporarily deployed to commit September 9, 2021 04:20 Inactive
@DrDrij
Copy link
Member Author

DrDrij commented Sep 9, 2021

@mmcky Great idea. Changed the parameter to sticky_contents: true from sticky_toc: true.
Shall I create a PR on the myst sites to add the parameter? programming, python, advanced, datascience, julia? I suppose we only need to add it if we want sticky as true (default false).

I think that covers it for this PR :)

@mmcky
Copy link
Contributor

mmcky commented Jun 27, 2022

I think sticky_contents will be fine.

@mmcky
Copy link
Contributor

mmcky commented Mar 13, 2023

@AakashGfude can you please resolve these conflicts after #186 is merged.

@github-actions github-actions bot temporarily deployed to commit April 28, 2023 07:29 Inactive
@github-actions github-actions bot temporarily deployed to commit April 30, 2023 13:53 Inactive
@github-actions github-actions bot temporarily deployed to commit April 30, 2023 14:25 Inactive
@AakashGfude
Copy link
Member

@mmcky this is ready to be reviewed and merged.

@github-actions github-actions bot temporarily deployed to commit May 1, 2023 09:09 Inactive
@github-actions github-actions bot temporarily deployed to commit May 1, 2023 09:14 Inactive
@mmcky
Copy link
Contributor

mmcky commented May 3, 2023

@AakashGfude the latest netlify doesn't seem to show the "sticky" rhs toc?

@github-actions github-actions bot temporarily deployed to commit May 3, 2023 07:22 Inactive
@mmcky
Copy link
Contributor

mmcky commented May 4, 2023

@AakashGfude let's revert 0acf72c and I will update the quantecon-book-theme branch on lecture-python-programming.

https://github.com/QuantEcon/lecture-python-programming.myst

@mmcky
Copy link
Contributor

mmcky commented May 4, 2023

@AakashGfude I just pushed c8fd78a

@mmcky
Copy link
Contributor

mmcky commented May 4, 2023

@AakashGfude once you get the tests and merge conflict sorted -- then please ping me for review. Thanks.

@github-actions github-actions bot temporarily deployed to commit May 5, 2023 01:57 Inactive
@mmcky
Copy link
Contributor

mmcky commented May 5, 2023

@AakashGfude this looks sticky now 👍

What do you think? I suspect @jstac will prefer the non-sticky version but it is nice that our theme can support this option.

@mmcky
Copy link
Contributor

mmcky commented May 5, 2023

@jstac this PR enables the RHS within page contents to stay visible in the margin

https://64546294cce6883938fb185c--hungry-lovelace-7d0512.netlify.app/python_by_example.html

Let me know your thoughts on this? I am in two minds - I like the clean view of it just being at the top (i.e. not sticky) but it can be handy to navigated within the page with it available all the time.

@AakashGfude
Copy link
Member

Thanks @mmcky. This looks good now. Yes, I think by default we should keep it non-sticky. Good to have the option.

@mmcky mmcky added the on-hold label Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

Adjustments for RHS TOC
3 participants