theoretical-physics icon indicating copy to clipboard operation
theoretical-physics copied to clipboard

Modern theme and more options

Open DeeliN221 opened this issue 1 year ago • 4 comments

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.

DeeliN221 avatar Oct 17 '23 11:10 DeeliN221

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

certik avatar Oct 17 '23 11:10 certik

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

DeeliN221 avatar Oct 18 '23 15:10 DeeliN221

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 avatar Oct 20 '23 02:10 DeeliN221

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/

DeeliN221 avatar Oct 20 '23 03:10 DeeliN221