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

Modern theme and more options #105

Open
DeeliN221 opened this issue Oct 17, 2023 · 4 comments
Open

Modern theme and more options #105

DeeliN221 opened this issue Oct 17, 2023 · 4 comments

Comments

@DeeliN221
Copy link

Just a suggestion, ReadTheDocs theme and Pydata theme both look nice and have many advanced functions, such as dark mode, sticky TOC, and easily navigation. They are being used by many popular scientific projects like numpy, scipy, pandas, ...

If you guys like, I will create a PR then, with a "dark-mode" toggle button, sticky TOC, wider page, and quickly copy code-block function enabled.

@certik
Copy link
Owner

certik commented Oct 17, 2023

@m3lab-zzl that would be awesome, thank you. Go ahead!

@DeeliN221
Copy link
Author

Right, I am working on this (the toolchain got me some trouble due to bad internet connection). The PR will come soon.

@DeeliN221
Copy link
Author

Preview the mathjax version (equations are rendered by mathjax on the fly)

  • Current one:

image

  • Light ReadTheDocs theme:

image

  • Dark ReadTheDocs theme:

image

  • Light Pydata theme:

image

  • Dark Pydata theme:

image

The new 4 options all have a user-friendly sidebar that makes the navigation easier, and a search box for quickly jumping to any interested part. The page width is no longer fixed at some weird width that would leave the right part blank. One final change is the code-block copy button and autowrap:

image

Pydata theme has a Back to top button, if you like this theme, we may need to change the project structure, as the top navigation bar can only display short titles.

  • About the equations

As you mentioned before, Mathjax rendered equations look nicer (also visible in dark mode), and it took much less time to build, but the source code needs some modification to correctly generate the desired output. If you insist the dvisvg solution, equations will be invisible in dark mode.

See PR #106 for code change

@DeeliN221
Copy link
Author

sphinx_book_theme suits better than pydata theme, no need to change project structure because the chapters are placed in the left sidebar. not at the top for pydata theme:

image

Here lists more themes:

https://sphinx-themes.org/

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

No branches or pull requests

2 participants