<div dir="ltr">Sorry it&#39;s taken me so long to get back to this.  But it&#39;s gotten to be a Looong email.<br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 2, 2013 at 3:14 AM, Glyph <span dir="ltr">&lt;<a href="mailto:glyph@twistedmatrix.com" target="_blank">glyph@twistedmatrix.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><br><div><div class="im">
<div>On Mar 1, 2013, at 9:35 PM, Kevin Horn &lt;<a href="mailto:kevin.horn@gmail.com" target="_blank">kevin.horn@gmail.com</a>&gt; wrote:</div><br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">That &quot;never-ending&quot; series of Lore source fixes took place over the course of a couple of weeks.  Doing things that way was not my idea, though it seemed reasonable at the time because  the idea was that we would do the cutover at the end of it.</div>
</div></div></div></blockquote><div><br></div></div><div>Well, let&#39;s go to the video tape. Based on this comment -  &lt;<a href="http://twistedmatrix.com/trac/ticket/4500#comment:12" target="_blank">http://twistedmatrix.com/trac/ticket/4500#comment:12</a>&gt; - these tickets were closed over a period ranging from 2010/07 to 2011/03. 6 months isn&#39;t quite &quot;weeks&quot;, but okay I guess it wasn&#39;t &quot;never-ending&quot; either :).</div>
<div class="im"><br></div></div></div></blockquote><div><br></div><div style>Hmmm.  I recall it as being much shorter.  Probably most of the work took place it two &quot;spurts&quot; around the beginning and end of that time, and that&#39;s why I remember it that way.  But I&#39;m not interested in digging through a bunch of old dates to find out for sure.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im">
<blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">(As an aside, lore2sphinx is in no way a &quot;broken pile of regexes&quot;.  Not to say that it isn&#39;t broken in some really significant ways, because it is, but it doesn&#39;t use regexes at all.  Just sayin&#39;.)</div>
</div></div></div></blockquote><div><br></div></div><div>Actually yeah, &quot;regex&quot; is just a curse-word here :).  It&#39;s the emitter I&#39;m complaining about, anyway, not the parser, so deriding it as a &quot;regex&quot; is in no way accurate.</div>
</div></div></blockquote><div><br></div><div style>I figured that was the case, I just wanted to say something so others reading this didn&#39;t get the wrong impression about how lore2sphinx is implemented.  I mean it&#39;s not code I&#39;m very proud of, but it&#39;s not _that_ bad :)</div>
<div> </div><div><br></div><div style>&lt;&lt;&lt; snip a bunch of stuff about who said what when, why I thought what I thought, etc. &gt;&gt;&gt;</div><div style><br></div><div style>It boils down to the fact that a bunch of the conversations happened either in person or on IRC.  This was mostly because I was in a hurry at the time, usually because I wanted to do something before additions were made to the documentation, which was in a somewhat &quot;known&quot; state (as in I knew how it was going to behave when run through lore2sphinx) at the time.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im">
<blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Also, please elaborate on what you mean  by &quot;do *everything* in one big bang.  My intention was never to do anything but get the SphinxBuilder working on that branch.  Was there something else you thought I was doing?  Was there something else I should (or should not) have been doing?</div>
</div></div></div></blockquote><div><br></div></div><div>My reasoning goes like this: the ticket for the release tools is still not in review, so you must be waiting for something to re-submit it.  It looks like you responded to the code, so the only thing I could think you were still waiting for would be for the lore sources themselves to be ready.</div>
<div class="im"><br></div></div></div></blockquote><div><br></div><div style>It&#39;s been long enough that I can&#39;t fully recall my reasoning on this.  But _probably_ I decided that if I finished the release tools ticket, someone might use it.  Which would be great, except that I think I had decided that before that actually happened I needed to figure out a way to emit nicer output from lore2sphinx.  So I left it alone until I had figured out how to do that.</div>
<div style><br></div><div style>At least, that _might_ have been part of my thought process.  It really was ages ago.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra">
<div class="gmail_quote">[the fixed-up Lore sources] got left alone because of the release tools hangup.  Ideally the release tools would have been done before the whole lore-source-tweaking process, but they weren&#39;t.  I&#39;ll admit my frustration played a part in this, but so did the deafening silence I got when I asked for anyone to comment on the ticket.</div>
</div></div></div></blockquote><div><br></div><div>Where and how did you ask people to comment on the ticket?  I don&#39;t recall being asked, and I tend to be pretty good about leaving prompts like that in my inbox until I&#39;ve done what was asked.  (Not *perfect*, of course, and if you asked a list then there might have been some bystander effect.)  It seems like we might have avoided this whole mess if you had just attached the &#39;review&#39; keyword :).</div>
</div></div></blockquote><div><br></div><div style>On IRC.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class="im"><div></div></div><div class="im"><br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">My perception has been that I would say &quot;what do we need to do to make this happen&quot;?  There would be some hemming and hawing (and at least several times long discussions about how documentation didn&#39;t really fit the regular UQDS process) and a sort of plan would be invented.  I would proceed according to the plan as I understood it.  I would then say &quot;OK, we&#39;re ready&quot;!  And then be told that some other thing not in the plan needed to be done.  The cycle would then repeat.</div>
</div></div></div></blockquote><div><br></div></div><div>The only &quot;cycle&quot; I can either see on the tickets or recall here is where the release tools didn&#39;t come in to the initial plan.</div></div></div></blockquote>
<div><br></div><div style>This was the latest of several (3 or 4) according to my recollection/perception.  It doesn&#39;t really matter now.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra">
<div class="gmail_quote">No [the need for release automation] was not brought up until well into the process. I (sort of) understand the desire for this, but it seems pretty weird to be building what is essentially a wrapper for an existing tool, along with tests for said wrapper, </div>
</div></div></div></blockquote><div><br></div><div>OK.  I can believe that this did not happen.  One problem is that we (the inner-circle old-school Twisted developers) tend to engage in conversations about how a thing might be done while at the same time we discuss what must be done.  And we also tend to discuss what policy is (or what all or some of us believe it <i>ought to be</i> in some case, further confusing the issue) without making explicit what the <i>purpose</i> of that requirement is.</div>
<div><br></div><div>I would ask the community to help us with this by doing a couple of things.</div><div><br></div><div>If somebody says &quot;X is policy&quot;, always ask for a link to it.  If there is a link, it&#39;ll help you understand it better.  If there <i>isn&#39;t</i> a link, then the authority telling you it&#39;s &quot;policy&quot; might just be remembering that it&#39;s the way we&#39;ve done things since forever and of course it&#39;s a good idea.  There are definitely things that I have thought were in the coding standard that are not actually written down anywhere, on more than one occasion.</div>
<div><br></div><div>If a meandering discussion is happening - here, on the mailing list, on the ticket - never be afraid to break it up and separate out the different concerns which are being discussed: what is necessary for compliance with our development process, what would be a good idea from a design point of view, how the work might be broken up to get through review more manageably, what other concerns are in play.</div>
<div><br></div><div>Especially, if you ever see a code review where a reviewer says &quot;I think...&quot; without making it clear what you should <i>do</i>, you should always ask, &#39;is this a requirement of the review or just some thoughts you have&#39;.</div>
<div><br></div></div></div></blockquote><div><br></div><div style>And when we ask, we should ask on the ticket, and put it back into review, yes?  Because I think this was the part (or at least _A_ part) I was really missing here.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div></div>
<div>There&#39;s also the problem of &quot;I think you should...&quot; being interpreted as &quot;You must...&quot;.  It is <i>very</i> hard to consistently separate design feedback from code review, although we try very hard; but, it&#39;s hard to separate it out when reading it as well.  So one important point to keep in mind is that, as the author of a proposed change, outside the things that are agreed upon policy consensus, you always have some degree of discretion to disagree with a reviewer.  And you should freely do so when submitting anything for re-review.  It&#39;s best to just do this as quickly as possible, so that it gets back to the reviewer without a whole lot of delay, and they can respond with either &quot;I still disagree, but you&#39;re doing the work, so OK go ahead&quot; or &quot;No, you really have to do this, it&#39;s required by policy document X, here&#39;s a link&quot; ;-).</div>
<div class="im"><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><ol><li>The documentation itself needs to be able to be generated from any version of trunk.  While one or two formatting snafus are acceptable to be fixed after the fact, the documentation needs to be in a comprehensible state in every revision of trunk, which means that in order to land on trunk, the ReST output.</li>
</ol></div></blockquote><div>So...you didn&#39;t finish that sentence.  I realize you apologized for errors at the end of your mail, but I have a feeling you were going to say something rather important there...</div></div>
</div></div></div></blockquote><div><br></div></div><div>Well yes, that was the point of the apology.  That was a rather important thing.  What I was probably going to say was just:</div><div><br></div></div><blockquote style="margin:0px 0px 0px 40px;border:none;padding:0px">
<div><div>The ReST output needs to be in good enough shape to be generally readable, with a manageable number of errors.  But, we need to be able to *verify* that it has not too many errors.</div></div></blockquote><div><br>
</div>And I&#39;d already discussed that somewhat above.<br><div><div class="im"><div><br></div></div><div class="im"><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_extra">Now that I&#39;ve replied to all of that, let me give you a rundown of what I&#39;ve been thinking and planning, so that you have an idea of where I&#39;m coming from.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Here are the various things that I have perceived to be necessary/required in order to get the conversion to happen:</div><div class="gmail_extra"><br></div><div class="gmail_extra">
a) The conversion process needs to be able to be run concurrently with Lore for an extended period of time.  In other words, Lore would be the &quot;official&quot; version of the docs, and the Sphinx docs would be built in some form of automated fashion until everyone was happy with them and/or ready to deprecate/abandon Lore.</div>
</div></div></div></blockquote><div><br></div></div><div>Your understanding of this requirement is slightly off, I think, although possibly the consequences are the same.  As per the difficulties I laid out above, about separating the requirements from the strategies for satisfying said requirements.</div>
</div></div></blockquote><div><br></div><div style>I&#39;ve been told that almost verbatim, several times.  This is basically what led to the Sphinx buildbot happening.  Perhaps I wasn&#39;t clear about what I meant.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div></div>
<div>The thing that we weren&#39;t going to tolerate was any message saying that people should hold off on writing documentation, even for &quot;a little while&quot; while we fixed up the lore conversion, because without a contractual obligation for someone to finish this work, there&#39;s really no telling how long &quot;a little while&quot; would be :).  </div>
</div></div></blockquote><div><br></div><div style>Well, when I originally was pushing it, my plan was for that little while to be &quot;today&quot; (this was at PyCon during the only day of sprints I was able to attend), and if it didn&#39;t get done, we&#39;d abandon that particular attempt.  You and exarkun managed to convince me that even this was probably not a very good idea though.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div>Since the whole point of this sphinx conversion is to appeal to documentation authors who prefer the ReST format as input (it&#39;s definitely not to make the docs look nicer, writing a new stylesheet for Lore would have taken 1/100th of the effort and nobody has expressed interest in doing that), creating a period where things were even *less* appealing to documentation authors would defeat the purpose.</div>
</div></div></blockquote><div><br></div><div style>I actually considered the stylesheet thing, but it was really only a passing thought.  My personal motivation started with not being able to find things in the documentation.  So I started looking at the various Lore tickets to see whether there was something to clean up that would help.  And a bunch of them seemed to be asking for things that Sphinx already did.  Sphinx was starting to become a common tool, and I had used it on several other projects, and found it pleasant to work with.  Also, when I asked about Lore on IRC, I got a lot of &quot;I&#39;m not sure anyone knows how that works these days&quot; and &quot;oh man, I wish we didn&#39;t have to support that any more&quot;, etc.  So I started looking into how to convert the docs over to use Sphinx.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div></div>
<div>Another possible solution to this problem would be to modify Lore so it could process ReST sources, so that we could convert the documentation within the repository piecemeal, and start writing any new docs in ReST, but still have a coherent whole of documentation produced, eventually switching the documentation processor from Lore to Sphinx.</div>
</div></div></blockquote><div><br></div><div style>This would require someone smarter than me.  Or at least more versed in formal parsing theory/techniques.  Or something.  And that would be just to read the docutils sources.  I find them...alien. (though less so that when I first started looking at them...I&#39;m not sure if they&#39;ve improved, or I have)</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div></div>
<div>Yet another possible solution would be to modify Sphinx, adding a plugin to process the Lore sources.</div></div></div></blockquote><div><br></div><div style>This is more reasonable, but still has problems.  Actually the reasonable thing would be to create a docutils piece to process Lore sources, and then maybe some Sphinx extensions on top of that.  Or something.  Still, it might have been doable.  However, I think Lore would have had to be modified as well, and possibly the Lore format expanded to accommodate certain constructs that it just doesn&#39;t do right now (mostly I&#39;m thinking of the toctree directive and related stuff).</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div></div>
<div>As an aside: this is the part of the process which has been so frustrating to me, personally.  The two alternate solutions I proposed here (and have proposed before) seem far saner and more manageable in terms of effort, to me.  But, everyone I have spoken to about docutils and ReST has told me in no uncertain terms that they are both a pile of heinous hacks that resist any attempt at sensible software-engineering solutions to problems, so we need to resort to hackish system-integration stuff like what we&#39;ve done.  This worries me.</div>
</div></div></blockquote><div><br></div><div style>Ooookaaaaay....I don&#39;t know how to respond to that exactly.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div></div><div>I know that Sphinx&#39;s output is well-loved by the Python community, but if it&#39;s so hard to call into that we can&#39;t reasonably modify it to get an XML DOM that looks like Lore source to Lore, and it&#39;s so hard to plug in to it that we can&#39;t give it a data structure that it likes from Lore&#39;s XML DOM, then how the heck is it being maintained?  And if it actually *isn&#39;t* that bad, then why haven&#39;t I managed to find someone that knows its code well enough to do one or the other of these things?</div>
</div></div></blockquote><div><br></div><div style>It would be possible to make Sphinx emit Lore sources, though I&#39;m not sure what that buys.  You could do this either through a custom Sphinx &quot;builder&quot;, or possibly even just using a custom html template with the html builder.  But you&#39;d need ReST sources to feed into Sphinx, so...</div>
<div style><br></div><div style>You could write a docutils &quot;parser&quot; which parses a document and returns a &quot;nodetree&quot; data structure.  This would get you as far as docutils, but AFAIK there is no existing way to get Sphinx to use any parser other than the default ReST one.  You could probably create such a thing, which would almost certainly involve modifications to Sphinx, though that&#39;s not necessarily a big deal.  It might not even be hard.  I think this would actually be a lot easier now than when I started down this path, mostly because docutils seems to have better documentation on the nodes that can go in the &quot;nodetree&quot; I mentioned above.  Note that I said &quot;seems&quot; because I&#39;m not sure if it&#39;s that docutils documentation has gotten more complete, or just that I&#39;ve bounced around in it enough times to find things.  The Docutils docs have the same problem that the Twisted docs have, which is that they are nigh un-navigable.  (I also think that the docutils docs should start using Sphinx, but I&#39;m not sure how well that would go over in that camp...)</div>
<div style><br></div><div style>The main problem with creating such a parser, is that Sphinx uses a bunch of docutils extensions to tie together the disparate documents in your project, and Lore, like vanilla docutils, doesn&#39;t have much of a concept of being one document among many (at least not from within a document).  For example, it has things to handle tables of contents, cross document links (with the ability to link to a document section, rather than a specific document, so if it gets moved to a different document, the link gets adjusted), compilation for glossaries and index entries from across the docs project, etc.  So you&#39;d need to add some stuff to Lore to account for this (some is already there).  And then we&#39;d have to go through and modify a bunch of the Lore sources anyway.</div>
<div style><br></div><div style>Like I said, this looks a lot more feasible now than it did when I first looked at it, though I&#39;m not sure whether it&#39;s me or docutils/Sphinx that&#39;s changed.  Probably some of each.</div>
<div style><br></div><div style>At any rate, back then it seemed awfully difficult, and less interesting.</div><div><br></div><div style>Hmmm.  And you&#39;d also need to make some changes to the way Sphinx picks up files.  And probably some other stuff I haven&#39;t thought of.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div>
</div><div>I have no direct knowledge of any of this stuff, because my main interest here is improving the experience of working on Twisted, both for you, Kevin, and for the people who will arguably be helped by the use of Sphinx.  Maybe I&#39;m completely wrong and Sphinx is beautifully architected and we could have done this from day 1.  But I faintly hope that some Docutils and Sphinx contributor hears that I said &quot;sphinx is garbage&quot; and makes a fool of me by contributing either a lore modification or a sphinx plugin which solves this whole problem so we can do the format or tool migration incrementally :).</div>
<div class="im"><div><br></div><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra"><div class="gmail_extra">
b) Because of a), there needs to be tooling to run lore2sphinx (or whatever) on a regular basis.  (This was sort of being done via the Sphinx-building buildbot, but in a very ad-hockery sort of way, which was brittle, broke a couple of times, and needed to be improved.)</div>
</div></div></div></blockquote><div><br></div></div><div>Hmm. I wasn&#39;t aware of that. But it seems like it&#39;s running by a charm now.</div></div></div></blockquote><div><br></div><div style>I think this is because a) exarkun fixed it a couple of times, and b) I stopped making changes to the lore2sphinx repo (which the buildbot pulls from).  I&#39;m also referring here to something which is completely non-obvious to anyone who hasn&#39;t actually run lore2sphinx by hand, which is that the command line tool was fairly terrible in several ways.  This made it harder to use for development than it should have been.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im">
<div><br></div><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra"><div class="gmail_extra">
c) There needs to be release management tooling to build the Sphinx docs from ReST into whatever formats we want to publish (HTML and PDF to start, maybe others later on)</div></div></div></div></blockquote><div><br></div>
</div><div>Yup.  (ePub?  PDF is so last-century... :))</div><div class="im"><br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_extra">d) Convert the Lore sources to better ReST documents without all the problems that the current lore2sphinx output has.</div></div></div></div></blockquote><div>
<br></div></div><div>So, this wasn&#39;t *necessary*.  If we had gotten through the release automation stuff - and I still don&#39;t understand why that&#39;s stuck - we could have merged it.</div></div></div></blockquote>
<div><br></div><div style>Well, I decided it was.  Or at least really really desirable.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class="im">I at one time thought this was pretty impractical.  My first attempt at a conversion tool tried to use an intermediate object model, but I ran into trouble when trying to combine the various objects.  So I abandoned the effort and created what became lore2sphinx, which basically just combined a bunch of strings.  I then figured out a way of making the intermediate object thing work, and that was lore2sphinx-ng.  Then it became convenient to split out the intermediate object model from the documetn processing code, so I put all of that into a library and that became rstgen.<br>
<div><br></div></div><div>It seems the saving grace here is that rstgen might be a generally useful tool in its own right, with more of a long-term future than lore2sphinx would have had.</div></div></div></blockquote><div>
<br></div><div style>I admit that I have become more interested in the actual problem of &quot;generating ReST&quot; than I once was.  And I hope that it will become a generally useful tool.</div><div style><br></div><div style>
And probably one of the reasons I have been making such relatively slow progress on it is is _because_ I&#39;m trying to solve a more general problem than I once was.  The original lore2sphinx (the one running on the buildbot now) was very much a minimal-thing-that-could-possibly-work kind of solution.  It tried to do just enough to get the job done.  It sort of did get the job done, but I was never very satisfied with it.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im">
<blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra"><div class="gmail_extra">(For anyone who is curious, the lore2sphinx-ng repo is forked off from the lore2sphinx repo, primarily because I didn&#39;t want to break the Sphinx buildbot by making drastic changes.)</div>
</div></div></div></blockquote><div><br></div></div><div>Have a link?</div></div></div></blockquote><div><br></div><div style>I&#39;ve posted it a couple of times in this thread, though I can hardly blame you for either missing it or losing track of it.</div>
<div style><br></div><div style>original: <a href="https://bitbucket.org/khorn/lore2sphinx">https://bitbucket.org/khorn/lore2sphinx</a></div><div style>extra-crispy: <a href="https://bitbucket.org/khorn/lore2sphinx-ng">https://bitbucket.org/khorn/lore2sphinx-ng</a></div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im">
<br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra"><div class="gmail_extra">Here&#39;s what my plan was prior to this whole discussion getting started again.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">1) Finish rstgen, where &quot;finished&quot; in this instance is defined as &quot;is capable of generating all the vanilla docutils and sphinx-specific ReST elements that we need for converting the </div>
Twisted documentation.</div></div></div></blockquote><div><br></div></div><div>Sounds like a worthy goal, although I don&#39;t think this is necessarily required.  Have you been working on it for the last 2 years?  Do you have any idea when it might be done?  It might be worthwhile to write a *smaller* .</div>
</div></div></blockquote><div><br></div><div style>I started on rstgen a bit more than a year ago.  I was hung up on the problem of how to combine various parts of a document for a while without having the crazy space-handling issues.  And also I&#39;ve been trying to come up with a relatively friendly API, and enough generality that it will end up useful outside of the lore2sphinx context.</div>
<div><br></div><div style>I really started on l2s-ng last July during &quot;Julython&quot;.  I&#39;ve been working on it in fits and starts a few times since then.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class="im"><br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr">
<div class="gmail_extra">2) Finish lore2sphinx-ng (which would probably have ended with merging it back into the lore2sphinx repo), where &quot;finished&quot; means that it would be capable of processing all the XHTML Lore tags that were defined in the Lore documentation and used in the Twisted documentation, and generating a tree of rstgen elements, which could then be rendered into ReST.</div>
</div></div></blockquote><div><br></div></div><div>Cool.</div><div><br></div><div>While this would be handy, especially for people working on documentation branches, it&#39;s not necessarily necessary.</div><div class="im">
<br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra">(this would also serve to satisfy b) above, as the CLI in lore2sphinx-ng is less...well, let&#39;s just call it broken than lore2sphinx&#39;s was/is.)</div>
</div></div></blockquote><div><br></div></div><div>OK.</div><div class="im"><br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
<div dir="ltr"><div class="gmail_extra">3) Go back and finish SphinxBuilder (release tooling for building a sphinx project, which is basically a wrapper for sphinx-build, plus some vague &quot;version feature&quot;).</div>
</div></div></blockquote><div><br></div></div><div>This is really the crux; this is the thing you should work on first, I think, even if you&#39;re going to keep working on lore2sphinx-ng.  Basically the only reason that I was keen to get the lore to sphinx conversion improved in the first place was that creating this tool seemed to be dragging on for quite a while after the &quot;chunk tickets&quot; were done.  But now, this tool is almost done, and we could re-do the lore-source review if you wanted to do that.  The current lore2sphinx might well be good enough to just go with, especially if the next-generation version is going to take another six months to finish.</div>
</div></div></blockquote><div><br></div><div style>I&#39;ll take a look at this again soonish (a week?  this month? don&#39;t know.).  Probably it&#39;s a matter of:</div><div style><br></div><div style>- merge forward (it has been a while)</div>
<div style>- figure out how the other tools guess/determine the Twisted version in the checkout, and make SphinxBuilder do that.</div><div style>- get it reveiewed</div><div style>- commit</div><div style><br></div><div style>
But I&#39;ll have to remember how to use combinator again (which will be much easier now that the combinator &quot;docs&quot; are on the Twisted wiki...thanks to whomever did that!)</div><div style><br></div><div style>Yes, I could probably use Bazaar, but so far every time I&#39;ve tried that, I&#39;ve ended up spending waaaaaay too much time just on the VCS.  I guess I have some kind of mental block with bzr.  I&#39;ll get over it someday I suppose.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im">
<br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra">4) Get someone to use something less hackish than what&#39;s currently building the Sphinx docs on the buildbot, and preferably in such a way that the results of those builds could be published somewhere and have persistent links.  Currently the results of what the Sphinx buildbot does are stored for a time, and then go away, so you&#39;ll see links to build results in some trac tickets that go nowhere, which is decidedly unhelpful.  My plan was that we&#39;d set up something where the Sphinx docs would get generated and published someplace for every buildbot build so that we could always have the current results for the lore to sphinx conversion for the tip of each branch.  I have no idea whether this is actually feasible or practical, but it seemed like it would be useful.</div>
</div></div></blockquote><div><br></div></div><div>OK, *this* sounds like really unnecessary turd-polishing ;-).  This builder is an interim step; the more interesting step is the builder that just builds the sphinx docs, in the same way that the current builder builds the lore docs.  Furthermore, it seems to be working fine.  Build results links that go nowhere are a known problem with buildbot, since it does eventually lose most history, and this type of history takes up a fair bit of disk space.</div>
</div></div></blockquote><div><br></div><div style>Well, it was mostly motivated by the fact that we were doing a lot of linking to build results that would then cease to exist for a while, and it really annoyed me.  It doesn&#39;t seem nearly as &quot;necessary&quot; to me now as it once did.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div class="im">
<br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra">5) Proceed with Sphinx docs being built from lore sources, making tweaks as necessary to lore2sphinx(ng) for as long as it took for the generated docs to be good enough to justify switching to Sphinx entirely.</div>
<div class="gmail_extra">6) Switch to Sphinx entirely.</div><div class="gmail_extra"><br></div><div class="gmail_extra">I really wasn&#39;t planning on trying to get people excited about switching to Sphinx again until 1) and 2) were at least &quot;mostly&quot; done (for certain values of done) and I had gone back to finish 3).</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">So.  I guess at this point the question is whether to try and go with what&#39;s there (lore2sphinx) or finish up the &quot;new stuff&quot; (lore2sphinx-ng + rstgen).  I think 3-6 in my above plan need to happen in any case, and I think those will be much easier with lore2sphinx-ng+rstgen.</div>
</div></div></blockquote><div><br></div></div><div>This decision is really determined by time estimates.</div><div><br></div><div>In any case, work out the sphinx release automation tool first, since we need that regardless of how we switch over</div>
</div></div></blockquote><div><br></div><div style>Got it.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div class="im"><br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr">
<div class="gmail_extra">IIRC, rstgen has support for most of the vanilla docutils elements, with the notable exception of tables (and maybe definition lists...can&#39;t recall whether I finished those).  It has a basic level of test coverage (of course you can never have too many tests) for rendering the elements individually, and some test for elements in combination (particularly nested lists).  Footnotes and Citations I think also need some work, which I have a plan for, but haven&#39;t implemented yet (i don&#39;t think).<br>
</div></div></div></blockquote></div><div class="im"><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra">
<br></div><div class="gmail_extra">The &quot;new&quot; lore2sphinx CLI tool needs more work, but is relatively straightforward.  Like the old tool, it&#39;s basically an elementtree processor, except instead of spitting out strings that get joined together (which granted was an unholy mess), it generates rstgen elements, which all have a .render() method.  After processing a Lore document, you shoudl end up with a rstgen.Document object.  You call it&#39;s render() method, which calls it&#39;s children&#39;s render() methods, etc. and it&#39;s turtles all the way down.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">The framework is there for the new CLI tool, it&#39;s mostly a matter of writing a bunch of short methods that take elementtree elements as input and return appropriate rstgen objects.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Obviously these tools aren&#39;t finished, but they produce much better output than the old version of lore2sphinx w.r.t. whitespace handling, paragraph wrapping, etc.</div>
</div></div></blockquote><div><br></div></div><div>Aesthetically, this appeals to me a lot more than going with the messiness of lore2sphinx. </div></div></div></blockquote><div><br></div><div><div>Me too.</div></div><div>
<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word"><div>
<div>But it is _not_ a requirement.</div></div></div></blockquote><div><br></div><div style>Understood.  Though I think it might be a practical requirement, even if it isn&#39;t a policy requirement.  If that makes sense.</div>
<div style> <br></div><div style><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">
<div><div class="im"><br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div dir="ltr"><div class="gmail_extra">Some of the code is still pretty messy, but nowhere near the train wreck that the current/old version of lore2sphinx is.  By which I mean it _can_ be cleaned up, it just hasn&#39;t been yet.  In particular there&#39;s some places in rstgen where the API is (to me at least) obviously awful, but I haven&#39;t gotten around to fixing it yet.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Please review the code.  Please feel free to ask questions if you&#39;re interested.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Personally, I&#39;ve gotten over being in a hurry about all this, and I think a robust tool is more likely to succeed in the long run, though finishing it may make the run a bit longer.  So I&#39;m for finishing lore2sphinx-ng+rstgen.</div>
</div></div></blockquote><div><br></div></div><div>I think a little false urgency might not hurt here :-).  I&#39;m not going to work on the tool - just writing these emails probably blew my Twisted development budget for the next two months ;-)</div>
</div></div></blockquote><div><br></div><div style>I can relate... :)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><div> - but I will do my best to quickly clear up any procedural what-needs-to-be-done questions unambiguously.  Please ping if anything gets you stuck.</div></div></div></blockquote>
<div><br></div><div style>I&#39;ll let you know.</div><div> </div></div>--<div>Kevin Horn</div>
</div></div>