<tpb>
Title: 7.5. textwrap — Text wrapping and filling Python v3.1.5 documentation (at docs.python.org)
<xobs>
mithro: Thanks, that looks super useful for this sort of thing. I wonder why it's not more widely known
<xobs>
I'll have to look into using that myself. I saw someone used regular expressions on Stack Overflow to accomplish that, which is as far as I'd gotten.
<xobs>
xobs: Any recommendations on how we can extract various sections out of a docstring? Or how we could use sphinx? Right now I generate rst files after `soc.do_exit(vns)` and just run sphinx on that.
<mithro>
xobs: I only found about it a year or two ago and I've been programming in Python since 1998
<xobs>
If there were a way to parse out the various Module docstrings, that would be very useful.
<mithro>
xobs: I would suggest using rst headers / section thingies
<xobs>
sphinx is, ironically, not well documented. For example, in lxsocdoc, I make each register a `subsubsection`, but in the resulting html it makes them `<h1>` "section"s. I haven't figured out how to not have it include subsubsections all over the place. Or how to include sections.
pizzaman has joined #litex
<xobs>
Is docutils part of python, or is it something that got pulled in by sphinx?
<xobs>
I see. No, it's not part of the standard distribution, but it has no dependencies and no build requirements other than 3.5+ (same as litex)
freemint has quit [Ping timeout: 240 seconds]
freemint has joined #litex
CarlFK has joined #litex
<xobs>
This came up over in #fomu, but is there any particular reason why `CSRStatus` fields have no `.we` signal?
freemint has quit [Ping timeout: 245 seconds]
scanakci has joined #litex
freemint has joined #litex
<mithro>
xobs: FYI I would recommend using rst headers / blocks. You can then use docutils to easily extract the sections.
<mithro>
xobs: This is why you use self contained Python environments
<xobs>
Also, docutils seems to require python 3.5+. litex requires python 3.5+, but I'm afraid of them changing things.
scanakci has joined #litex
<mithro>
0.15 is the last to support Python 2.6, 3.3, and 3.4.
<mithro>
Docutils is compatible with Python versions 2.7, and 3.5 to 3.7
<xobs>
Right, but my concern is that they don't seem to care much for backwards-compatibility. And I don't see the benefit of doing it that way versus having a sentinal. The drawbacks are needing to package another module, and depending on something that has shown that they will drop support for older versions. What are the benefits?
<mithro>
xobs: The choice is "do something custom which will continue to grow in complexity until it reaches the same as the existing solutions" or "Use the current existing most popular solution which has been around a long time and is the default option Python people would reach for (and has a lot of stackoverflow and other existing solutions)"
<mithro>
xobs: FYI - The longer you wait to upgrade things, the more painful the upgrade is going to be
freemint has quit [Ping timeout: 245 seconds]
<xobs>
mithro: It'll need to be nonstandard anyway. The choice is whether we have a nonstandard prefix on the header, or we have a special sentinal.
<mithro>
xobs: Extend an existing standard is better than inventing a new one...
<xobs>
I really don't like to add python packages. They always seem to break. The wavedrom sphinx plugin, for example, fails to install because it requires libxcb.dll
<xobs>
The idea came from perlpod, which is an existing standard.