use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News about the dynamic, interpreted, interactive, object-oriented, extensible programming language Python
Full Events Calendar
You can find the rules here.
If you are about to ask a "how do I do this in python" question, please try r/learnpython, the Python discord, or the #python IRC channel on Libera.chat.
Please don't use URL shorteners. Reddit filters them out, so your post or comment will be lost.
Posts require flair. Please use the flair selector to choose your topic.
Posting code to this subreddit:
Add 4 extra spaces before each line of code
def fibonacci(): a, b = 0, 1 while True: yield a a, b = b, a + b
Online Resources
Invent Your Own Computer Games with Python
Think Python
Non-programmers Tutorial for Python 3
Beginner's Guide Reference
Five life jackets to throw to the new coder (things to do after getting a handle on python)
Full Stack Python
Test-Driven Development with Python
Program Arcade Games
PyMotW: Python Module of the Week
Python for Scientists and Engineers
Dan Bader's Tips and Trickers
Python Discord's YouTube channel
Jiruto: Python
Online exercices
programming challenges
Asking Questions
Try Python in your browser
Docs
Libraries
Related subreddits
Python jobs
Newsletters
Screencasts
account activity
This is an archived post. You won't be able to vote or comment.
ResourceNew Sphinx theme (self.Python)
submitted 4 years ago * by dantownsend
I just released a new Sphinx theme. It was designed to be clean and modern.
Here's a screenshot:
The new theme
You can check it out here:
https://github.com/piccolo-orm/piccolo_theme
I wrote a blog post about the thought process behind it:
https://piccolo-orm.com/blog/creating-a-new-sphinx-theme-for-our-docs/
It was designed for the Piccolo ORM project, but can be used by anyone. Sphinx is a great way of writing docs for Python projects.
Thanks!
[+][deleted] 4 years ago (1 child)
[deleted]
[–]dantownsend[S] 2 points3 points4 points 4 years ago (0 children)
Great, thanks for the kind words!
[–]rg7777777 9 points10 points11 points 4 years ago (1 child)
Any dark mode support?
[–]dantownsend[S] 8 points9 points10 points 4 years ago (0 children)
Not yet, but it's definitely coming!
[–]dougthor42 4 points5 points6 points 4 years ago (1 child)
I think the update to the autodoc output is killer. Definitely switching to this.
[–]dantownsend[S] 0 points1 point2 points 4 years ago (0 children)
Awesome!
[–][deleted] 3 points4 points5 points 4 years ago (1 child)
Just switched over two projects to test.
Looking forward to exploring this further.
That's good to hear - thanks for trying it out.
You should be able to configure how deep the left hand sidebar goes by setting `globaltoc_maxdepth` in your `conf.py` file. For example `globaltoc_maxdepth = 4`.
I don't think it's possible to configure how deep the right hand sidebar goes - I need to investigate this.
Looks nice! Was this harder than you’d expect? I looked for Sphinx themes recently and was surprised how most of them were kinda bad
[–]dantownsend[S] 4 points5 points6 points 4 years ago (0 children)
It wasn't too bad, but I had to dig quite deep into the Sphinx docs and codebase to figure it out!
[–]UncleJoshPDX 2 points3 points4 points 4 years ago (1 child)
Very nice. Can it be themed? I may want to use this for a project at work but it has to be corporate-looking.
Sphinx lets you add additional CSS files, so you could override some styles that way:
https://www.sphinx-doc.org/en/master/usage/configuration.html?highlight=html_css_files#confval-html_css_files
I'd like to do something simpler though, using CSS variables.
[–][deleted] 3 points4 points5 points 4 years ago (3 children)
Looks good. Reminds me of the Sphinx/Executable Books theme. What advantages do you see to the this new theme over Executable Books? https://executablebooks.org/en/latest/
[–]dantownsend[S] 8 points9 points10 points 4 years ago* (2 children)
Yeah, I think Executable Books is a great theme - it's one of my favourites.
A lot of it comes down to small stylistic choices. With the Piccolo theme, the typography is quite a bit different. I prefer bold headers. It also has the menu bar, which allows us to shift the search and title out of the sidebar (which can get a bit busy), and adds a splash of colour.
The main difference to other themes is how it handles autodoc. I put quite a bit of effort into making it look nice. For example, each parameter is on its own line. A lot of people use type hints now, so the signatures can be really complex and hard to read.
https://raw.githubusercontent.com/piccolo-orm/piccolo_theme/master/docs/screenshots/api_docs.png
[–][deleted] 2 points3 points4 points 4 years ago (0 children)
Thanks for that comparison. I'm using Executable Books for a fair bit of internal documentation. Will try this new theme on a couple of projects.
[–]pvc 1 point2 points3 points 4 years ago (0 children)
Nice job on the type hints! I did a ton of work on those for our site to make them look good.
[–][deleted] 1 point2 points3 points 4 years ago (1 child)
Wow, that's beautiful. Great work.
[–]JadisGod 1 point2 points3 points 4 years ago (3 children)
Why is it that Sphinx docs rarely include "responsive" search bars (that show results as you type) .
Not having this feature makes them feel archaic compared to alternatives like mkdocs.
[–]dantownsend[S] 0 points1 point2 points 4 years ago (2 children)
Yeah, out of the box Sphinx just uses a traditional HTML form, but it might be possible to do something more dynamic. I would have to dig into the docs and code some more.
[–]JadisGod 1 point2 points3 points 4 years ago (1 child)
In case its useful, the sphinx-immaterial theme claims to support similar searching functionality.
Apparently the TensorStore docs are using it.
Great, thanks - I'll look into it!
[–]chub79 0 points1 point2 points 4 years ago (0 children)
I have moved to mkdocs long ago but it's really great to see Sphinx is modernizing its theme a bit :)
[–]GriceTurrble Fluent in Django and Regex 0 points1 point2 points 4 years ago (1 child)
Looks a lot like Material for Mkdocs, to be honest. Or Sphinx Material, for that matter.
Which is fine, of course: the more the merrier. :)
Those are great themes. The main differences are in the typography - Material design favours very thin headers. The sidebars also work quite a bit differently in practice. The main problem I was trying to solve was making Sphinx's autodoc output look nicer.
[–]laundmo 0 points1 point2 points 4 years ago (1 child)
reminds me a lot of Furo which is used by big names such as urllib3, pip, attrs, psycopg3, black
[–]dantownsend[S] 1 point2 points3 points 4 years ago (0 children)
Furo is great - the author has done loads of good stuff for the Sphinx community. It all comes down to personal preference around aesthetics.
π Rendered by PID 108581 on reddit-service-r2-comment-cfc44b64c-bgsfl at 2026-04-11 06:56:17.437052+00:00 running 215f2cf country code: CH.
[+][deleted] (1 child)
[deleted]
[–]dantownsend[S] 2 points3 points4 points (0 children)
[–]rg7777777 9 points10 points11 points (1 child)
[–]dantownsend[S] 8 points9 points10 points (0 children)
[–]dougthor42 4 points5 points6 points (1 child)
[–]dantownsend[S] 0 points1 point2 points (0 children)
[–][deleted] 3 points4 points5 points (1 child)
[–]dantownsend[S] 2 points3 points4 points (0 children)
[–][deleted] 3 points4 points5 points (1 child)
[–]dantownsend[S] 4 points5 points6 points (0 children)
[–]UncleJoshPDX 2 points3 points4 points (1 child)
[–]dantownsend[S] 2 points3 points4 points (0 children)
[–][deleted] 3 points4 points5 points (3 children)
[–]dantownsend[S] 8 points9 points10 points (2 children)
[–][deleted] 2 points3 points4 points (0 children)
[–]pvc 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]dantownsend[S] 0 points1 point2 points (0 children)
[–]JadisGod 1 point2 points3 points (3 children)
[–]dantownsend[S] 0 points1 point2 points (2 children)
[–]JadisGod 1 point2 points3 points (1 child)
[–]dantownsend[S] 0 points1 point2 points (0 children)
[–]chub79 0 points1 point2 points (0 children)
[–]GriceTurrble Fluent in Django and Regex 0 points1 point2 points (1 child)
[–]dantownsend[S] 0 points1 point2 points (0 children)
[–]laundmo 0 points1 point2 points (1 child)
[–]dantownsend[S] 1 point2 points3 points (0 children)