Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An attempt at mimicking the pydata-sphinx-theme in MkDocs #2179

jorenham started this conversation in Show and tell
Discussion options

I needed some documentation for numpy/numtype, but I have no experience with sphinx; only markdown; so we decided to go with MkDocs.

But the default theme was hurting my eyes, and I found myself longing for the comfort of the pydata-sphinx-theme. So with barely any graphical design experience, as well as colorblindness, I decided it would be a great idea to try to (削除) port (削除ここまで) mimick the pydata-sphinx-theme in MkDocs Material.

Now it's online for the whole world to see (https://numpy.org/numtype/). So I thought I'd share it here, in the hope that you might be able to tell me how much I butchered it, or better yet, how to "un-butcher" it. And of course, PR's are very welcome :)

You must be logged in to vote

Replies: 3 comments 3 replies

Comment options

Out of curiosity, what were the drawbacks with Sphinx's support for markdown (via MyST) that led you to choose MkDocs? Note e.g. that much of this theme's documentation is written in markdown. I'd be grateful for feedback on how we can improve either our user experience or our advertising!

A

You must be logged in to vote
2 replies
Comment options

The main reason is that I have experience with mkdocs, and was (and still am) satisfied with its ease of setup. But to be honest, I wasn't aware of MyST. But even if I were, I don't think that would have affected my choice. Because at first glance, setting it up looks quite a bit more involved. It's probably the more flexible choice, but for this purpose, that additional flexibility would probably not be needed.

Comment options

I usually tell people "MKdocs is for pages, Sphinx is for books" , so it's likely that @jorenham can do without the additional complexity.
That said, IMHO myst is a brilliant solution to help future proof your project if it starts to sprout translations, glossaries, indexes, etc.

Comment options

Hey, @jorenham, thanks for sharing!

So I thought I'd share it here, in the hope that you might be able to tell me how much I butchered it, or better yet, how to "un-butcher" it. And of course, PR's are very welcome :)

This is fairly new and only scoped for some components, so I cannot give much detailed feedback.
Though I noticed the primary and secondary colours are different from those in PST, I am unsure if this was intentional or an oversight.
Anyway, I wanted to point out the following resources that might be helpful as you continue to refine the theme:

Happy to help if needed.

You must be logged in to vote
1 reply
Comment options

Though I noticed the primary and secondary colours are different from those in PST, I am unsure if this was intentional or an oversight.

Hmm I guess I must've overridden the wrong css variables or copied the wrong color codes. I noticed in the css several primary color codes (on both sides), and I wasn't which one I should use. The secondary I wasn't able to find at all in mkdocs, so I'm not sure how to translate that.

Yea I spotted the figma file earlier, but somehow missed the docs; thanks for sharing! But as far as I can tell it looks all pretty high level, and I'm not sure how to translate that into something concrete that I can apply here 🤔.

Happy to help if needed.
That would certainly be appreciated!
The customizations I've made so far can be found in docs/style/theme.css. There I've also copied over any of the relevant theme colors I could find, mostly for reference. There's also some higher-level theme options in mkdocs.yml, but I believe that most of those can also be overridden from css. Feel free to fiddle around with it if you want to.

Comment options

I've made some progress, and this is what it looks like now:

image
image

For the headers I went a bit off-piste, and went with the Lato font, matching the NumPy logo. If that's not a good idea, feel free to let me know.

I didn't look into pygments yet, so the code blocks look rather out-of-tune. But I feel like the other content is getting pretty close to how it should be now.

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /