Latest / Talk Python To Me / #354: Sphinx, MyST, and Python Docs in 2022
Transcript
- 0:00When you think about the power of Python, the clean language or powerful standard library may come to mind.
- 0:04You might certainly point to the external packages as well.
- 0:07But what about the relative ease of picking up new libraries or even parts of the standard library?
- 0:12Documentation plays an important role there.
- 0:15And the tools in the Python space for building solid documentation and even publishing articles and books involving live code are huge assets.
- 0:24In this episode, we have Paul Everitt, Radian Gedem, Chris Holdgraff, and Chris Saywell to update us on Sphinx, Mist Parser, Executable Books, Jupyter Book, Sphinx Themes, and much more.
- 0:35This is Sock Python under me, episode 354, recorded January 19th, 2022.
- 0:40Welcome to Talk Python under me, a weekly podcast on Python.
- 0:57This is your host, Michael Kennedy.
- 0:59Follow me on Twitter where I'm @mkennedy and keep up with the show and listen to past episodes at talkpython.fm.
- 1:04And follow the show on Twitter via at Talk Python.
- 1:08We've started streaming most of our episodes live on YouTube.
- 1:12Subscribe to our YouTube channel over at talkpython.fm/youtube to get notified about upcoming shows and be part of that episode.
- 1:19This episode is brought to you by SignalWire and Tonic.ai.
- 1:23Please check out what they're offering during their segments.
- 1:26It really helps support the show.
- 1:27Transcripts for this and all of our episodes are brought to you by Assembly.ai.
- 1:32Do you need a great automatic speech-to-text API?
- 1:34Get human-level accuracy in just a few lines of code.
- 1:37Visit talkpython.fm/Assembly.ai.
- 1:40Pradyan, Paul, Chris H., and Chris S., welcome to Talk Python To Me.
- 1:46It's great to have you all here.
- 1:47Good to be here.
- 1:47Thanks for doing this, Michael.
- 1:48Nice to be here.
- 1:49Thank you.
- 1:50Yeah, absolutely.
- 1:50Happy to be doing it.
- 1:52I think talking about documentation and all the static site stuff and book generation stuff that we're going to talk about is going to be super fun.
- 2:01You all are at the center of various fulcrums of that throughout the ecosystem.
- 2:07So it's great to have you here.
- 2:09Great to be talking about that stuff.
- 2:10So let's just start really quick with a quick introduction and then what you're up to these days.
- 2:16Paul, you're a regular here, so you want to go first?
- 2:19Sure.
- 2:20I'm Paul Everitt.
- 2:21I'm a JetBrains developer advocate.
- 2:22Big fan of the show.
- 2:24Big fan.
- 2:25Total fanboy of the other three people here.
- 2:29I've got all kinds of stories about where I was when I found out about Myst and the parser and desperately wishing I could join Pradyen and all the things that he's doing.
- 2:40And I will add big, big fan of Carol Willing.
- 2:44And when I grew up, I want to be Carol Willing.
- 2:46And you're still at JetBrains?
- 2:49Still at JetBrains.
- 2:50Right on.
- 2:50Keeping the PyCharm flowing.
- 2:52Right on.
- 2:53Pradyen, how about you?
- 2:54I work at Bloomberg, although not what I'm going to talk about today is related to work.
- 2:59Software engineer there.
- 3:00Work on the bathroom infrastructure team.
- 3:02I am a maintainer on pip.
- 3:05I have written a Sphinx team for two, depending on how you count the second one.
- 3:10And I'm involved in a bunch of sort of various efforts around Sphinx at this point.
- 3:17I've sort of made myself comfortable in these spaces and sort of made my way into the various discussion forums, I guess.
- 3:25Yeah.
- 3:25Fantastic.
- 3:26With me, I guess, in this topic.
- 3:28Awesome.
- 3:29Well, welcome.
- 3:29You seem to be the emergency maintainer of many open source projects, like Live Reload.
- 3:34Yeah.
- 3:36I have a mild issue of not knowing when to stop.
- 3:40That's good.
- 3:41All right.
- 3:41Chris H.
- 3:42Yeah.
- 3:42So my name is Chris Holgraf.
- 3:44I'm the director of the International Interactive Computing Collaboration, or 2i2c, which is a nonprofit that runs cloud infrastructure for interactive computing and the Jupyter ecosystem and the sort of surrounding ecosystem alongside of it.
- 3:57I'm a little bit of a lot of research and the Jupyter ecosystem.
- 4:02I'm a little bit of a lot of the Jupyter ecosystem.
- 4:03I've worked a lot on Jupyter Hub, which serves multiple Jupyter sessions via some kind of centralized cloud infrastructure.
- 4:08I also work a lot on the Binder project, which focuses on more scientific reproducibility and shareable computing environments in a kind of cloud agnostic and pretty flexible manner.
- 4:20Yeah, that's fantastic.
- 4:20For people who don't know about Binder, that's basically if you are at a GitHub repo or some published notebook that's not interactive, you can click that and it'll fire up a little environment where you can go and explore the notebook for real, right?
- 4:33Yeah, exactly.
- 4:33And so a lot of these things are kind of surrounding this general topic of like scientific communication, scientific reproducibility, bringing those kind of like data workflows and facilitating them with software development, which is related to a lot of the stuff we're talking about today as well.
- 4:48Yeah, fantastic.
- 4:48You also have worked on the MIST project, right?
- 4:51Yes, yeah.
- 4:51And one of the projects that I'm focusing on right now, along with Chris S and a few other collaborators, is called the Executable Books Project.
- 4:58And this is basically an attempt at improving the state of open source kind of community-driven tools in the Python ecosystem around scientific communication and building a lot on top of the Sphinx ecosystem, because there's a lot of good material there to work with and a lot of improvements that can be made that'll benefit the broader Python community as well.
- 5:18Yeah, yeah, very cool.
- 5:19Looking forward to talking about Jupyter Book as well.
- 5:21That'll be fun.
- 5:22Chris Siewel, you're back.
- 5:24Tell us about yourself.
- 5:25Yeah, so I work in the Executable Books.
- 5:28I guess essentially my kind of focus is on making the best tools for scientists to make open reproducible science.
- 5:37So I work 50% of the time here in Switzerland at EPFL on a package called ADA, which is a Python workflow engine for running simulations, orchestrating simulations.
- 5:50And then I work the other 50% of the time in executable books on Mist and Jupyter Book.
- 5:55Yeah, that's really fantastic.
- 5:56Is any of your work in Switzerland, does it have to do with CERN or other projects?
- 6:01No, not to do with CERN.
- 6:02It's an EPFL in a group on materials discovery.
- 6:07Yeah, fantastic.
- 6:08Let's start by talking about Sphinx.
- 6:12So when I think about Sphinx, I think about Python documentation.
- 6:17So who wants to sort of set the stage for Sphinx?
- 6:21I mean, I guess it does say the Python documentation generator, but it does more than that as well if you wanted to.
- 6:27So guys, what is Sphinx?
- 6:28When do I use this?
- 6:30What's its value?
- 6:30It's been around for a long time.
- 6:31I know that much.
- 6:32Let's do a round table.
- 6:33I'd love to hear everyone's elevator pitch.
- 6:36Yeah, exactly.
- 6:37What's the elevator pitch for Sphinx?
- 6:38I can start with sort of how I got into Sphinx and then maybe how I use Sphinx now, which is a little bit different from how I initially used it.
- 6:45I think that a lot of people, so Sphinx has been around for a really long time and it's a really powerful tool for documentation.
- 6:50And a lot of people use it alongside of their software projects that they work on.
- 6:55So my first introduction to Sphinx was via, it was actually a neuroscience analytics package called MNE Python.
- 7:01And we needed documentation to describe, you know, the APIs and the functions and the classes and things like use cases and examples.
- 7:08And so one of the really useful things about Sphinx is that it has an inherent extensibility and a lot of flexibility so that you can both generate like narrative documentation with it, but also include programmatically generated documentation, API documentation, and that kind of thing.
- 7:23So it lets you kind of like more seamlessly merge together code documentation or documentation embedded within code and your more kind of traditional narrative examples, tutorials, that kind of a thing.
- 7:35I see. Almost like a wiki plus an API documentation generator in one.
- 7:41Yeah. Plus that's been around for a long time and with an inherent extensibility.
- 7:45So a lot of different sub communities have kind of built out their own community specific documentation that builds on top of the kind of basic Sphinx building blocks.
- 7:54Sure. I bet the scientific community has got a lot of specializations.
- 7:58They're like, we need to be able to express stuff like this, right?
- 8:00Well, so that kind of gets me to the second part of what I was going to describe, which is I think over time, and this is one of the inspirations behind Jupyter book to some degree, is the realization that like technical and API documentation is also really useful.
- 8:16Well, I should say the things you need to build for really good technical and API documentation are really useful for other kinds of use cases as well.
- 8:23And so I saw some other groups in the scientific ecosystem.
- 8:27There's a really interesting one called Simpeg, which I think is just S-I-M-P-E-G dot X-Y-Z.
- 8:32I'm pretty sure that's what it is.
- 8:33And they basically built out a whole geospatial analytics tutorial and sort of documentation resource just built on Sphinx.
- 8:41And so for me, seeing that, it kind of unlocked an aha moment in my head to realize that you could also use the same documentation engine for documenting lots of other things, not just software packages and things like that.
- 8:54Technical documentation is quite generic and overlaps quite a lot with like scientific documentation and scholarly documentation.
- 9:02And so that's the space that we've been exploring over the last couple of months and years.
- 9:06Yeah, fantastic.
- 9:07And a lot of the outputs are super flexible.
- 9:08It outputs HTML, which you might host on somewhere like Read the Docs or Netlify, but also LaTeX, which is really important for publications and EPUB for eBooks and whatnot.
- 9:20So pretty cool.
- 9:20I think Sphinx is documentation generated written in Python, primarily intended for technical documentation with the ability to sort of intertwine narrative documentation with auto-generated documentation that picks up things from your code.
- 9:36Right.
- 9:36Yeah.
- 9:37And this whole thing is combined with the ability to have a variety of output formats, as well as a variety of extension points within the tooling to extend basically every aspect of building that documentation.
- 9:54Interesting.
- 9:54Yeah.
- 9:55So for example, testing the code snippets that you might have in your documentation.
- 9:58Yes.
- 9:59Or doc strings or something like that, maybe.
- 10:01Yep.
- 10:02So that is doc test and that's baked into Sphinx and Python's documentation, which happens to also be written in Sphinx.
- 10:09Okay.
- 10:10Interesting.
- 10:10By Sphinx.
- 10:11So there's a lot of capability and power hidden underneath the shell of Sphinx.
- 10:17And as Chris was mentioning, there's really extensive customizability here that you can then take and specialize it to your specific use case.
- 10:27And that's sort of both the power and, you know, there's a con to that, which is, hey, you got to maintain this and you got to keep this functioning and stuff.
- 10:37But yeah, it's a really powerful documentation generation tool that is perhaps a little too powerful for its own good.
- 10:44Very good.
- 10:47Very good.
- 10:48Yeah.
- 10:48So docs.python.org is generated by Sphinx, huh?
- 10:52Yes.
- 10:52Fantastic.
- 10:53All right, Chris.
- 10:54Yeah.
- 10:54I think the other point that I wanted to touch in is one of the brilliant points there on the Sphinx site is the cross-referencing capability is just second to none.
- 11:05You know, you can reference inner page, you can reference cross-page within your own documentation.
- 11:10But also, and one of the things that's really helped to build on Sphinx is the Read the Docs community and the work they're doing so that you can reference any other site that's built on Read the Docs as well in a really nice way.
- 11:25Yeah, that's something that really surprised me when I learned about Sphinx is, you know, give a quick shout out to Paul.
- 11:32Paul wrote a course that we hosted over on Talk Python, generating static sites with Sphinx and Markdown, which is really, really cool.
- 11:39And one of the things that surprised me is when I think about creating multiple pages.
- 11:44So, for example, if I'm on GitHub and I want to have this part of some read me here, point to some other read me or some other Markdown, I just go in there, I type, you know, here's the relative path over to that thing.
- 11:55And I come up with the text that goes there.
- 11:57Sphinx allows you to have kind of an index into all the sub elements of the page, not just the pages, but like parts of the pages, you know, headers and whatnot.
- 12:07And you can link to them by name, right?
- 12:11And so if for some reason you change the title of a header, your A tag text that you are linking to will change, which is pretty awesome, right?
- 12:18Exactly.
- 12:19Yeah.
- 12:19And also, enter Sphinx, right?
- 12:23Which is a way to expose those endpoints, not those endpoints, those index points across domain or across project, right?
- 12:33So I could reference to something on Python in my documentation, specifically by a reference point, not by URL, which is pretty excellent.
- 12:41And I think that's a big part of why Sphinx is as adopted as it is, by the fact that interSphinx exists and the fact that you can very easily cross-reference bits in other parts of the ecosystem, as long as that part of the ecosystem is in Sphinx.
- 12:58Yeah.
- 12:58As the interSphinx file generators, right?
- 13:00Like in theory, other ecosystems could, or other tooling could generate it as well.
- 13:05But yeah, I think that is quite capable if the fact that it's in restructured text has some fun interactions with all the linking syntaxes that exist, but it's genuinely very powerful, as I said.
- 13:21Yeah.
- 13:21So let's talk about that for a little bit, because when I thought about Sphinx originally, I always thought about restructured text.
- 13:29And restructured text is kind of funky.
- 13:32I don't know.
- 13:32I just have a hard time getting used to it.
- 13:34But all those formats and whatnot, it takes some getting used to, right?
- 13:38You've got, let me see if I can find an example we can pull up here.
- 13:41You know, things like dot, dot, image, colon, colon, some other thing.
- 13:45And then, you know, sort of almost like a YAML style.
- 13:47And to me, when I'm writing, I feel like, wow, I would just much rather write Markdown and just blaze through this and write it nice and clean.
- 13:56And I'm willing to give up a little formatting or something to allow me to live in a simpler world that doesn't require so much stuff.
- 14:04So traditionally, restructured text has been the way of the documentation through Sphinx.
- 14:10It's also been like the way that you put your information on PyPI and describe it there, right?
- 14:17But the PyPI.org version moved over to at least support Markdown.
- 14:21And through some of the work you all are doing, Sphinx now has an integration layer with doing everything in Markdown as well, right?
- 14:29You want to talk about that maybe?
- 14:30Yeah, I think so.
- 14:31As Preza mentioned, Sphinx is just incredibly powerful.
- 14:36But it's trying to harness that power and make it not overwhelming to non-technical users.
- 14:45For people who want it, it's brilliant and you can do everything under the sun.
- 14:49But trying to sell it to the masses, as it were, and trying to make it as easy to use as possible for simple use cases.
- 14:58But then having that extensibility there is, I guess, kind of what we've been looking at in executive books.
- 15:05And with this, with the Markdown, most everyone now knows about Markdown, Common Mark, how to write.
- 15:13Right.
- 15:13We've got GitHub and Stack Overflow have basically forced the software development community to understand it, right?
- 15:19Exactly.
- 15:21Or whether people love it or hate it, it's there and you know it.
- 15:25So being able to just copy and paste things from GitHub or Stack Overflow or just write something that's quite intuitive to write.
- 15:35That's what we're really trying to hide some of the intricacies of Sphinx.
- 15:41Make it more user-friendly on the front.
- 15:44This portion of Talk Python To Me is brought to you by SignalWire.
- 15:49Let's kick this off with a question.
- 15:51Do you need to add multi-party video calls to your website or app?
- 15:54I'm talking about live video conference rooms that host 500 active participants, run in the browser and work within your existing stack, and even support 1080p without devouring the bandwidth and CPU on your users' devices.
- 16:07SignalWire offers the APIs, the SDKs, and edge networks around the world for building the realest of real-time voice and video communication apps with less than 50 milliseconds of latency.
- 16:17Their core products use WebSockets to deliver 300% lower latency than APIs built on REST, making them ideal for apps where every millisecond of responsiveness makes a difference.
- 16:28Now, you may wonder how they get 500 active participants in a browser-based app.
- 16:32Most current approaches use a limited but more economical approach called SFU, or Selective Forwarding Units, which leaves the work of mixing and decoding all those video and audio streams of every participant to each user's device.
- 16:44Browser-based apps built on SFU struggle to support more than 20 interactive participants.
- 16:50So SignalWire mixes all the video and audio feeds on the server and distributes a single unified stream back to every participant.
- 16:57So you can build things like live streaming fitness studios where instructors demonstrate every move from multiple angles,
- 17:03or even live shopping apps that highlight the charisma of the presenter and the charisma of the products they're pitching at the same time.
- 17:10SignalWire comes from the team behind FreeSwitch, the open-source telecom infrastructure toolkit used by Amazon, Zoom, and tens of thousands of more to build mass-scale telecom products.
- 17:20So sign up for your free account at talkpython.fm/signalwire, and be sure to mention Talk Python To Me to receive an extra 5,000 video minutes.
- 17:29That's talkpython.fm/signalwire, and mention Talk Python To Me for all those credits.
- 17:35What do you guys got to add to this restructured text markdown duality here?
- 17:40I think it's an interesting duality.
- 17:42And I missed my...
- 17:45I don't know how to say this.
- 17:46I find this...
- 17:48When I first discovered this, I was really fascinated because I was like, hey, this looks cool.
- 17:53This looks like a really good...
- 17:56I found it especially amusing to see how mist...
- 18:00Let's pick one phrasing.
- 18:01Yeah.
- 18:02I guess.
- 18:03I really liked how mist ends up reconciling the complexity or power, depending on how you look at it.
- 18:09Yeah.
- 18:09Sphinx, and sort of fitting that into markdown and not...
- 18:14And having it still look like it belongs there, right?
- 18:17Because there's a whole bunch of, well, directives, roles, or whatever you want to call them,
- 18:22that, well, you can use to manipulate the text and include things and have those extensible points.
- 18:29Right.
- 18:29Because markdown is not nearly sophisticated enough to handle things like interest Sphinx and
- 18:35these other types of constructs that's in Sphinx, right?
- 18:38Yes.
- 18:38So, like, one example of this would be the ability to have the cards that you're showing
- 18:44on the screen at the moment, right?
- 18:45Like, the closest thing you could do for that in markdown would probably be embed a bunch
- 18:51of HTML.
- 18:52Yeah.
- 18:52Yeah.
- 18:53That or tables when you get basically no styling there.
- 18:55Like, it's not cards.
- 18:57It's all jammed together in a table.
- 18:59But yeah.
- 18:59And even when you have the ability to have inline sort of markup of markup that's in the
- 19:07same line as the paragraph that you're writing in, you have a very limited set of those, right?
- 19:11Like bold italics, underlines, maybe strikes if the platform you're using supports it and
- 19:18stuff like that.
- 19:19But with MIS or restructured text or whatever, you have a lot more capability there.
- 19:24Yeah.
- 19:24You in part to Sphinx, you in part to DockerDills, which is what implements the restructured text.
- 19:29On this particular point of the power expressing itself into markdown, I've enjoyed watching Chris
- 19:37and Chris over the years iterate through this.
- 19:40Roll some things out.
- 19:42Realize, wait, you know, it's better in tooling if we do a triple colon instead of a triple
- 19:48back tick because the body of the directive can then be rendered by some inline viewer or
- 19:55something.
- 19:55So I'd be interested in hearing Chris and Chris talk a little bit about your like voyage of
- 20:00discovery for, you know, what's the gestalt of markdown?
- 20:04Yeah, it's interesting.
- 20:05So obviously with, well, with, with Jupyter's book and things we're very much focused on
- 20:11it, you know, in, in these, in Jupyter's notebooks, you have the markdown set, everything, Chris
- 20:16and markdown.
- 20:16And that historically has a single kind of renderer that renders things.
- 20:22So trying to harness the simplicity of markdown, they're trying to make it look nice as you're
- 20:30writing with that.
- 20:31It doesn't look like a complete mess within these markdown cells.
- 20:35Whilst still having the capabilities of like a restructured text has been an interesting
- 20:41challenge.
- 20:42So obviously we had this, we wanted to make the mark, the missed format kind of degradable
- 20:51to common mark so that it can be passed normally as with a normal markdown parser, although it
- 20:57wouldn't know what to do with things like notes and all of the other, these other directives
- 21:02and roles that you, that you can have within the Sphinx.
- 21:05But at the same time, yeah, have all the capabilities.
- 21:08So, it's a hard balancing act, I'd say.
- 21:12I'm trying to just say, here's all of these roles and directives.
- 21:16You don't want to spoil the simplicity of markdown though, right?
- 21:19Yeah, exactly.
- 21:20It's having the readability of source text, essentially, weighing that against the flexibility of actually
- 21:27making these lovely HTML pages.
- 21:30Right, exactly.
- 21:31Chris H., you want to add something to that?
- 21:32Yeah, I mean, I think that the interesting thing about markdown and probably something that we should clarify for some of the people here is that there is no one markdown.
- 21:40Yes.
- 21:41That surprised me, actually.
- 21:42I didn't realize that.
- 21:43Yeah.
- 21:43I mean, there's like, you know markdown when you see it, but there is no like canonical markdown.
- 21:48The closest thing to a standard that exists is common markdown, which is like an attempt at standardization across a few different communities.
- 21:55But over the years, what we've seen, whether it's, you know, Stack Overflow or GitHub or whatever, basically, people want to extend common mark in a couple of ways.
- 22:03So they added a new couple of syntax features to support and they have then created a new flavor of markdown.
- 22:10So people often talk about markdown in terms of flavors, like what functionality do you want to turn on?
- 22:14What functionality do you want to turn off?
- 22:16And there are a couple of nice like renderers and parsers.
- 22:19And for example, the JavaScript world that will let you, you know, enable extensions in markdown to turn on and off different kinds of syntax.
- 22:26And so what's interesting about mist is that it's kind of intentionally trying to create like a privileged extension point, either for block level writing or for inline writing.
- 22:37In part with the goal that you don't have to create a new flavor of markdown if you want to extend markdown's functionality in a new direction.
- 22:44And I think it's going to create an interesting question of, okay, you've created a new extension point,
- 22:50but you want to have some kind of reliability or knowledge that your document is going to behave the same in one implementation of a mist renderer or a mist parser versus another implementation.
- 23:02So there's an extra sort of interesting standards question of, okay, if a directive is infinitely extensible, right?
- 23:09It's basically like a Python function, but in markdown.
- 23:12Is there some like minimal subset of directives that you want to support as a part of core mist so that if it's a mist parser for Sphinx or a mist parser for, you know, an HTML website or for some other documentation engine, you know that they'll behave similarly.
- 23:27That is a big challenge.
- 23:28A quick question from the audience.
- 23:30Ryan asked, does GitHub use their own version or do they use common mark?
- 23:34They use GitHub flavored markdown.
- 23:37GF.
- 23:38Which is a superset of common mark?
- 23:42Yes.
- 23:42It is indeed.
- 23:43Yes.
- 23:44It's got, it now has, I mean, I think if you Google it, I guess, GitHub flavored markdown, it has its own specification, which is built on top of the common mark specification.
- 23:54The title is different as well.
- 23:58Yeah.
- 23:59Yeah.
- 24:00And it adds a few extensions, a few slightly different things like tables.
- 24:05Right.
- 24:05Exactly.
- 24:06Funnily enough, it's not in common mark, which is quite a basic thing, but that is not in common mark.
- 24:12That's only GitHub flavored mark.
- 24:13Yeah.
- 24:14Yeah.
- 24:14Yeah.
- 24:14Interesting.
- 24:15It was avoiding the politics of what it got to get it to where it got.
- 24:19There was a decent amount of, oh, this has to be maximally compliant.
- 24:24Like this has to be the thing that works everywhere.
- 24:27Yeah.
- 24:28The minimum functionality, the maximum reach sort of story, right?
- 24:31Yeah.
- 24:32And they sort of went, okay, what words basically everywhere?
- 24:36And that's sort of what ended up becoming some mark.
- 24:39So any effort to like, oh, how about we extend this has sort of not gone very well so far.
- 24:46Sure.
- 24:47So I do want to give a quick shout out to this app I came across recently called Typora for writing markdown.
- 24:53And one of the things I think is interesting, the reason I bring it up is it has the standard markdown stuff, but it also has like inline bits for like mathematics and other stuff like diagrams and whatnot.
- 25:05And this is the kind of stuff you're talking about, Chris, right, where you want to take the core, but there's ways to extend it in Myst, right?
- 25:13Yeah.
- 25:14I mean, that's the beauty of Python, right?
- 25:16Or a lot of languages where you can define functions is that you can show a lot more creativity and add extra functionality in a very intentional, structured way, right?
- 25:25So that it's easier for you to replicate other people's work and build on top of it and things like that.
- 25:30And so in some ways, that's how I think about directives and roles is it's like bringing functions, but into a realm where you're dealing with like human written text or code that is like interpreted.
- 25:40But inside of, you know, these little directives and things like that, which just opens up a lot of extra room for creativity and trying out different kinds of things.
- 25:48I guess because we're going to mention this a bunch in sort of Sphinx glossary or terminology, directives are essentially a block of text that you're all saying.
- 25:59It also has this characteristic associated with it.
- 26:02Like, hey, present within like a notebook or whatever, whereas a role would probably be something in line.
- 26:09Hey, make this bold.
- 26:10Hey, this is actually a link to another thing and stuff like that.
- 26:14In case folks who are listening aren't familiar, this would probably be helpful.
- 26:19Although I wish we had said this sooner.
- 26:23And if you're coming from the front end world, I'm a kind of a refugee from Gatsby in which Markdown is almost like a database format, a lot of structure.
- 26:34But when it comes to Markdown and extension points and things like that, oh my God, the monkey business they jump through to try and get information from the document to the extension point or whatever.
- 26:52And they all have to invent their own little mechanism for packing stuff into the space after the code fence invocation.
- 27:01It's just clearly obvious that they need something like what Myst has done, which is a consistent syntax that just hands things over to restructured text directives.
- 27:13I think what's interesting about, you know, Spanx and DocuTools is that intermediate document model that exists, which I think is something that differentiates it from a lot of other like Markdown parsers and renders that are out there.
- 27:26I think a lot of the like a lot of static website generators, they're effectively going from blobs of Markdown mapped onto blobs of HTML as a sort of like heuristic, like it's a very programmatic output kind of a thing.
- 27:39And actually the original version of Jupyterbook, maybe like two and a half years old now, it was a wrapper around Jekyll, the Jekyll website generator.
- 27:47But because Jekyll was fundamentally just doing, you know, blobs of Markdown to blobs of HTML, there wasn't that intermediate rich document representation where you can do things like resolve cross-references and collect, you know, bibliographic entries and collect, you know, equation and figure labels so that you can refer to them elsewhere.
- 28:08And once you add that extra model in, it gives you a lot of extra, I think that's where a lot of that extra like power and complexity comes from in the Sphinx ecosystem.
- 28:18And so in some ways Markdown, Miss Markdown is just like a, it's almost like a front end on a user side.
- 28:24It's just giving you, at least in my opinion, a more user-friendly entry point into the Sphinx ecosystem.
- 28:31Now, most times you just want to write straight Markdown, but every now and then you need something like one of these references over to another part of the site or you need more control.
- 28:40And so Miss has this ability to say, kind of like run some inline restructured text here, right?
- 28:46That as well as the ability to just hook into the thing that restructured text would, right?
- 28:53So that will be the directive.
- 28:54So you can embed restructured text inline, but that's usually not what you need to do or want to do.
- 29:01Usually you're just able to directly use the thing that you wanted to use.
- 29:05So yeah, there you go.
- 29:06Okay.
- 29:06So you would go and hook in and write some Python code to process one of these directives.
- 29:11That's pretty excellent.
- 29:12Yeah.
- 29:12And a bunch of these directives exist already in, well, Sphinx essentially.
- 29:17And you can just reuse them as you would in restructured text in Mist, except with a slightly different syntax because you're operating in a different model of language, you know?
- 29:29Sure.
- 29:30Yeah, exactly.
- 29:30So the terminology they use is interpreted text.
- 29:33So it's just a block of text and here's the name of the class function that is going to interpret this.
- 29:41And here's maybe some options to help you interpret it.
- 29:46And then you can do what you want to do.
- 29:47Nice.
- 29:48So does Mist come with a bunch of these extensions already that you can use for maybe scientific graphs or things like that that you can pull in?
- 29:58Or where do I find more of these if I don't want to write them myself?
- 30:01So one of the goals of the Jupyter book project is trying to bring in functionality from the Jupyter ecosystem around interactive computational document models like IPyND, Jupyter notebook files.
- 30:13And also kernels that can run arbitrary, you know, usually data centric code for visualizations and analysis and things like that, where those code will generate outputs like, you know, PNG images or HTML, you know, interactive visualizations or, you know, tables with statistical analyses in them and that sort of stuff.
- 30:32And so one of the goals of the executable books is also to build sort of entry points for the Jupyter ecosystem into Sphinx and into Mist Markdown.
- 30:44So you can kind of get the complexity of the PyData ecosystem or the Jupyter ecosystem, but with the ability to embed that into, you know, a documentation narrative structure as well.
- 30:58So I think that that's where a lot of the scientific use cases come from is like using scientific code that gets executed alongside of your documentation build in a programmatic fashion.
- 31:08And where those outputs of the code are then inserted into your document in a way that from a reader's perspective, looks like it's just part of the, you know, narrative flow of everything else that was there.
- 31:19This portion of Talk By The Nome is brought to you by Tonic.ai.
- 31:25Creating quality test data for developers is a complex, never-ending chore that eats in the valuable engineering resources.
- 31:32Random data doesn't do it.
- 31:34And production data is not safe or legal for developers to use.
- 31:38What if you could mimic your entire production database to create a realistic data set with zero sensitive data?
- 31:45Tonic.ai does exactly that.
- 31:48With Tonic, you can generate fake data that looks, acts, and behaves like production data because it's made from production data.
- 31:56Using their universal data connectors and a flexible API, Tonic integrates seamlessly into your existing pipelines
- 32:03and allows you to shape and size your data to scale, realism, and degree of privacy that you need.
- 32:08Their platform offers advanced subsetting, secure de-identification, and ML-driven data synthesis
- 32:15to create targeted test data for all your pre-production environments.
- 32:20Your newly mimicked data sets are safe to share with developers, QA, data scientists, and, heck, even distributed teams around the world.
- 32:28Shorten development cycles, eliminate the need for cumbersome data pipeline work, and mathematically guarantee the privacy of your data with Tonic AI.
- 32:37Check out their service right now at talkpython.fm/tonic, or just click the link in your podcast player's show notes.
- 32:44Be sure to use our link, talkpython.fm/tonic, so they know you heard about them from us.
- 32:50Maybe tell people a bit about the Jupyterbook project itself.
- 32:56It's an open source project for building beautiful publication quality books and documentation.
- 33:01As you said, from sort of taking the code in the notebook and generating the output, like some of the graphs and whatnot, in a live way.
- 33:08But it sounds fascinating.
- 33:10Maybe when would I use it?
- 33:12Tell people a bit about that.
- 33:13Yeah, I mean, I think of the simplest, I mean, from a technical standpoint, since we're kind of riffing off of Sphinx, Jupyterbook is a distribution of Sphinx.
- 33:20It's basically a collection of pre-configured Sphinx extensions, some of which are developed by the executable books team and community, others of which have been developed by the broader Sphinx community and that are just reused and contributed upstream to by people in executive books.
- 33:37And those extensions have been created by the other way.
- 33:43So things like Sphinx Contrib Bib Tech is a bibliography and citation extension in Sphinx.
- 33:51And that's activated automatically with Jupyterbook.
- 33:54Right on.
- 33:54Because of course you're going to need that.
- 33:56And you want something like Evernote that's going to pull from some source that's always like I always quote this article or something, right?
- 34:02Yeah.
- 34:02I mean, just it's a use case that's not built into core Sphinx, like having references and citations and bibliographies.
- 34:07And so it pulls that workflow into Sphinx via an extension.
- 34:11So Jupyterbook is kind of a collection of these extensions and then wrapped in a command line interface and a configuration structure that's a little bit more user-friendly.
- 34:20I think that's one of the things about Sphinx is that at least historically it has tended to be both developed by and catered to the developer community, which is a little bit different from the scientific community.
- 34:31A lot of scientists know just enough code to be dangerous with, myself included, and are often not as familiar with traditional software development workflows.
- 34:40And so things like, you know, Jupyterbook is configurable with a YAML file rather than with, in Sphinx, the default configuration is with a Confident.
- 34:48Oh, interesting.
- 34:49It's like a Python file directly.
- 34:50So a little quality of life improvements to make it a little bit easier for people to get started with this more opinionated distribution of Sphinx.
- 34:58Yeah, it sounds like a fan.
- 34:59Is what Jupyterbook is called out.
- 35:00Oh, yeah.
- 35:00What a fascinating resource for people.
- 35:02And I meant EndNote, not Evernote.
- 35:04Sorry.
- 35:04That's the one you use for references.
- 35:07There's some good questions in the audience I want to ask you all.
- 35:09But before we do, I want to ask about MIS just a little bit more.
- 35:13So MIS looks really interesting and it looks like it allows me to do much more, many more powerful things with Markdown than just straight Markdown.
- 35:22Right now for when I'm in my code, like say on the website, it might have to take some Markdown content and turn it into a page or something.
- 35:30I'm just using something like Markdown 2 or one of the arbitrary just Markdown parsers.
- 35:36Does this make sense as something to run live in your application rather than a publication generation story?
- 35:45Like would it make sense to replace just using that one function from that library and then allow me to write like directives that do more for the site, for example?
- 35:53Not exactly sure what you're asking.
- 35:54I think what Michael wants is the layer under MIS.
- 35:57There is a parser inspired by, I guess, the JavaScript parser written by Chris and Chris.
- 36:05It was actually the way I found MIS when I was looking at MIS tune and Mistletoe.
- 36:10And so, yes, there's a wonderful parser that lets you hand it strings and you get back Markdown.
- 36:17Yeah.
- 36:17You hand it Markdown and you get HTML, you mean?
- 36:19Sorry.
- 36:20Yeah.
- 36:20You hand it strings and Markdown and you get HTML.
- 36:22Sorry.
- 36:22Yes.
- 36:22Yeah.
- 36:23That's what I want.
- 36:23Yeah.
- 36:24Yeah.
- 36:24Exactly.
- 36:24What I want is a nice way to have richer Markdown, like in an application, in production, not just as, you know, something that I run, like a build process, I guess.
- 36:35So there's a bunch of, I guess, parsers from MIS.
- 36:39There's an implementation in Python.
- 36:41There's an implementation in JavaScript.
- 36:42If.
- 36:43Yep.
- 36:44Work in progress.
- 36:45So I take that as a yes.
- 36:47There's multiple implementations of that and you can integrate that into an application if you wanted to.
- 36:52So I think this is where we're working on this kind of MIS specification of what would be core MIS as in what can we parse, not just in Sphinx, but with other kinds of parsers.
- 37:05And then you say embedded into applications.
- 37:07So one of the things we've been working on say is this JavaScript application.
- 37:13And one of the nice things, firstly, about how we parse, how we use MIS with Sphinx in the Python world is that it uses Markdown at Py, which is a Python implementation of Markdown it, which is a JavaScript.
- 37:27That is a JavaScript package passing Markdown.
- 37:32So we use on both sides in Python and in JavaScript, we can use exactly the same, essentially exactly the same code, passing exactly the same.
- 37:40So then we're working on this Markdown at Dr.
- 37:42Teels in JavaScript to see if we can bring.
- 37:46There's much of the functionality, probably not all the functionality of Sphinx in also the JavaScript world, where obviously that's what you need if you want to be able to do anything kind of live without a backend.
- 37:59Right.
- 37:59Runtime.
- 38:00Yeah.
- 38:00Okay.
- 38:01Exciting to hear you all are working on it.
- 38:02All right.
- 38:03Let's bring this maybe back to the documentation side.
- 38:05Right now, the audience asks, could we describe the whole process that a MIS document goes through before it becomes an HTML document?
- 38:14Like what happens to my inputs to get either the HTML or the EPUB or whatever I get?
- 38:20Essentially, so you have your Markdown text file.
- 38:23Markdown, we then parse it, as I just mentioned, with Markdown at Py, which turns it into a bunch of syntax tokens.
- 38:32And then we take them tokens and we convert them into the Docutils-ask syntax tree, which is what Sphinx works with.
- 38:43And then as we're converting that into the Docutils-ask, Sphinx works with, we're running all of these directives and these roles, this interpreted text against all of the functions, the extensions that have been loaded within Sphinx.
- 39:01And we end up with this nice syntax tree, Python thing, nodes, and then we say to Sphinx, there you go.
- 39:11Take it away.
- 39:13Right.
- 39:13Traditionally, Sphinx has gone through some sort of restructured text process to generate that.
- 39:18And you're like, we're going to generate that and give it to you in a different way.
- 39:20Now just do what you do to generate your documentation, right?
- 39:23Exactly.
- 39:23So once you've passed it through this MISTS, or you've done restructured text, you end up with exactly the same thing.
- 39:31This syntax tree with nodes.
- 39:34And then Sphinx can go through that and that's kind of agnostic to any kind of output format.
- 39:39Yeah.
- 39:39That's just, here's a paragraph and then within that, here's some text and here's a bit of bold and a bit of italical.
- 39:47And looping this back around to what we mentioned at the start of like the power of Sphinx, right?
- 39:53Of the extensibility of it is that the markup format that you're writing with is decoupled from anything else that you do with it.
- 40:02Not the extensions, not the directives that you use, none of that.
- 40:07They're all sort of a separate step from that.
- 40:10And that getting that separation happens through the intermediate documentary or doc tree, which if anyone's worked with Sphinx has probably seen mentions of in the build directory and stuff.
- 40:22So yeah, doc tree sort of acts as that separator.
- 40:25Oh, fantastic.
- 40:26And you go from your input text to your doc tree, then to your output for formats, HTML, latex, et cetera.
- 40:35And on the way, you mess around with all the doc tree to make sure you've got a piece of room to document references and all this kind of thing.
- 40:44Well known fact, if you go to SourceForge and look at DocUtils, you'll see that they, from the very beginning, have anticipated restructured text not being the only format.
- 40:56Restructured text is just one.
- 40:58It happens to be the default parser, but it wasn't intended to be the only parser.
- 41:02Yeah.
- 41:03Wow.
- 41:03A lot of what we've been discussing is things that Sphinx does.
- 41:07Sphinx, for thought of the most part, is really a good rapport around a lot of what DocUtils provides.
- 41:16It's much more friendly package, in my opinion, to interact with.
- 41:22And generally, in some senses, Jupyter Book sort of wraps Sphinx into a nicer package to use.
- 41:30Sphinx does that for DocuTils, right?
- 41:33And it builds upon it to give you additional functionality.
- 41:37It gives you additional points to hook into in the build process that you would still have with DocuTils.
- 41:43It's clearly not doing anything in addition to, like, in the build process, in addition to what DocuTils would.
- 41:51It just gives you a better framework to do that.
- 41:53And a lot of what we've been talking about, apply that intermediate format and stuff.
- 41:57Those are all concepts coming up from DocuTils into Sphinx.
- 42:01Yeah, very interesting.
- 42:02Alvaro out there asks, can we use the AST to translate between markup languages?
- 42:07Something like Pandoc, which is a pretty neat thing.
- 42:09It sounds like that might already work.
- 42:11You've got the different output formats and stuff already, right?
- 42:13Yeah, so an interesting example of this actually is there's a little helper tool that Chris wrote as a part of the Executable Books project called RST to Mist.
- 42:21And essentially, it's a converter if you have a bunch of documentation written in restructured text,
- 42:27and you want to automatically convert it into Mist Markdown.
- 42:31Because Mist Markdown and restructured text have the same, like, fundamental vocabulary,
- 42:34they just have different syntaxes that map onto that, you know, DocuTils doc tree,
- 42:38you can go from one to the other relatively easily.
- 42:42And that's what the RST to Mist package does, is it, you know, it parses RST into these abstract tokens,
- 42:48and then it can render those tokens as Mist Markdown rather than restructured text.
- 42:54And that's because of that sort of intermediate document format that's there.
- 42:57That's very fascinating.
- 42:58It's like this huge library of rules, basically, of how do you go from these abstract tokens into like a million different output formats.
- 43:09And that sort of speaks to the community of the Pandoc world that's been around for quite a long time and is doing a lot of really awesome work there, too.
- 43:15Yeah, indeed.
- 43:16All right, let's bring it back to Sphinx a little bit.
- 43:18I know you all wanted to give a quick shout out to Juan about some of the tutorials that he created, right?
- 43:24Absolutely.
- 43:25So one of the things that Sphinx, as we've been talking about, has, it has a documentation site, right?
- 43:30And it is a documentation generator, but it didn't have a tutorial to get you started.
- 43:36So that's one of the things that Juan worked on recently.
- 43:39And I think a bunch of that work is actually piggybacking off of Read the Docs getting funding from EZI,
- 43:48Trans-Igobab Initiative, as an essential open source software.
- 43:52I think it's under the E-RSS program, but I could be wrong on that.
- 43:56And yeah, he worked on a tutorial for Sphinx that, well, introduces people to Sphinx, essentially,
- 44:03and, well, tells you what your first steps to document your project using Sphinx would be.
- 44:08Yeah, very cool.
- 44:08It sounds certainly useful to have, right?
- 44:12Like the API documentation is not enough to make it feel really great.
- 44:16All right, so the next thing I want to talk a bit about with Sphinx is sort of the look and feel side of things, right?
- 44:25Can I really quickly make a plug, actually?
- 44:27Yeah, yeah, absolutely. Go for it.
- 44:29I think that one of the other reasons that, like Juan, for example,
- 44:32has been contributing some of the improvements to the Sphinx documentation is that, like, Sphinx is pretty old.
- 44:37In the computer science world and technology world, it's like an ancient technology, you know?
- 44:42It's like eight years old or something like that.
- 44:44And I think that one of the...
- 44:45More than that.
- 44:45One of the...
- 44:46Dokudones.
- 44:46Yeah, that's true. That's like the early, early days of Python.
- 44:50So anyway, my point is that I think that the documentation about Sphinx has been around for a long time.
- 44:55But I think that the community's understanding of, like, what makes for good documentation has evolved quite a lot in the last, like, 15 years.
- 45:04There's just more expectations around different kinds of documentation that you expect to find embedded in one place.
- 45:10I put a link in the YouTube comments for a really interesting framework that's been gaining some traction lately called the Dietaxis framework.
- 45:17But this idea that you sort of clearly separate out, like, tutorials and how-to examples and reference documentation and explanations.
- 45:24That's just one example.
- 45:25But I think that, like, there's...
- 45:27The community has sort of evolved and made more complex its own idea of what makes for good documentation.
- 45:33In some ways, faster than a lot of these Python packages that have been around for, like, decades, in some cases, have kept up with that pace.
- 45:41And so I think there's a lot of low-hanging fruit to improve a lot of these aspects by making contributions to Sphinx stocks and other pieces in the ecosystem.
- 45:48Yeah, absolutely.
- 45:49If I can make an addition to your addition.
- 45:50Do.
- 45:51One of the things I think of Sphinx as is I think of it as a miracle.
- 45:54It's an underappreciated miracle.
- 45:57They crank out bug fix updates with long lists of features and bugs fixed and all over and over for year after year.
- 46:08They don't get to go do Greenfield development.
- 46:11They're still stuck in Python 2.3 land or something like that.
- 46:15They've got this main template, which was written back when Mark Andreessen was still in grad school.
- 46:20It's just heroic what they do.
- 46:23Yeah, it's amazing when software continues to live like that, right?
- 46:26It's foundational software through the ecosystem.
- 46:29And yeah, there's very little Greenfield development there.
- 46:34And there's very little sort of exciting work that sort of, it's all complicated problems with lots of complexity to deal.
- 46:41Both terms of compatibility as well.
- 46:44Oh, not having enough visibility into how your users are using things to know for sure if a change will break them.
- 46:52So basically everything is a breaking change.
- 46:55Let's operate with that.
- 46:56And the constraint that brings with it.
- 46:59So yeah.
- 47:00That's a big constraint for sure.
- 47:01Cool.
- 47:02All right.
- 47:02So let's talk about look and feel.
- 47:04So there's the whole idea of Sphinx themes, right?
- 47:09Yeah.
- 47:10How, and maintained by some people we know here?
- 47:14Yes, that is.
- 47:15Yes.
- 47:15That is.
- 47:15That is what I use in the image.
- 47:16Rajan, you want to give a quick shout out to the themes and tell us a bit about it?
- 47:21Sure.
- 47:22So one of the things that Sphinx has, as we've mentioned multiple times, is a bunch of variety of outputs, right?
- 47:28And even within those, even within the HTML output format, you have the ability to change how your output stylized, right?
- 47:37What theme you end up using.
- 47:38This is roughly analogous to, I guess, Jekyll themes or Hugo themes, in that you give it a bunch of templates, maybe a bit of logic, depending on what you're doing.
- 47:47And yeah, it rendered.
- 47:49Sphinx has that.
- 47:51And what's probably on screen at the moment, as we've talked about this, is SphinxThemes.org, which is one of the sites I helped update to be more pretty and more up-to-date and sort of a more curated set of, well, themes for Sphinx that you can and maybe should be using when you move away from the defaults, essentially.
- 48:14As Chris mentioned, Sphinx is fairly old.
- 48:18And when you look at the themes that shift with it, they're better than aesthetic with them.
- 48:24They don't look like they were built last week by someone who has been doing this since not too long.
- 48:33So, yeah.
- 48:34If you ever go to the Wayback Machine and you look at something that is, you know, a popular website from the early days.
- 48:42Yeah, I think it's as a Polish.
- 48:44I don't know.
- 48:45Yeah.
- 48:46It's an amazing experience to just like pull up Google or Yahoo.
- 48:50I mean, to look at something like this and say, yeah, that's one of the biggest companies in the world.
- 48:55Kind of reframe your opinion.
- 49:01But having these themes, I think, is an important aspect.
- 49:04I do think having them look really good is something that, you know, is these are starting to come along, right?
- 49:11Like I think the furrow theme and the book theme look really nice.
- 49:14There's the PyData theme.
- 49:16If you've done Read the Docs, right?
- 49:17Read the Docs is one of the themes that people I'm sure are familiar with.
- 49:20I think for a very long time, the only major good theme or one of the two major good themes was the Read the Docs theme.
- 49:29The other one, Alabaster, which is not the default.
- 49:33Alabaster is not the default.
- 49:34And it's been fairly recent that these new themes have sort of come in and gained major adoption in sort of the timeline of Sphinx, I would say.
- 49:45And I think that's a good thing because, well, I'm personally motivated to do a lot of this, right?
- 49:52I have, like, one of the themes you mentioned is one that I wrote from scratch.
- 49:56And it's been an interesting, fun experience.
- 49:59And I can see why there's not a lot of these.
- 50:02It's tricky, huh?
- 50:05I really would like to give you credit for this.
- 50:07I think Furo is the tipping point, the exemplar that made people rethink what to expect from Sphinx themes.
- 50:16If I was to guess the two reasons people are switching to MkDocs, number one is Markdown.
- 50:21So, Chris and Chris, thank you for that.
- 50:23And number two is it just looks a lot better.
- 50:26Part of the reason Markdown or MkDocs looks really good is because there's one theme that's really good there, MkDocs material.
- 50:35Yeah, the material, yeah.
- 50:36Right.
- 50:36That's all it takes.
- 50:37And I have not.
- 50:39And I've spent a decent amount of time looking as part of research for all of this work that I'm doing.
- 50:44Is there any other major theme there?
- 50:47And there isn't.
- 50:48There's just one.
- 50:49And pretty much most of the ecology there just revolves around that.
- 50:54That isn't to say bad thing.
- 50:56Certainly not.
- 50:57And that isn't to say MkDocs is just that.
- 51:00It's not.
- 51:00Right.
- 51:01But a decent amount of the overlap there is.
- 51:04Well, the overlap there is huge.
- 51:06It is what I would go for.
- 51:07And kudos to Squid Funk, whose name is not coming to my head at the moment for the amount of work he's put into that.
- 51:16Yeah, absolutely.
- 51:16You and Chris are working on the new chapter of this idea, right?
- 51:21Which Chris?
- 51:22Chris H.
- 51:22I believe the two of you are kind of thinking about what if we didn't have to live with the old contract?
- 51:28I think the way you're referring to is some of the infrastructure improvements around developing the Sphinx ecosystem.
- 51:34Is that what you're...
- 51:35No, I was thinking of...
- 51:36I thought there was a theme itself you were working on that kind of threw out the basic theme, which is the predecessor of all themes.
- 51:46And I thought that you had a repo where there was a new theme you were working on.
- 51:50There is.
- 51:50Almost like an abstract theme or something.
- 51:52Yeah.
- 51:53So the way Sphinx's theme ecosystem works is there's a basic theme.
- 51:58And what that basic theme has is like the JavaScript for Sphinx's search and all kinds of like fundamental things for Sphinx.
- 52:07And a very, very, very bare bones HTML structure, essentially.
- 52:12There's, I don't think, any CSS even.
- 52:14Right?
- 52:15So it's just a very bare bones page to just serve as a basic skeleton for you to build upon.
- 52:21Right?
- 52:21And I think through the work that Chris and I have been doing on themes and among...
- 52:29There's more people.
- 52:30And sort of the name escapes me at the moment.
- 52:34And one of the things we found out was, oh, there's like a lot of common work across these themes.
- 52:41That we put into a layer on top of that.
- 52:44And those things there.
- 52:46So that it reduces the amount of duplicated work.
- 52:48It still gives us the bits of flexibility that we want in the individual themes to make opinionated choices, design choices, and whatnot.
- 52:56But there's a decent chunk of, oh, we all will do the same thing.
- 53:00Like breadcrumbs have this HTML structure.
- 53:05Doing things like that will reduce the amount of duplicated effort and lower the barrier for entry, essentially, in your writing.
- 53:12Which is sort of what I'm personally motivated in at the moment, having written one.
- 53:17It's like, oh, this thing goes to my right sort of brain areas.
- 53:23Because I, as I've mentioned, I'm a maintainer on PIB.
- 53:26Developer workflows are a thing that I happen to be interested in.
- 53:30And I would say have a decent amount of experience dealing with.
- 53:35So I was like, hey, this looks like a great place to put in a bunch of my JavaScript, HTML, web tech experience, combined with a bunch of Python packaging and user workflows around that.
- 53:47And sort of put in energy there.
- 53:49So that led Sphinx team builder, which is like...
- 53:53Fantastic.
- 53:53Yeah.
- 53:54Yeah, it's been excellent.
- 53:55I think it's kind of just bringing in that maybe what Sphinx has lacked in the past is that kind of expertise in web design, really.
- 54:02I mean, there's a lot of, you know, excellent people working, as you say, within Sphinx and DocuTools and things on the kind of back end and how all that works and all the Python code.
- 54:13Possibly there's been less so in the past of going, right, let's actually make all this good work and actually show it off and have these just lovely themes that actually show what you can do.
- 54:26It was super fascinating for me because sort of when I jumped in, I was like, oh, recreationally, right?
- 54:31And to be honest, my motivation jumping into the Sphinx ecosystem was precisely this of like, I want it to look better.
- 54:39Like, it doesn't look good.
- 54:41I would like it to look better.
- 54:42And funnily enough, none of this would have happened if pip hadn't gotten a grant where we had a bunch of computer experience experts sit with us and our users and sort of have that channel of feedback through them as well as their expertise.
- 54:58And just having them state multiple times like, hey, pip's documentation is not that great to sort of navigate and stuff.
- 55:05Like, there's content.
- 55:06They don't know how to get there.
- 55:07And sort of in those conversations, I was like, yeah, I don't like this site.
- 55:13Now that you've made me look at it a bunch of times.
- 55:15Let me put something on the screen for you all just to put side by side here.
- 55:19And just think about this.
- 55:21And you all can pull this up really easily who are listening.
- 55:23Just think about this from the perspective of someone who's choosing a programming language or new to programming and deciding, is Python the space for me?
- 55:32You know, if on one hand, we've got, you know, just the docs.python.org and the other, you know, something like Tailwind, where you look at it and it's just like, it just feels, you know, so fresh and welcoming.
- 55:48Whereas the other, this is not to take away from the hard and important work of writing the documentation, but the way it feels when you land there, I think, is in desperate need of the work that you do.
- 55:58Yeah, but Michael, have you seen what it looks like in a man page?
- 56:01I know.
- 56:02It probably is looking the same, right?
- 56:05Those three man pager users are really happy.
- 56:08Pretty close.
- 56:10And that isn't to say those users aren't about to be clear, right?
- 56:14Yeah.
- 56:14I mean, it's kind of like moving from MySpace to Instagram.
- 56:19It is.
- 56:20It is.
- 56:20And like I said, I'm not bashing on it.
- 56:23I'm just saying this is the face that that part of Python is presenting to the world to say, we want you here.
- 56:30Come be with us.
- 56:31Right.
- 56:31And there's a different face that other places are putting on that I think probably will appeal a lot more to people who don't know better.
- 56:39You know, they're getting to write in JavaScript.
- 56:40And this is really an aspect that I would sort of think, I would like to put my energy into this and make these improvements.
- 56:47And I'm by far not the only one.
- 56:50There's, in fact, now a documentation working group being formed in the CPython core development community.
- 56:59The folks who develop the language around improving this.
- 57:03And there's like a public issue driver that hopefully going to sort of start ramping up soon because I would like to be involved with that.
- 57:11And I'm aware that Paul is as well.
- 57:13And yeah, this is by no means news to the folks involved.
- 57:17They're aware of this.
- 57:18And I think the first issue itself in this sort of dogs community issue tracker that they have is moving to a more modern documentation theme.
- 57:28As it turns out, there aren't many in Sphinx.
- 57:31So that's sort of been another thing I've picked up and gone.
- 57:35Yeah.
- 57:35So maybe one more shout out to the Sphinx theme builder that you put together, right?
- 57:39Yeah.
- 57:39Sphinx theme builder comes in nicely into this.
- 57:41So there's a bunch of Sphinx themes today, right?
- 57:44There's Furo.
- 57:45There's Sphinx book theme.
- 57:47There's PyData Sphinx theme.
- 57:48There's Alabaster.
- 57:50There's a bazillion of those.
- 57:51The first three that I mentioned, right, are the folks on this discussion are involved with those.
- 57:58And one of the things that came out of having worked on all of these was it would be nicer to simplify these workflows a bit, make the interaction with JavaScript easier, reduce the amount of bootstrapping required and stuff like that.
- 58:12And that essentially ended up in Sphinx theme builder where it sort of streamlines the JavaScript and Python build processes and sort of makes the development workflow easier.
- 58:22Yeah.
- 58:22It even comes with a development server that does like refresh the browser on change, right?
- 58:27Yes.
- 58:27And I think that's also really nice to have in Sphinx documentation authoring as well.
- 58:32And Paul sort of mentioned this earlier of like me taking up maintainership of too many things.
- 58:38So I went, I like this.
- 58:41And the repository had maintainers needed on it.
- 58:45So I just went and opened an issue and said, hi, add me.
- 58:49And I'm more basically a defactor maintainer on like live reload as well as Sphinx auto build, which is nice.
- 58:57If you don't use Sphinx auto build and write a lot of Sphinx docs, start using it because it's great, I think.
- 59:02Yeah.
- 59:03Awesome.
- 59:03I love those auto reload aspects.
- 59:05Yeah.
- 59:06All right, you guys, we are just about out of time.
- 59:09Maybe I'll open it up for if anyone else wants to just give a shout out to something or mention something while we're all here together.
- 59:15What have we not covered that we need to quickly talk about?
- 59:18The main thing that I would just say is to reiterate that I think that what a lot of these like the theme conversations and improving developer workflows around the Sphinx ecosystem, one of the reasons that they're so successful is because I think that there's a lot of low-hanging fruit in the Sphinx ecosystem to basically like signal boost all of this work that's been done over the last, you know, 14 years.
- 59:41And DocuTales and Sphinx and building this documentation engine and this whole community of people writing extensions for it.
- 59:47In a lot of ways, I think that there's a lot of potential energy there that hasn't been unlocked yet, in part because of some of the things around developer friction or themes that don't look kind of like modern and nice and web develop-y.
- 1:00:00And I think that there's still a lot more low-hanging fruit that can be accomplished with, for example, improving documentation about Sphinx itself or the extensions or whatever.
- 1:00:10And so I think that all of the success of these projects is largely possible only because they're kind of piggybacking on top of this really well-established community where a lot of work has already been done.
- 1:00:20And a lot of kudos go out to that broader community.
- 1:00:22For sure.
- 1:00:23And one other thing that I'm sort of hoping to see coming out of this is as sort of these efforts around making it easier to present your thing nicer, making it easier to write your docs and all of these happen.
- 1:00:37So, you know, because when you have something that looks nicer, that's all of that, it also results in a better quality of documentation where because you're able to go, oh, actually, I can see the structure of my site more clearly.
- 1:00:57I think I would like to restructure it slightly to make it clearer what the flow is.
- 1:01:02And, oh, I'm missing this bit of content in this section, but I have it there.
- 1:01:06Maybe I should just edit it.
- 1:01:07And when these things become more obvious to you through either clearer markup or clearer site design or whatever, it will lead to better documentation.
- 1:01:17And also a lot more people would be willing to write those.
- 1:01:20Because it's more like, oh, why am I writing this?
- 1:01:23Yeah.
- 1:01:24And also moving away from Sphinx just being seen as a developer documentation into Ghibli books, trying to do, make it available for scientists and things to go, oh, wait a minute.
- 1:01:36I can use this relatively easily and I can share my work or I can write tutorials, science, share my research and things like stuff like that.
- 1:01:47That part's really interesting to me.
- 1:01:49And it's why I did the course with Michael on static websites, not static documentation, is to think bigger than just docs.
- 1:01:57I have an interest in knowledge bases.
- 1:01:59I'm a developer advocate.
- 1:02:00We create artifacts that are rich and interconnected and richly linked.
- 1:02:05Sound like something?
- 1:02:06Sphinx has inside of it this engine.
- 1:02:09Sphinx and DocuTools has this engine inside, which nothing else has.
- 1:02:13The very first contact you have with the mist in the course that I did is just the humble link.
- 1:02:21But when you do it in mist, it will tell you if the thing on the other side isn't there.
- 1:02:26It'll extract the title and inline it on your side.
- 1:02:30That is magic to all these other systems.
- 1:02:33And it's knowledge-based kinds of things that are valuable.
- 1:02:37And I think that we could tell the story of Sphinx in a bigger way beyond documentation and start doing all of the things that people on technical teams want to do for storytelling.
- 1:02:52I feel like I want to interject and mention that, hey, you know Sphinx can do blogs?
- 1:02:57Yes, there's the Ablog extension.
- 1:02:59Right on.
- 1:03:00And Chris H, at least, has his blog on his personal website, as far as I'm aware.
- 1:03:08Look inside the code of Ablog, which I've followed for years, it shows you tapping into the equivalent of front matter and walking through all the doc trees and looking for structure and doing back references.
- 1:03:21People don't expect to be able to do that in Markdown.
- 1:03:25It's a document database.
- 1:03:27That's what you should think of, Sphinx says.
- 1:03:29And I think there's a lot there of unlocking.
- 1:03:33I really do want to reiterate what Chris said of there's a huge body of excellent work that has been done over more than a decade.
- 1:03:44I mentioned older than me, it's like four years younger or something like that.
- 1:03:48I'm four years older than me.
- 1:03:51Okay, whatever.
- 1:03:51I was wrong there.
- 1:03:52But yeah, there's a huge body of work there.
- 1:03:56And there's just, it sort of needs the little touch of, hey, paint.
- 1:04:02Get it to look like it belongs in the sort of modern web.
- 1:04:07But it also needed Mist.
- 1:04:09It needed Mist to come along and express that power in a human-oriented way.
- 1:04:14And there are so many things in Mist that are mind-blowing.
- 1:04:17People haven't scratched the surface with Mist yet.
- 1:04:21I actually, to that point, one other quick plug that I would give is, I know we've been talking about Sphinx in this conversation.
- 1:04:28But to reiterate, I think that the goal of Mist is to be a tool or implementation agnostic specification for Markdown.
- 1:04:36And I think that there is a lot of exciting possibilities if we can sort of find the right standards to apply at the Mist, you know, directives level or roles level or whatever.
- 1:04:48And to see if you could get a flavor of Markdown that is flexible enough that it can be reused across like a few different kinds of applications.
- 1:04:56Maybe some are pure web page, maybe some that are full-blown documentation, maybe Pandoc, you know, whatever.
- 1:05:01And so I invite people who, if they can think of use cases or tools that they're working on or ecosystems that they're working in,
- 1:05:08that would benefit from something like a sort of tool agnostic flavor of Markdown that has natural block and inline level extension points,
- 1:05:19then reach out and we would love to chat because I think it would be really cool to see Mist being applied in other kinds of contexts as well.
- 1:05:25Yeah, it would just help it grow, get stronger.
- 1:05:27Yeah, I guess on a similar sort of call to action sense, I think if there's anyone around in listening who has sort of JavaScript and web design jobs
- 1:05:37and sort of finds all of this interesting and wants to sort of contribute to making Sphinx look prettier, like reach out to honestly any of us on this call.
- 1:05:47And yeah, we'd really like to have more people on board, not least because it's good to have fun collaborators to collaborate with, as Chris and Chris have been,
- 1:05:57but also because I think the ecosystem could use a bunch.
- 1:06:01I think Sphinx itself and even Dark Itals, like the maintainership story on those and the work that those maintainers do is,
- 1:06:09well, the maintainership story is, let's leave it at interesting.
- 1:06:14And the work that the maintainers do is really amazing for the amount of resources that they have.
- 1:06:19Yeah, fantastic.
- 1:06:19Good call to action.
- 1:06:20Let's leave it there.
- 1:06:21Let me ask you all one of the two final questions I typically ask before we get out of here.
- 1:06:26Regine, I'll start with you.
- 1:06:29If you're going to write some Python code, what editor are you using these days?
- 1:06:32I am using Visual Studio Code.
- 1:06:34Okay.
- 1:06:35Used to use Sublime Text, but I've sort of switched over.
- 1:06:38Yeah, I feel like that's the natural transition for Sublime users that seems to be able to advertise.
- 1:06:42Good it is.
- 1:06:44I'm wondering which one you might be using.
- 1:06:45No, I love PyCharm as well.
- 1:06:50The best, baby.
- 1:06:50The best.
- 1:06:51Absolutely.
- 1:06:52Right on.
- 1:06:53Chris Siwa?
- 1:06:54Mainly Visual Studio Code.
- 1:06:57Is there, I suspect, probably some notebooks in there as well.
- 1:07:00There's probably some notebooks in there as well.
- 1:07:03Like some Jupyter.
- 1:07:04Partly Jupyter Lab, but mainly Visual Studio Code.
- 1:07:08And there's also this extension for Visual Studio Code.
- 1:07:11And we're working on the extension for Jupyter Lab as well.
- 1:07:15Oh, fantastic.
- 1:07:16All right, cool.
- 1:07:17Chris?
- 1:07:17H?
- 1:07:18I kind of split 50-50 VS Code and Jupyter Lab.
- 1:07:21Basically, if I'm doing development, software development, then I do VS Code.
- 1:07:25And if I do data exploration, interactive computing, that kind of workflow, then I use Jupyter Lab.
- 1:07:29Over on the notebooks.
- 1:07:31Right on.
- 1:07:31All right.
- 1:07:32Well, thank you all for being here.
- 1:07:33It's been really fun.
- 1:07:34And thank you for all the hard work on bringing all this stuff up to 2020.
- 1:07:39Plus.
- 1:07:40Wait, wait.
- 1:07:41You have two questions.
- 1:07:42You only ask one.
- 1:07:43I know.
- 1:07:44All right.
- 1:07:44Really quick then.
- 1:07:45Notable PyPI package.
- 1:07:46And so I don't want to take too much of your time.
- 1:07:48Okay.
- 1:07:49I guess for me, it'll be Pursuit PyPair, PPB.
- 1:07:52It's a really cool educational game engine that's way better than what I had when I got started
- 1:07:58with gaming.
- 1:07:59Yeah.
- 1:07:59I just finished doing the Python Bytes podcast with Brian before we started this one.
- 1:08:04And ESA, the European Space Agency, just put two Raspberry Pis on the International Space Station
- 1:08:11for kids and students to program against.
- 1:08:14I'm like, that's way better than the turtle I got to drive around when I was in school.
- 1:08:17All right.
- 1:08:19Paul, really quick.
- 1:08:20What's a package or library you want to just give a quick shout out to?
- 1:08:22I have a fascination with dependency injection in a human oriented way.
- 1:08:28Antidote.
- 1:08:29Antidote.
- 1:08:29Okay.
- 1:08:30Very interesting.
- 1:08:31That's new to me.
- 1:08:31Chris S.
- 1:08:33Got a library you want to give a quick shout out to?
- 1:08:35So is that Chris S?
- 1:08:36Yes, it was Chris S.
- 1:08:37It was.
- 1:08:38I'm Pipex.
- 1:08:40I hadn't used yet until recently.
- 1:08:44And yeah, I love you.
- 1:08:47Yeah.
- 1:08:47I'm all for that.
- 1:08:50People talk about how it's hard to distribute Python applications and little utilities by packaging
- 1:08:55them up because, well, you got to download the scripts and then set up the environment.
- 1:08:58That is the homebrew of the Python world.
- 1:09:00If you want something, I can go to the terminal and just type a command and it runs.
- 1:09:05Well, if you Pipex install it, it's going to just be there and it's fantastic.
- 1:09:09I love it.
- 1:09:09People should use it more for that use case.
- 1:09:12Chris H.
- 1:09:13I feel like in the name of improving UI, UX and window dressing on technology that some
- 1:09:19people think is outdated.
- 1:09:20I would shout out to Rich.
- 1:09:22Oh, yeah.
- 1:09:22Sort of like UI components, visualizations, whatever.
- 1:09:25I would love to find a way to get Rich into Jupyterbook or even Sphinx or something like that because
- 1:09:31I think it makes for a really nice user experience.
- 1:09:33The only problem is that the maintainer of Rich is much better at Wordle than I am.
- 1:09:37And so he's like consistently beating me by two or three tries.
- 1:09:41Every day.
- 1:09:42Fantastic.
- 1:09:45Let me wrap it up a bit because this seems relevant.
- 1:09:49One of the things I've been doing through work as well as personal time is improving error
- 1:09:53messages in Fit and Rich has played a decent thing.
- 1:09:56Oh, yeah.
- 1:09:57Fantastic.
- 1:09:57So it's pretty likely that in the coming release or two, you'll see better error messages,
- 1:10:02partly thanks to Will's work on Rich.
- 1:10:05Yeah, absolutely.
- 1:10:05He's got the whole traceback enhancements and everything.
- 1:10:08All right.
- 1:10:08Thank you all for being here.
- 1:10:09It's been great.
- 1:10:10Chat with you later.
- 1:10:11Thanks, Michael.
- 1:10:12This has been another episode of Talk Python To Me.
- 1:10:15Thank you to our sponsors.
- 1:10:17Be sure to check out what they're offering.
- 1:10:19It really helps support the show.
- 1:10:20Add high-performance, multi-party video calls to any app or website with SignalWire.
- 1:10:25Visit talkpython.fm/SignalWire and mention that you came from Talk Python To Me
- 1:10:31to get started and grab those free credits.
- 1:10:33Tonic.ai creates quality test data that does not contain personally identifiable information.
- 1:10:39Your generated data sets are safe to share with developers, UA, and data scientists.
- 1:10:44Most importantly, they behave like production because they're made from production data.
- 1:10:49Check them out at talkpython.fm/Tonic.
- 1:10:53Want to level up your Python?
- 1:10:55We have one of the largest catalogs of Python video courses over at Talk Python.
- 1:10:59Our content ranges from true beginners to deeply advanced topics like memory and async.
- 1:11:04And best of all, there's not a subscription in sight.
- 1:11:07Check it out for yourself at training.talkpython.fm.
- 1:11:10Be sure to subscribe to the show, open your favorite podcast app, and search for Python.
- 1:11:14We should be right at the top.
- 1:11:16You can also find the iTunes feed at /itunes, the Google Play feed at /play,
- 1:11:21and the direct RSS feed at /rss on talkpython.fm.
- 1:11:25We're live streaming most of our recordings these days.
- 1:11:28If you want to be part of the show and have your comments featured on the air,
- 1:11:32be sure to subscribe to our YouTube channel at talkpython.fm/youtube.
- 1:11:36This is your host, Michael Kennedy.
- 1:11:38Thanks so much for listening.
- 1:11:39I really appreciate it.
- 1:11:41Now get out there and write some Python code.
- 1:11:43I'll see you next time.