Sphinx Tab extension question


#1

I already looked on pypi and asked a search engine but I was not able to find anything, well maybe my search term was not right.

I was wondering, if someone knows of an extension for sphinx to generate tabs. I am trying to generate code tabs like in this video https://www.youtube.com/watch?v=_bcbeT6FVuE

I would like to avoid to write an extension and was hoping maybe someone knows already one, to do something more or less like that ? :smile:


#2

https://bitbucket.org/birkenfeld/sphinx-contrib/src/7f39b7f255e34bfe588f0065a5d9709a7d8e7614/examplecode/?at=default

We’ve looked at extending this to work nicely in Read the Docs, and shipping it as part of the default environment. It pretty much just works and isn’t too much code, as it stands now.


#3

Wow ! thanks a lot ! I did not saw that one :smile:

It is almost perfect, the only thing I have to do is to add some custom lexer.

Thanks !


#4

Yea, I think this is one that would be valuable to break out of sphinx-contrib, and release as it’s own extension. It could use a bit more polish, and maybe some CSS for integrating with common themes, and be really useful. I think it’s something a lot of people want to use, but it’s hidden away in sphinx-contrib instead of having its own project & README for usage.


#5

The other bit it needs is some Javascript so that it flips all the tabs when you change one, and keeps state so it stays consistent between page loads. Anyway, glad it worked out for ya :slight_smile:


#6

I started to hack around a bit. The code is still very bad as the lexer, but well as a proof of concept it works.

Would be nice to improve it and make it more generic :smile:


Sphinx and "tabbed" examples for different OSes