From fdrake@acm.org Fri Oct 5 17:51:22 2001 From: fdrake@acm.org (Fred L. Drake) Date: Fri, 5 Oct 2001 12:51:22 -0400 (EDT) Subject: [Doc-SIG] [development doc updates] Message-ID: <20011005165122.33A8A28697@beowolf.digicool.com> The development version of the documentation has been updated: http://python.sourceforge.net/devel-docs/ Removed reference material for some long-obsolete Mac OS modules that have not been included in recent versions of MacPython. Added material on the proposed C API for weak reference objects; see the Python/C API Reference Manual: http://python.sourceforge.net/devel-docs/api/weakref-objects.html From fdrake@acm.org Sat Oct 6 07:09:45 2001 From: fdrake@acm.org (Fred L. Drake) Date: Sat, 6 Oct 2001 02:09:45 -0400 (EDT) Subject: [Doc-SIG] [development doc updates] Message-ID: <20011006060945.4C32828697@beowolf.digicool.com> The development version of the documentation has been updated: http://python.sourceforge.net/devel-docs/ Updates to add ReferenceError to the standard exceptions. From garth@deadlybloodyserious.com Mon Oct 8 05:13:21 2001 From: garth@deadlybloodyserious.com (Garth T Kidd) Date: Mon, 8 Oct 2001 14:13:21 +1000 Subject: [Doc-SIG] examples in reStructuredText spec In-Reply-To: <00ab01c147ff$5f68a290$f05aa8c0@lslp7o.int.lsl.co.uk> Message-ID: > .. Example:: > This is some *emphasised* text. > .. Gives:: > > This is some > > emphasised > text. That's cute! Regards, Garth. From garth@deadlybloodyserious.com Mon Oct 8 05:13:24 2001 From: garth@deadlybloodyserious.com (Garth T Kidd) Date: Mon, 8 Oct 2001 14:13:24 +1000 Subject: [Doc-SIG] auto-numbered footnote resolution In-Reply-To: Message-ID: > Automatic footnote numbering may not be mixed with manual footnote > numbering; it would cause numbering and referencing conflicts. > > Would such mixing inevitably cause conflicts? Only if someone accidentally uses the same number twice. Regards, Garth. From garth@deadlybloodyserious.com Mon Oct 8 05:13:27 2001 From: garth@deadlybloodyserious.com (Garth T Kidd) Date: Mon, 8 Oct 2001 14:13:27 +1000 Subject: [Doc-SIG] auto-numbered footnote resolution In-Reply-To: <00aa01c147ff$5e92b4f0$f05aa8c0@lslp7o.int.lsl.co.uk> Message-ID: > the *only* potential problem is when referring to a footnote > in a different document Just refer to it with #name? Aaaah -- the reader of the target might only know the number, not know the #name (if a name was even specified). I'm not sure I'm going to lose sleep over it, though. Regards, Garth. From jaffray@pobox.com Tue Oct 9 00:46:01 2001 From: jaffray@pobox.com (Alan Jaffray) Date: Mon, 8 Oct 2001 19:46:01 -0400 (EDT) Subject: [Doc-SIG] rST hyperlink syntax Message-ID: I'm generally quite impressed with rST, and look forward to using it extensively in my projects. However, I think the hyperlink syntax fails to achieve the stated goals in some cases, and improving it could make the markup even better. Example:: For more info, search the `Python DOC-SIG mailing list archives`_. .. _Python DOC-SIG mailing list archive: http://mail.python.org/pipermail/doc-sig/ The repetition of half a line of text has three problems. First, it's annoying to enter; not too annoying if you have a decent editor, but it's more work than it should be. Second, it's intrusive. It looks like markup. Third, it's error-prone. The above example is broken, because the hyperlink points to "...archives" and the target is "..archive". It's an error that's easy to make, and easy to miss, and longer repeated text makes for greater likelihood of error. Another example:: For more info, search the `Python DOC-SIG mailing list archive`_. Blah blah blah. Blah blah. Blah blah blah blah blah blah. Blah blah. Blah. Blah blah blah blah blah. Blah blah. Blah blah blahblah. Blah. Blah blah blah. Blah blah. Blah blah blah blah blah blah. Blah blah. Blah. Blah blah blah blah blah. Blah blah. Blah blah blahblah. Blah. The archive_ also has previous discussion of blah and blah. .. _Python DOC-SIG mailing list archive: http://mail.python.org/pipermail/doc-sig/ .. _archive: http://mail.python.org/pipermail/doc-sig/ We have to repeat the hyperlink target just to use different link text pointing to the same URL, and as before, redundancy causes intrusiveness, reduced ease of authoring, and potential maintenance errors (especially in large documents). I think the solution to both problems is to optionally separate link text from link name. Picking a random plausible syntax, the second might become:: For more info, search the `Python DOC-SIG mailing list archive`{archive}_. Blah blah blah. Blah blah. Blah blah blah blah blah blah. Blah blah. Blah. Blah blah blah blah blah. Blah blah. Blah blah blahblah. Blah. Blah blah blah. Blah blah. Blah blah blah blah blah blah. Blah blah. Blah. Blah blah blah blah blah. Blah blah. Blah blah blahblah. Blah. The archive_ also has previous discussion of blah and blah. .. _archive: http://mail.python.org/pipermail/doc-sig/ This seems much nicer. The first example could do it the same way, or if we wanted to allow it, something even easier:: For more info, search the `Python DOC-SIG mailing list archives`{}_. .. _: http://mail.python.org/pipermail/doc-sig/ Having a meaningful name is a good idea for most documents, but for quick messages - say, in email, or on discussion boards, or whatever - I think the anonymous-link option would be useful. Handling multiple anonymous-name links can be handled in the same manner as autonumbered footnotes. I'm picking the syntax out of the blue. The one shown above doesn't seem *bad*, but I haven't considered all the alternatives, and would welcome suggestions. I'm more concerned about the basic idea at this point. Thoughts? Alan From goodger@users.sourceforge.net Tue Oct 9 04:42:46 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Mon, 08 Oct 2001 23:42:46 -0400 Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: Message-ID: Alan Jaffray wrote: > I think the hyperlink syntax fails to achieve the stated goals in some > cases, and improving it could make the markup even better. Thanks for your input! > Example:: > > For more info, search the `Python DOC-SIG mailing list archives`_. > > .. _Python DOC-SIG mailing list archive: > http://mail.python.org/pipermail/doc-sig/ > > The repetition of half a line of text has three problems. First, it's > annoying to enter; not too annoying if you have a decent editor, but > it's more work than it should be. This syntax is replacing StructuredText's two alternatives:: 1: "hyperlink":http://uri.goes.here 2: "hyperlink", http://uri.goes.here I chose the current syntax (a variation on Setext's indirect hyperlinks) because the URI should be a hidden detail. Taking the URI out-of-line implies some kind of reference; using the hyperlink text itself is simplest. > Second, it's intrusive. It looks like markup. It *is* markup. :-) If you can suggest a less markup-like, less intrusive markup, please do. The markup you suggest is (IMO) even *more* intrusive though. > Third, it's error-prone. The above example is broken, > because the hyperlink points to "...archives" and the target is > "..archive". This error will be caught and reported by the hyperlink-resolution code (coming soon to a CVS tree near you). > It's an error that's easy to make, and easy to miss, > and longer repeated text makes for greater likelihood of error. True. The author is by no means forced to use long hyperlink phrases though. > Another example:: > > For more info, search the `Python DOC-SIG mailing list archive`_. ... > The archive_ also has previous discussion of blah and blah. > > .. _Python DOC-SIG mailing list archive: > http://mail.python.org/pipermail/doc-sig/ > .. _archive: > http://mail.python.org/pipermail/doc-sig/ Your example appears to jog my memory (but it could just be deja vu). I seem to recall thinking about (& possibly discussing here) or at least reading about this kind of construct:: .. _Python DOC-SIG mailing list archive: .. _archive: .. _Doc-SIG: http://mail.python.org/pipermail/doc-sig/ An indirect hyperlink target (a URI in its link block) may be preceded by a sequence of consecutive internal hyperlink targets (empty link blocks). They will all "point to" the same URI pointed to by the indirect hyperlink target. They effectively become synonyms, removing the need to duplicate the URI. Seems like a good idea. Unless there are valid objections, I'll add this detail to the spec. This should already "just work" for a sequence of all internal hyperlink targets (all empty link blocks). A transform will be needed to implement this for a last indirect URI hyperlink. I think the easiest way would be to copy the URI to all of the preceding elements. > I think the solution to both problems is to optionally separate link text > from link name. Picking a random plausible syntax, the second might become:: > > For more info, search the `Python DOC-SIG mailing list archive`{archive}_. ... > The archive_ also has previous discussion of blah and blah. > > .. _archive: http://mail.python.org/pipermail/doc-sig/ > > This seems much nicer. Not to me. It seems even more like markup than the existing syntax. The extra ``{archive}`` (whatever the actual syntax) is very intrusive: it detracts from the readability of the source text. The "hyperlink target synonyms" idea above should alleviate most of the perceived problems. > The first example could do it the same way, or if > we wanted to allow it, something even easier:: > > For more info, search the `Python DOC-SIG mailing list archives`{}_. > > .. _: http://mail.python.org/pipermail/doc-sig/ Interesting idea: "anonymous hyperlinks". A convenience worth consideration. I'd want to avoid the extra syntax if possible though [#]_. The ramifications need to be thought through, for ambiguity or conflicts with existing syntax. .. [#] Syntax idea: double underscores:: For more info, search the `Python DOC-SIG mailing list archives`__. .. __: http://mail.python.org/pipermail/doc-sig/ The extra underscore could serve the same function as the '#' in auto-numbered footnotes. Unobtrusive, unambiguous, but perhaps too subtle? Similarly to auto-numbered footnotes' "autonumber labels", the final word or words of the hyperlink phrase could optionally be used for the target:: .. __archives: http://mail.python.org/pipermail/doc-sig/ But why the *final* word(s)? Works in this case, but not all cases. Initial *or* final word(s)? Arbitrary subphrase? Getting complicated... Thanks again. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From tony@lsl.co.uk Tue Oct 9 12:02:14 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Tue, 9 Oct 2001 12:02:14 +0100 Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: Message-ID: <013e01c150b1$da4ac050$f05aa8c0@lslp7o.int.lsl.co.uk> Guido has pointed out in the past [1]_ that there is an uncomfortable tension between trying to say both "we can't require people to change their habits because we know they don't want to change their habits" and "then just change your habits to work around ". I think this is inevitable - David's job (with "help" from others) is to try to balance these two. .. [1] See http://aspn.activestate.com/ASPN/Mail/Message/579315, but please note that I'm rather hijacking the quote for my own purposes - Guido's point is different. > Alan Jaffray wrote: > I think the hyperlink syntax fails to achieve the stated > goals in some cases, and improving it could make the markup > even better. Strangely enough, he then makes exactly the sort of comment that I would probably have made if I had come into the debate at *this* stage, rather than having been around and watching for a while. Take that as compliment or insult - I'm not sure which! > Example:: > > For more info, search the `Python DOC-SIG mailing list > archives`_. > > .. _Python DOC-SIG mailing list archive: > http://mail.python.org/pipermail/doc-sig/ > > The repetition of half a line of text has three problems. > First, it's annoying to enter; not too annoying if you have > a decent editor, but it's more work than it should be. This is a valid grumble (and as such David addresses it), *but*... (excuse the rambling before I find a point to get to) One of the more important lessons I got from Knuth's TeX is the "if the result isn't what you want, rewrite it" rule. In the TeX instance (i.e., digital typesetting) this means that if you write a document and the typeset result has (for instance) a bad page break, it *may* be that the solution is to rewrite the text to obtain the layout you want (read Knuth himself for a better explanation of this sort of thing). In the example you've given, one can clearly do the same sort of thing (albeit without the complexity of doing typesetting!). For instance, simplistically:: For more info, search the Python DOC-SIG mailing list archives_. .. _archives: http://mail.python.org/pipermail/doc-sig/ (i.e., just "emphasising" the last word instead of the whole phrase). Indeed, if one is only interested in the "raw text" and not its final rendition by a transformation tool, or if one likes the "call-out" style of layout, one can even replace this with something like:: For more info, search the Python DOC-SIG mailing list archives[1]_. .. [1] http://mail.python.org/pipermail/doc-sig/ - a footnote *may* be more natural to how one sees the text flowing. A slightly more radical rewriting might give one:: For more info, search the Python Doc-SIG mailing list archives - either the "official_" archives, or (often easier to use) those at `Active State`_. .. _official: http://mail.python.org/pipermail/doc-sig/ .. _Active State: http://aspn.activestate.com/ASPN/Mail/ Browse/Threaded/doc-sig David has already addressed the more "technical" end of things (and I think his idea of allowing multiple "names" for a target may be a good one) - I hope this isn't a daft comment to go alongside that. Tibs -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ "How fleeting are all human passions compared with the massive continuity of ducks." - Dorothy L. Sayers, "Gaudy Night" My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From Juergen Hermann" Hi! FYI, Itamar Shtull-Trauring and I work on an XML layer on top of pydoc. = He uses it to generate static HTML pages via a XSL stylesheet, I do the = same but dynamically in a Python app server. Ciao, J=FCrgen -- J=FCrgen Hermann, Developer (jhe@webde-ag.de) WEB.DE AG, http://webde-ag.de/ From jaffray@pobox.com Wed Oct 10 02:00:51 2001 From: jaffray@pobox.com (Alan Jaffray) Date: Tue, 9 Oct 2001 21:00:51 -0400 (EDT) Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: Message-ID: Thanks for the thoughtful reply. :) > > Third, it's error-prone. The above example is broken, > > because the hyperlink points to "...archives" and the target is > > "..archive". > > This error will be caught and reported by the hyperlink-resolution code > (coming soon to a CVS tree near you). It's good to catch mistakes, but it's even better to avoid them in the first place. :) > > It's an error that's easy to make, and easy to miss, > > and longer repeated text makes for greater likelihood of error. > > True. The author is by no means forced to use long hyperlink phrases though. I disagree here. Link text should make sense without the immediate context - to do otherwise violates `W3C Accessibility Guidelines`_, and limits the effectiveness of various tools which scan documents for links - and this often requires that it be long. .. _W3C Accessibility Guidelines: http://www.w3.org/TR/WCAG10-HTML-TECHS/#link-text > Your example appears to jog my memory (but it could just be deja vu). I seem > to recall thinking about (& possibly discussing here) or at least reading > about this kind of construct:: > > .. _Python DOC-SIG mailing list archive: > .. _archive: > .. _Doc-SIG: http://mail.python.org/pipermail/doc-sig/ That would help, but I still think we need separate name and text. Suppose I'm writing a 2000-line document and refer to the reStructuredText specification 27 times. I'll want to use different link texts depending on the English context. Some of these (like "spec") will be too general to define globally without ambiguity, but I don't want to repeat the URL in every section I use it. Nor do I want to have to remember that I've used "reStructuredText specification" already but using "reStructuredText draft specification" requires me to go down to the bottom and define another synonym. So I'd like the link text to go along with a name which is in turn associated with the hyperlink, rather than the link text going to the hyperlink directly. But you're right that inlining the name is intrusive. Maybe we could instead have the link point to the name? reStructuredText is cool, see the `reStructuredText specification`_ to see how cool it is. .. _reStructuredText specification: rtxt-spec_ reStructuredText this, reStructuredText that, reStructuredText some other thing, the spec_ says reStructuredText does foo, reStructuredText. .. _spec: rtxt-spec_ [800 lines later] .. _rtxt-spec: http://structuredtext.sourceforge.net/spec/reStructuredText.txt Not sure what to do about ambiguity with URLs ending with an underscore. Quote one or the other? Use a different syntax? > Interesting idea: "anonymous hyperlinks". A convenience worth consideration. > I'd want to avoid the extra syntax if possible though [#]_. The > ramifications need to be thought through, for ambiguity or conflicts with > existing syntax. Even if we don't allow name/text separation, anonymous links would be an adequate solution for the problem of annoyingly long link text in most cases. It'd also be useful for very short or "disposable" documents. (One-line comments, message board posts, etc.) > .. [#] Syntax idea: double underscores:: > > For more info, search the `Python DOC-SIG mailing list archives`__. > > .. __: http://mail.python.org/pipermail/doc-sig/ Nice idea. I think this would be used often enough in practice that the design principles demand a simple syntax. Could we make it even simpler? :: For more info, search the `Python DOC-SIG mailing list archives`__. .. __http://mail.python.org/pipermail/doc-sig/ The ".. __" incantation is already punctuation-dense. Extending it to ".. __: " before getting around to actual content seems, to me, to be stretching into the realm of the silly, unnecessarily long and tedious for both author and reader. It's already unambiguous without the colon-space, assuming links starting with underscore have to be quoted. > Similarly to auto-numbered footnotes' "autonumber labels", the final > word or words of the hyperlink phrase could optionally be used for the > target:: > > .. __archives: http://mail.python.org/pipermail/doc-sig/ > > But why the *final* word(s)? Works in this case, but not all cases. > Initial *or* final word(s)? Arbitrary subphrase? Getting complicated... I'd go with arbitrary subphrase, zero or more full words, as an optional extension to the colon-less syntax above. It seems more natural to me - more like what a human would normally write - than either substring or first/last word. It could help catch maintenance errors getting links and targets mixed up. However, if it's considered important to only have one way to specify an anonymous-hyperlink target, I'd ditch subphrase-labels and use the colon-less form exclusively. Thanks, Alan From goodger@users.sourceforge.net Wed Oct 10 03:20:38 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Tue, 09 Oct 2001 22:20:38 -0400 Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: <013e01c150b1$da4ac050$f05aa8c0@lslp7o.int.lsl.co.uk> Message-ID: Tony J Ibbs (Tibs) wrote: > David's job (with "help" from others) is to try to balance these two. I thought I was doing this for *fun*. I'm certainly not making enough money off of it (none) to think of it as a *job*. I'd best quit now. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From goodger@users.sourceforge.net Wed Oct 10 03:31:04 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Tue, 09 Oct 2001 22:31:04 -0400 Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: Message-ID: Alan Jaffray wrote: > Thanks for the thoughtful reply. :) Any time. As I've said before, the more brains this stuff gets filtered through, the better the result. Everybody's gray matter catches & releases different stuff. > It's good to catch mistakes, but it's even better to avoid them in > the first place. :) It's hard to catch spelling errors in variable names in code (the equivalent of these reference names) without compiling or checking with something like PyChecker first. Somehow I don't see such checking happening, certainly not via syntax. Maybe Microsoft will include an integrated reStructuredText editor with Visual$tudio. (Damn! I forgot to get a patent!) > > The author is by no means forced to use long hyperlink phrases though. > > I disagree here. It may be good form to use long hyperlink phrases (thanks for the link), but there's still no *force* involved. ;-) > So I'd like the link text to go along with a name which is in turn > associated with the hyperlink, rather than the link text going to > the hyperlink directly. But you're right that inlining the name is > intrusive. Maybe we could instead have the link point to the name? > > reStructuredText is cool, see the `reStructuredText specification`_ > to see how cool it is. > > .. _reStructuredText specification: rtxt-spec_ ... > [800 lines later] > > .. _rtxt-spec: > http://structuredtext.sourceforge.net/spec/reStructuredText.txt I'm sure that "multiply indirect hyperlinks" have been discussed here before. Odd; they're not on the To Do list, not even with a "?". I'll look up the past arguments and add them (but with a "?": I still need to think the idea through). > Not sure what to do about ambiguity with URLs ending with an underscore. > Quote one or the other? Use a different syntax? If the hyperlink meaning of the trailing underscore is favored, then it would have to be escaped if a significant part of a relative URI (e.g. a file called ``rtxt-spec_``):: .. _reStructuredText specification: rtxt-spec\_ Otherwise, *all* such indirect references would have to be quoted:: .. _reStructuredText specification: `rtxt-spec`_ And even this could be ambiguous, were there a file called "\`rtxt-spec`_"! I think the former would be the better choice. > > .. [#] Syntax idea: double underscores:: > > > > For more info, search the `Python DOC-SIG mailing list archives`__. > > > > .. __: http://mail.python.org/pipermail/doc-sig/ > > Nice idea. I think this would be used often enough in practice that the > design principles demand a simple syntax. Could we make it even simpler? :: > > For more info, search the `Python DOC-SIG mailing list archives`__. > > .. __http://mail.python.org/pipermail/doc-sig/ I think orthogonality requires the full ``.. __:`` syntax. Without a colon, the URI looks too much like a hyperlink name > assuming links starting with underscore have to be quoted. A hyperlink (reference) name starting with an underscore would have to be quoted, but the corresponding target name wouldn't (the ``.. _`` provides enough context). So the abbreviated syntax would be ambiguous (in artificial cases, of course, but we don't want any holes at all). > I'd go with arbitrary subphrase, zero or more full words, as an optional > extension to the colon-less syntax above. It seems more natural to me - > more like what a human would normally write - than either substring or > first/last word. Perhaps. I'm not ready to pronounce one way or the other. How about writing a rEP (reStructuredText Enhancement Proposal)? (gotcha ;-) But seriously. I'm uncomfortable with the idea of using a hyperlink subphrase; it seems like an invitation to unintended duplication and guessing. How about combining the ideas instead? :: See the `Python Doc-SIG mailing list archives`__ .. __: archives_ [800 lines later:] .. _archives: http://mail.python.org/pipermail/doc-sig/ > It could help catch maintenance errors getting links > and targets mixed up. I don't follow. Please explain. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From tony@lsl.co.uk Wed Oct 10 09:43:00 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Wed, 10 Oct 2001 09:43:00 +0100 Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: Message-ID: <014b01c15167$91269230$f05aa8c0@lslp7o.int.lsl.co.uk> David Goodger wrote: > Tony J Ibbs (Tibs) wrote: > > David's job (with "help" from others) is to ... > > I thought I was doing this for *fun*. I'm certainly not > making enough money off of it (none) to think of it as > a *job*. I'd best quit now. No, no, no - you *are* doing it for fun! [1]_ .. [1] of course, this is all part of a cunning ploy on our parts, since we *know* it's actually hard work, but we're not going to tell you in case you decide to stop... Tibs -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ Give a pedant an inch and they'll take 25.4mm (once they've established you're talking a post-1959 inch, of course) My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From jaffray@pobox.com Wed Oct 10 23:58:56 2001 From: jaffray@pobox.com (Alan Jaffray) Date: Wed, 10 Oct 2001 18:58:56 -0400 (EDT) Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: Message-ID: > > > .. [#] Syntax idea: double underscores:: > > > > > > For more info, search the `Python DOC-SIG mailing list archives`__. > > > > > > .. __: http://mail.python.org/pipermail/doc-sig/ > > > > Nice idea. I think this would be used often enough in practice that the > > design principles demand a simple syntax. Could we make it even simpler? :: > > > > For more info, search the `Python DOC-SIG mailing list archives`__. > > > > .. __http://mail.python.org/pipermail/doc-sig/ > > I think orthogonality requires the full ``.. __:`` syntax. Without a colon, > the URI looks too much like a hyperlink name Good point. How about something even simpler and more visually distinctive as the anonymous hyperlink target syntax? :: For more info, search the `Python DOC-SIG mailing list archives`__. __ http://mail.python.org/pipermail/doc-sig/ I don't think losing unescaped underscore-underscore-space at the beginning of a line is a significant loss. In exchange, we get far less cumbersome syntax for a very simple and frequent construct. Doing simple things should be simple. Besides, I question whether the string ``.. __: `` has any place in a language which includes the goals of being intuitive and readable. :-) (I plan to use rST for my own projects, but my main intended use for it is as a standard markup language for my department, which is composed primarily of non-programmers. In general, if I find something that seems awkward or difficult to me, it's a pretty good indication that it'll be even more so for some of them.) Alan From jaffray@pobox.com Thu Oct 11 00:06:29 2001 From: jaffray@pobox.com (Alan Jaffray) Date: Wed, 10 Oct 2001 19:06:29 -0400 (EDT) Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: Message-ID: > > It's good to catch mistakes, but it's even better to avoid them in > > the first place. :) > > It's hard to catch spelling errors in variable names in code (the equivalent > of these reference names) without compiling or checking with something like > PyChecker first. Not quite the same. First, link text is natural language, and people are really bad about overlooking nonidentical synonyms in natural language. (If you want exact-to-the-character data entry of a document, give it to someone who doesn't speak the language...) Second, code is often edited in environments which minimize these errors (context menus, completion, debugger/editor integration) while rST is intended to be easy to use even without such support. But at this point I think the argument has diverged into irrelevancy. :-) > Maybe Microsoft will include an integrated reStructuredText > editor with Visual$tudio. (Damn! I forgot to get a patent!) Heh. I expect we'll see a rST emacs mode before too long. I'd write it myself if necessary, though I'd be happier if someone else got to it first, emacs-lisp gives me a rash. > > [subphrases] could help catch maintenance errors getting links > > and targets mixed up. > > I don't follow. Please explain. Well, I think I've come to the conclusion that they're more trouble than they're worth, the set of situations where they'd be useful is too specific. But here's what I was thinking of. I have a document like this:: Read the `Python Reference Guide`__ and `Introduction to Python`__. .. __reference: http://www.python.org/doc/current/ref/ref.html .. __introduction: http://www.python.org/doc/Introduction.html I change the paragraph to:: Start with `Introduction to Python`__, and if you want the full details, check out the `Python Reference Guide`__. Because of the qualifiers "reference" and "introduction", the links still point to the right targets. Without the qualifiers, I might forget to change the order of the links, and the "Introduction to Python" link would point to the Reference Guide and vice versa. But the situation (multiple hyperlinks with long text but easily distinguished short subphrases in a single paragraph) is unusual. Alan From garth@deadlybloodyserious.com Thu Oct 11 01:22:58 2001 From: garth@deadlybloodyserious.com (Garth Kidd) Date: Thu, 11 Oct 2001 10:22:58 +1000 Subject: [Doc-SIG] rST hyperlink syntax References: Message-ID: <002101c151ea$e57aec40$8301010a@beast2k> > Read the `Python Reference Guide`__ and `Introduction to Python`__. > > .. __reference: http://www.python.org/doc/current/ref/ref.html > .. __introduction: http://www.python.org/doc/Introduction.html > > I change the paragraph to:: > > Start with `Introduction to Python`__, and if you want the full > details, check out the `Python Reference Guide`__. > > Because of the qualifiers "reference" and "introduction", the links > still point to the right targets. Without the qualifiers, I might > forget to change the order of the links. I have to admit, I'm enjoying this thread. :) FWIW, if we lose the double-underscore in the text itself, this is something that (like most specific link resolution tasks, eg handling WikiNames) can be handled by the consumer. Consider:: Read the `Python Reference Guide`_ and `Introduction to Python`_. .. __reference: http://www.python.org/doc/current/ref/ref.html .. __introduction: http://www.python.org/doc/Introduction.html Becomes:: Read the Python Reference Guide and Introduction to Python . http://www.python.org/doc/current/ref/ref.html http://www.python.org/doc/Introduction.html All we need to ensure correct matching is a rule somewhat like: if a target's name doesn't match any link's refname, *and* the target's name begins with an underscore, use the nearest preceding link whose refname contains the target's name with the underscore stripped. How easy is that? :) > I plan to use rST for my own projects, but my main intended use > for it is as a standard markup language for my department, which > is composed primarily of non-programmers. Amen to that! The good news is, reST's clean separation between parser and consumer (or whatever we're calling either these days :) means you can usually include user-friendly features without having to change reST itself. Regards, Garth. From goodger@users.sourceforge.net Thu Oct 11 06:24:28 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Thu, 11 Oct 2001 01:24:28 -0400 Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: Message-ID: [David] > I think orthogonality requires the full ``.. __:`` syntax. Without a colon, > the URI looks too much like a hyperlink name [Alan] > How about something even simpler and more visually > distinctive as the anonymous hyperlink target syntax? :: > > For more info, search the `Python DOC-SIG mailing list archives`__. > > __ http://mail.python.org/pipermail/doc-sig/ Orthogonality again: two ways of spelling the same thing. I think the only way such a simplification would be acceptable is if it simplified the general case, thus becoming the one and only spelling. The general case, a phrase-named hyperlink target, does require a delimiter between the hyperlink phrase and the URI. The special case of anonymous hyperlinks isn't special enough to be exempt from the delimiter. > I don't think losing unescaped underscore-underscore-space at the > beginning of a line is a significant loss. It would add yet another independant markup symbol beginning a construct, "_". The syntax as it stands is "what you see is what you get (wherever possible)" plaintext. The only exception is the explicit markup token, ".. ", which covers all the advanced/tricky/behind-the-scenes cases. I'm loathe to add more exceptions, but let's examine the ramifications. Generalizing the simplification leads to the idea of dropping the ".. " from all hyperlink targets. In a sense, this adds complexity. Let's assume the simplification is worth this added complexity, and that there's no ambiguity from the new symbol. In addition to "tricky", ".. " also has a connotation of "hidden". Hyperlink targets are hidden in the final processed document, as are comments. Directives are likely to be visible in some form, but this simplification doesn't apply to them. Footnotes *are* visible though, and to be fair ("orthogonal"), they ought to benefit from the simplification too. But "[1]" without ".. " *is* absolutely ambiguous. Footnotes *cannot* be simplified this way. Does this disqualify the simplification? I don't know (too tired to think it through right now). I'm sure there are flaws in my logic. > In exchange, we get far less cumbersome syntax for a very simple and > frequent construct. An interesting idea, yes, but I'm not sure about its frequency. It wasn't missed until now. > Doing simple things should be simple. Besides, I question whether > the string ``.. __: `` has any place in a language which includes > the goals of being intuitive and readable. :-) Design goal #2 is the most relevant here: 2. Unobtrusive: The markup that is used should be as simple and unobtrusive as possible. The simplicity of markup constructs should be roughly proporional to their frequency of use. The most common constructs, with natural and obvious markup, should be the simplest and most unobtrusive. Less common contstructs, for which there is no natural or obvious markup, should be distinctive. I think directives, comments, footnotes, and hyperlink targets are clearly part of the "should be distinctive" group. > (I plan to use rST for my own projects, but my main intended use > for it is as a standard markup language for my department, which > is composed primarily of non-programmers. In general, if I find > something that seems awkward or difficult to me, it's a pretty > good indication that it'll be even more so for some of them.) In our realm of human-language text parsing, it's hard to balance the contradictory desires for simplicity, clarity, consistency, and orthogonality. Something's gotta give. A little education is all that's necessary to get past the less-than-ideal bits. A lot less education than if you standardized on HTML though! -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From goodger@users.sourceforge.net Thu Oct 11 06:24:54 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Thu, 11 Oct 2001 01:24:54 -0400 Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: <002101c151ea$e57aec40$8301010a@beast2k> Message-ID: [Alan re: semi-anonymous hyperlinks] > Well, I think I've come to the conclusion that they're more trouble > than they're worth I concur. For now, at least, they'll be relegated to the "Or Not To Do?" list. [Garth] > All we need to ensure correct matching is a rule somewhat like: if a > target's name doesn't match any link's refname, *and* the target's name > begins with an underscore, use the nearest preceding link whose refname > contains the target's name with the underscore stripped. > > How easy is that? :) Not. For one thing, I wouldn't want to restrict the matching to "the nearest preceding link". Imagine trying to debug a misbehaving bit of source text having to remember a rule like that. Ugh. :-} -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From Paul.Moore@atosorigin.com Thu Oct 11 10:18:57 2001 From: Paul.Moore@atosorigin.com (Moore, Paul) Date: Thu, 11 Oct 2001 10:18:57 +0100 Subject: [Doc-SIG] rST hyperlink syntax Message-ID: <714DFA46B9BBD0119CD000805FC1F53B01B5B05D@UKRUX002.rundc.uk.origin-it.com> From: Alan Jaffray [mailto:jaffray@pobox.com] > Good point. How about something even simpler and more visually > distinctive as the anonymous hyperlink target syntax? :: > > For more info, search the `Python DOC-SIG mailing list > archives`__. > > __ http://mail.python.org/pipermail/doc-sig/ > > I don't think losing unescaped underscore-underscore-space at the > beginning of a line is a significant loss. In exchange, we get far > less cumbersome syntax for a very simple and frequent construct. > Doing simple things should be simple. Besides, I question whether > the string ``.. __: `` has any place in a language which includes > the goals of being intuitive and readable. :-) Personally, I value orthogonality and regularity. In that context, ``.. __:`` is exactly right, as it follows the normal rules, and can be deduced from the other constructs available without too much problem. I've not studied the rST rules too closely for a while, but ``.. __:`` immediately rings bells with me. On the other hand, an unadorned ``__`` at the start of the line immediately makes me thing "what the heck is that?" Interestingly, the ``__`` anonymous hyperlink target notation immediately "worked" for me. I've been using it in the examples in this message, and completely forgot that it was "new" notation. Now *that's* an indication of a good extension, IMHO... Paul. From doug@hellfly.net Thu Oct 11 22:34:48 2001 From: doug@hellfly.net (Doug Hellmann) Date: Thu, 11 Oct 2001 17:34:48 -0400 Subject: [Doc-SIG] Announcing the latest version of HappyDoc, a Python documentation extraction tool. Message-ID: <20011011213448.VPUO10986.femail21.sdc1.sfba.home.com@there> Announcing the latest version of HappyDoc, a Python documentation extraction tool. HappyDoc is a tool for extracting documentation from Python source code. It differs from other such applications by the fact that it uses the parse tree for a module to derive the information used in its output, rather that importing the module directly. This allows the user to generate documentation for modules which need special context to be imported. More details are available on the HappyDoc home page at http://happydoc.sourceforge.net. Version 1.6 -- - **New Features** - Implemented a variety of modifications to support Python 2.0 syntax updates. - Implemented plugin system for docstring converters to allow module authors to write documentation using different markup styles. External files are recognized by their extension. The global default setting for docstrings can be passed on the command line, or a file-specific setting can be embedded in the input file (see below). DOC-SIG Note: This change paves the way to plugging in reST/dps/etc. That work starts next. - Updated the default markup syntax to StructuredTextNG, replacing the original StructuredText. Most users will not notice any difference, but backwards compatibility is maintained with a ClassicStructuredText plugin. - **Many contributed patches** - Patch to allow better support for Python 2.x 'import' statement syntax changes. - Patch to allow the base URL for documentation of Python standard libraries to be passed as a command line argument to HappyDoc. - Patch to eliminate invalid links to private classes which are not described. - Patch to elminate "decoration" lines in comment documentation. - Added output formatter and docset for creating UML diagrams in Dia format. - **Several resolved bugs** - Files with DOS line endings are handled properly. - Removed uses of the deprecated 'regex' module by the StructuredText parser. - Less than and greater than symbols in preformatted (example) sections of text are now rendered correctly. - **Other Changes** - Cosmetic changes to the way unit tests are run. - Fixed a problem with identifying "system modules" under versions of Python other than 1.5. - Sort the table of contents by the module name, not the file name. Download Download the latest version of HappyDoc from the home page on SourceForge: http://sourceforge.net/projects/happydoc From goodger@users.sourceforge.net Fri Oct 12 00:27:57 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Thu, 11 Oct 2001 19:27:57 -0400 Subject: [Doc-SIG] Announcing the latest version of HappyDoc, a Python documentation extraction tool. In-Reply-To: <20011011213448.VPUO10986.femail21.sdc1.sfba.home.com@there> Message-ID: Congratulations, Doug! Lots of cool features. It's downloaded, and I'll be taking a good look, putting it through its paces. > DOC-SIG Note: This change paves the way to plugging in > reST/dps/etc. That work starts next. Great to hear! -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From lists@itamarst.org Fri Oct 12 09:30:07 2001 From: lists@itamarst.org (Itamar Shtull-Trauring) Date: Fri, 12 Oct 2001 10:30:07 +0200 Subject: [Doc-SIG] Teud: XML based documentation generator Message-ID: <3BC6AA0F.2020003@itamarst.org> As Juergen Hermann previously mentioned, he and I are working on an XML-generating documentation generator. The output can then be converted to HTML or other formats using XSLT, etc.. One concept we use for deciding what to document or not I haven't seen anywhere else - everything in __all__ is considered a public interface. In later versions of python, __all__ is a list of strings - the names of objects that get imported when you do "from module import *". For example: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/python/python/dist/src/Lib/dircache.py?rev=1.10&content-type=text/vnd.viewcvs-markup This is a pretty clear match to the concept of being public. Homepage: http://www.twistedmatrix.com/users/jh.twistd/python/moin.cgi/TeudProject Download: http://itamarst.org/downloads/Teud-1.1.tar.gz Sample output of the default XSLT: http://twistedmatrix.com/users/jh/teud/Twisted/twisted.html From tony@lsl.co.uk Fri Oct 12 10:03:30 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Fri, 12 Oct 2001 10:03:30 +0100 Subject: [Doc-SIG] Announcing the latest version of HappyDoc, a Python documentation extraction tool. In-Reply-To: <20011011213448.VPUO10986.femail21.sdc1.sfba.home.com@there> Message-ID: <001101c152fc$c3236ec0$f05aa8c0@lslp7o.int.lsl.co.uk> Doug Hellmann wrote: > Announcing the latest version of HappyDoc, a Python > documentation extraction tool. Neat stuff. As David said, looking forwards to seeing the reST integration - essentially the first use of reST/DPS in a pre-existing piece of software, I think, so it's bound to be interesting. Tibs -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ Well we're safe now....thank God we're in a bowling alley. - Big Bob (J.T. Walsh) in "Pleasantville" My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From Keila - Curitiba - Pr" Olá! Veja meu site pessoal no "Tripod.com.br". Basta clicar no endereço abaixo. GARANTO SER SUI-GENERIS - CLIQUE ABAIXO: http://pastorinha.tripod.com.br/seminarista Mais de 61.000 internautas visitaram a PG., existe 7 Álbuns: Se você quiser, por favor, indique minha Home Page, a outros Internautas. Mais detalhes, se comunique, passe um e-mail, que responderei brevemente. Dentro da Home Page, ao lado das fotos, você poderá saber muito mais sobre mim! Obrigada. e-mail: pastorinha@ieg.com.br Beijos:- Keila - Curitiba - Pr - Podes falar comigo, direto dela. Brevemente uma Carta Aberta. http://pastorinha.tripod.com.br/seminarista "Esta mensagem é enviada com a complacência da nova legislação sobre correio eletrônico, Seção 301, Parágrafo (a) (2) (c) Decreto S. 1618, Título Terceiro aprovado pelo "105º Congresso Base das Normativas Internacionais sobre o SPAM". Este E-mail não poderá ser considerado SPAM quando incluir uma forma de ser removido. Para ser removido de futuros correios, simplesmente responda indicando no Assunto: REMOVER" From fdrake@acm.org Sun Oct 14 05:46:12 2001 From: fdrake@acm.org (Fred L. Drake) Date: Sun, 14 Oct 2001 00:46:12 -0400 (EDT) Subject: [Doc-SIG] [development doc updates] Message-ID: <20011014044612.90DE228697@beowolf.digicool.com> The development version of the documentation has been updated: http://python.sourceforge.net/devel-docs/ Added documentation for the PyMarshal_*() functions in the Python/C API. From jaffray@pobox.com Tue Oct 16 05:17:17 2001 From: jaffray@pobox.com (Alan Jaffray) Date: Tue, 16 Oct 2001 00:17:17 -0400 (EDT) Subject: [Doc-SIG] reStructuredText-to-HTML XSLT Message-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --1195431321-104844362-1003205837=:22140 Content-Type: TEXT/PLAIN; charset=US-ASCII Here's some XSLT to translate reStructuredText's XML output to HTML. It does a pretty good job with the exception of tables (which I haven't attempted to handle) and some lingering gratuitous whitespace (which is contained from rST's output, and can't be safely stripped). (It also leaves footnotes in the middle of the document; do we want them all at the end? I suppose so. Hadn't thought about it.) I'm not sure about the desired behavior for text which contains characters which have to be escaped in the XML. Leave them escaped, or unescape them so the user can intersperse HTML markup with rST markup? I chose the worst of both worlds by co-opting the "interpreted" tag to mean "contains HTML markup, should not be escaped when output to HTML". Ideas welcome. Alan --1195431321-104844362-1003205837=:22140 Content-Type: TEXT/PLAIN; charset=US-ASCII; name="rst.xsl" Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename="rst.xsl" PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NDQo8IS0t IGVkaXRlZCB3aXRoIFhNTCBTcHkgdjQuMCBVIChodHRwOi8vd3d3LnhtbHNw eS5jb20pIGJ5IEFsYW4gSmFmZnJheSAobm9uZSkgLS0+DQ0KPCEtLVhYWCAt IG5vdCB0b3VjaGluZyB0YWJsZXMuIGF0IGxlYXN0IG5vdCB5ZXQuIG90aGVy IG9taXNzaW9ucyBhcyB3ZWxsLi0tPg0NCjx4c2w6c3R5bGVzaGVldCB2ZXJz aW9uPSIxLjAiIHhtbG5zOnhzbD0iaHR0cDovL3d3dy53My5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-- From tony@lsl.co.uk Tue Oct 16 10:07:39 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Tue, 16 Oct 2001 10:07:39 +0100 Subject: [Doc-SIG] reStructuredText-to-HTML XSLT In-Reply-To: Message-ID: <004001c15622$0187d340$f05aa8c0@lslp7o.int.lsl.co.uk> > Here's some XSLT to translate reStructuredText's XML output to HTML. I'm afraid I'll have to leave it to someone else to evaluate that (but such stuff is intrinsically neat). > I'm not sure about the desired behavior for text which > contains characters which have to be escaped in the XML. > Leave them escaped, or unescape them so the user can > intersperse HTML markup with rST markup? I chose the worst > of both worlds by co-opting the "interpreted" tag to mean > "contains HTML markup, should not be escaped when output > to HTML". Ideas welcome. One side -------- I vote very strongly against doing anything other than quoting any "HTML" (subject to convincing argument otherwise, of course - and see below_). One of the serious problems with ST (and STNG) was that they allowed the user to intersperse HTML (actually, SGML) style tags within a document, on the assumption that these would be "passed through" to the final result, and have some predictable result. This *only* works[1]_ if there is a browser that understands the relevant tags at the far end (so, in general, ties one to HTML as an output format), and *also* potentially allows the user to "subvert" the workings of the documentation language. .. [1] Yes, I know in theory someone might be interpreting HTML, but that's fairly unlikely, and I chooose to term such an animal a "browser" for this purpose. The former is a problem if, for instance, one is wanting to represent the document as plain text, TeX, PDF, etc., etc. One does not want to have to write an HTML/XML/SGML understander to cope with random tags. The second is a well known problem in the LaTeX world (for instance) - using a package that is based on a powerful language (TeX) and still allows access to said language means that some (awkward) people will (attempt to) do "clever" things using said language - and this can cause things to go disastrously and obscurely wrong. The *sole* case I might give in on would be if the user had access to an appropriate role - for instance:: :html:`
` :xml:`` since there we are making them be *terribly* specific. But I don't think the definition of roles has been covered yet? .. below: And the other ------------- However. We have discussed *modes* for DPS/reST (was that the term?), where obviously "Python" is one such, and "book" might be another. I have suggested in the past that maybe "HTML" would be useful, so that we can allow preparation of HTML pages in a simple manner. In that case, it *might* be argued that one *is* only aiming at HTML as output, and thus might want to allow "subversion" of reST to do particular things (in particular, horizontal rules are very useful). So maybe in that one case one might want to relax the rules to allow "interpreted" text to work as you do. However, I think one would probably want a directive in the document to state this (David - is that right?) so that people would know that this document was not a "general" document, but targetted at a specific output form. Tibs -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ Give a pedant an inch and they'll take 25.4mm (once they've established you're talking a post-1959 inch, of course) My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From goodger@users.sourceforge.net Wed Oct 17 05:14:02 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Wed, 17 Oct 2001 00:14:02 -0400 Subject: [Doc-SIG] reStructuredText-to-HTML XSLT In-Reply-To: Message-ID: Thanks Alan. I'll put your XSLT file into the sandbox shortly. I'm falling behind lately: I also have Paul Wright's XSLT file and Ueli Schlaepfer's code to add to the projects. Sorry; I'll try to catch up quickly. Alan Jaffray wrote: > It does a pretty good job with the exception of tables (which I haven't > attempted to handle) and some lingering gratuitous whitespace (which > is contained from rST's output, and can't be safely stripped). I'm going to experiment with xml.dom.minidom to try to get better XML output wrt whitespace. The trouble is that newlines are interpreted as spaces in mixed content, so I've got to figure out a way to avoid newlines before & after inline markup. We may have to give up newlines between body elements also though. > (It also leaves footnotes in the middle of the document; do we want them > all at the end? I suppose so. Hadn't thought about it.) I think there will be several choices, but the tree transforms should take care of it. > I'm not sure about the desired behavior for text which contains characters > which have to be escaped in the XML. Leave them escaped, Yes. > or unescape them > so the user can intersperse HTML markup with rST markup? That way lies markup-dependence. > I chose the worst > of both worlds by co-opting the "interpreted" tag to mean "contains HTML > markup, should not be escaped when output to HTML". Ideas welcome. Tony J Ibbs (Tibs) wrote: > The *sole* case I might give in on would be if the user had access to an > appropriate role - for instance:: > > :html:`
` > :xml:`` Tony's suggestion is the way to go, for arbitrary markup. > However. We have discussed *modes* for DPS/reST (was that the term?), > where obviously "Python" is one such, and "book" might be another. I > have suggested in the past that maybe "HTML" would be useful, Might I suggest "web page" instead of "HTML" for the name of the Reader? ("Reader" is my currently favoured term for "input mode", although it may not fit this case.) > So maybe in that one case > one might want to relax the rules to allow "interpreted" text to work as > you do. However, I think one would probably want a directive in the > document to state this (David - is that right?) so that people would > know that this document was not a "general" document, but targetted at a > specific output form. Yes, a directive would be the way to change processing conditions, if necessary. Such "pragma" directives shouldn't be overused though. If a particular pragma directive becomes common, it's probably time to rethink the approach. > This *only* works[1]_ A small nit here -- you need a space before the footnote reference. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From goodger@users.sourceforge.net Wed Oct 17 05:26:23 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Wed, 17 Oct 2001 00:26:23 -0400 Subject: [Doc-SIG] horizontal rules & text divisions In-Reply-To: <004001c15622$0187d340$f05aa8c0@lslp7o.int.lsl.co.uk> Message-ID: Tony J Ibbs (Tibs) wrote: > (in particular, horizontal rules are very useful). >From rst-notes.txt: Wolfgang Lipp suggested adding horizontal rules (HTML
) to the syntax. A line of punctuation with a blank line before and after:: Para. ------------------------------------------------------------ Para. The problem is, HRs are purely presentational. What structural significance do they have? Tony's mention of HRs brought forward an idea from the nether regions of my cerebrum, relating to constructs commonly seen in novels and short fiction. Rummaging around in my copy of The Chicago Manual of Style, 14th ed., I found this confirmation (sect. 1.80): Instead of subheads, extra space or a type ornament between paragraphs may be used to mark text divisions or to signal changes in subject or emphasis. In other words, "anonymous sections"! *There's* the structural significance. An HTML Writer could render these text divisions as horizontal rules if it likes. Whaddy'all think? Worth adding to the spec? -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From jaffray@pobox.com Wed Oct 17 07:06:19 2001 From: jaffray@pobox.com (Alan Jaffray) Date: Wed, 17 Oct 2001 02:06:19 -0400 (EDT) Subject: [Doc-SIG] reStructuredText-to-HTML XSLT In-Reply-To: <004001c15622$0187d340$f05aa8c0@lslp7o.int.lsl.co.uk> Message-ID: Makes sense. However, given that the meaning of "interpreted" text is explicitly defined as being domain-specific, it seems to me that there *is* no "general" meaning for it. Perhaps it would be sensible to - have a directive to specify a default role for interpreted text - allow the reST processor to take an argument for the default role - issue a warning when processing documents with no default role which contain interpreted text with no explicitly specified role Passing through markup to all outputs loses generality; it makes no sense to say "this HTML will always be passed through unaltered" unless you know the output format is HTML. So the approach of my existing stylesheet is a bad one. However, a role which says "output this unaltered if the output format is HTML, otherwise ignore it" doesn't lose generality; other output formats still work and are unaffected by the HTML-specific instructions. Alan On Tue, 16 Oct 2001, Tony J Ibbs (Tibs) wrote: > However. We have discussed *modes* for DPS/reST (was that the term?), > where obviously "Python" is one such, and "book" might be another. I > have suggested in the past that maybe "HTML" would be useful, so that we > can allow preparation of HTML pages in a simple manner. In that case, it > *might* be argued that one *is* only aiming at HTML as output, and thus > might want to allow "subversion" of reST to do particular things (in > particular, horizontal rules are very useful). So maybe in that one case > one might want to relax the rules to allow "interpreted" text to work as > you do. However, I think one would probably want a directive in the > document to state this (David - is that right?) so that people would > know that this document was not a "general" document, but targetted at a > specific output form. From Paul.Moore@atosorigin.com Wed Oct 17 09:08:21 2001 From: Paul.Moore@atosorigin.com (Moore, Paul) Date: Wed, 17 Oct 2001 09:08:21 +0100 Subject: [Doc-SIG] horizontal rules & text divisions Message-ID: <714DFA46B9BBD0119CD000805FC1F53B01B5B06D@UKRUX002.rundc.uk.origin-it.com> From: David Goodger [mailto:goodger@users.sourceforge.net] > In other words, "anonymous sections"! *There's* the > structural significance. An HTML Writer could render > these text divisions as horizontal rules if it likes. > > Whaddy'all think? Worth adding to the spec? I like it. My writing style tends towards this type of "I want a biggish break here, but I don't want/need to name it" structure. Of course, no-one ever said my writing style was something that any sane markup should support :-) Paul. From tony@lsl.co.uk Wed Oct 17 09:53:04 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Wed, 17 Oct 2001 09:53:04 +0100 Subject: [Doc-SIG] horizontal rules & text divisions In-Reply-To: Message-ID: <004f01c156e9$22630d10$f05aa8c0@lslp7o.int.lsl.co.uk> David Goodger wrote: > Rummaging around in my copy of The Chicago Manual of Style, > 14th ed., I found this confirmation (sect. 1.80): > > Instead of subheads, extra space or a type ornament between > paragraphs may be used to mark text divisions or to signal > changes in subject or emphasis. Hmm. I certainly do come across books with "type ornaments" (and I have old memories of a group of us being very amused by the (then, at least) Mills&Boon [1]_ house style of a line of asterisks to indicate, erm, intimate moments). .. [1] Mass produced romance novels, in case you don't know - one friend read them to relax, and some were surprisingly good (especially given the low rate of pay one assumes). On the whole, I think this is probably worth allowing, if you're so minded (if you weren't, I probably wouldn't fight for it). It clearly translates well to HTML, and, as you say, matches something well in other media. I would consider, in the documentation, including that quote (since it clarifies exactly what is intended, and I assume it would come under "fair use"). Tibs [2]_ .. [2] You mentioned in passing I forgot a space in front of a footnote reference - strangely, I think I originally typed on and then removed it. Anyway, I keep learning... -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ Which is safer, driving or cycling? Cycling - it's harder to kill people with a bike... My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From tony@lsl.co.uk Wed Oct 17 09:53:00 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Wed, 17 Oct 2001 09:53:00 +0100 Subject: [Doc-SIG] reStructuredText-to-HTML XSLT In-Reply-To: Message-ID: <004e01c156e9$1fc75390$f05aa8c0@lslp7o.int.lsl.co.uk> David Goodger wrote: > I'm going to experiment with xml.dom.minidom to try to get > better XML output wrt whitespace. The trouble is that > newlines are interpreted as spaces in mixed content, so > I've got to figure out a way to avoid newlines before & > after inline markup. We may have to give up newlines between > body elements also though. Hmm. If I understand what you're saying, then surely one just needs to emit XML without putting in any extraneous whitespace? We already have "pretty" mode, which can produce XML that is aimed at a human (i.e., has indentation, etc.), but I don't see why one shouldn't represent the tree:: Some text more text. (to invent an artifical and wrong example) as the XML:: Some text more text. In other words, the only whitespace outside <...> is that which the user typed... Tibs -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ Give a pedant an inch and they'll take 25.4mm (once they've established you're talking a post-1959 inch, of course) My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From goodger@users.sourceforge.net Wed Oct 17 23:59:27 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Wed, 17 Oct 2001 18:59:27 -0400 Subject: [Doc-SIG] reStructuredText-to-HTML XSLT In-Reply-To: Message-ID: Alan Jaffray wrote: > Perhaps it would be sensible to > > - have a directive to specify a default role for interpreted text > - allow the reST processor to take an argument for the default role > - issue a warning when processing documents with no default role > which contain interpreted text with no explicitly specified role Yes, something like this sounds reasonable. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From goodger@users.sourceforge.net Thu Oct 18 00:05:25 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Wed, 17 Oct 2001 19:05:25 -0400 Subject: [Doc-SIG] reStructuredText-to-HTML XSLT In-Reply-To: <004e01c156e9$1fc75390$f05aa8c0@lslp7o.int.lsl.co.uk> Message-ID: Tony J Ibbs (Tibs) wrote: > Hmm. If I understand what you're saying, then surely one just needs to > emit XML without putting in any extraneous whitespace? We already have > "pretty" mode, which can produce XML that is aimed at a human (i.e., has > indentation, etc.) And we have "raw" mode which doesn't do indentation but still inserts newlines, which count as extraneous whitespace. > In other words, the only whitespace outside <...> is that which the user > typed... I've modified quicktest.py to: - not add newlines in "raw" or "styled" modes, and - accept a stylesheet file name for styled mode so we can try out the offerings easily The resultant .xml file will be of the "big blob of text" variety, but since it's not for human consumption that's OK. Trying to get something "semi-pretty" but still "raw" enough to avoid the extraneous whitespace problem would be a pain that isn't worthwhile right now (if ever). -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From jaffray@pobox.com Thu Oct 18 00:37:02 2001 From: jaffray@pobox.com (Alan Jaffray) Date: Wed, 17 Oct 2001 19:37:02 -0400 (EDT) Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: Message-ID: > > __ http://mail.python.org/pipermail/doc-sig/ > > Orthogonality again: two ways of spelling the same thing. I think the only > way such a simplification would be acceptable is if it simplified the > general case, thus becoming the one and only spelling. We can use the leading ``__ `` to improve other cases. The leading ``.. `` is currently heavily overloaded and somewhat ambiguous:: .. __: http://somewhere anonymous uri .. _blah: http://somewhere named uri .. _blah: anchor .. [blah] http://somewhere footnote .. blah: http://somewhere comment .. blah:: http://somewhere directive Anchors and named URIs are entirely different - one is a marker of a particular position in the document, the other associates a name with an external resource and has identical semantics regardless of its position in the document - yet they have the same syntax. Comments are freeform, unless they happen to start with an underscore, in which case they can't contain a colon on the first line. All of them start with a comment syntax intended to imply "hidden", except that footnotes usually appear in visible output, and link URLs sometimes do. IMHO, the attempt to cram these various constructs into ``.. `` seems like a mess, with very little advantage. If we ditch that requirement:: __ http://somewhere anonymous uri __ blah: http://somewhere named uri __ _blah anchor __ [blah] blah blah footnote .. blah: http://somewhere comment .. directive:: foo directive Anonymous URIs are much shorter. Named targets are shorter and more readable. Anchors are shorter, no longer look like refuris, and don't have the misleading colon which leads one to expect another argument, containment of a block, or both. Everything which can be linked to starts with ``__ ``, and we've strongly established underscore as meaning "link" (as opposed to ``.. `` which means "hidden"), so we've improved the mnemonic value. ``.. `` is less overloaded, so comments are less constrained by potential ambiguity with other constructs. There's a potential ambiguity between anchors and anonymous URIs starting with an underscore or square bracket. The URI would have to be escaped in that case; no big deal. There's potential for human confusion between anonymous and named URIs, but cases where this is even a possibility seem extremely unlikely in practice. (I suppose you could overlook the lack of a space and mistake the anonymous URI ``news:comp.lang.python`` for the URI ``comp.lang.python`` named ``news``, but that seems highly unlikely, and that's the worst realistic example I can construct.) I'll confess that I don't buy the argument that "allowing explicit markup to start with something other than ``.. `` adds complexity". Keeping the same number of constructs while making some of them simpler seems like a reduction of complexity to me, and I don't think consistency has been harmed. But even if you do believe it's slightly more complex, I think there are enough advantages to justify it. I'd actually prefer a still different syntax, but it's further out in left field, since it requires changing some connotations. :: .. http://somewhere anonymous uri .. blah: http://somewhere named uri .. _blah anchor .. [blah] blah blah footnote ## blah: http://somewhere comment !! directive: foo directive ``##`` strongly evokes "comment" for those familiar with any of a variety of scripting languages. It doesn't look hidden, but having comments look hidden is a mixed blessing -- IMHO comments *should* jump out at you. This isn't an uncommon common stylistic preference; for evidence, note that ``#`` and ``/* */`` and ```` are fairly aggressive characters, and many text editors default to displaying comments in bright red or otherwise emphasized text. Relatively few languages use low-key markup like ``..`` or ``--`` for comments. ``!!`` is intended to evoke "something odd or surprising is happening here". It may also evoke shell escapes for a few hard-core Unix folks. By separating out comments from directives, we remove ambiguity, and directives can lose their wartlike double-colon. ``.. `` loses the "hidden" meaning and instead means "leading up to" or "side note", and is thus used for targets. I believe it evokes this as strongly as "hidden" in uninitiated users. (At least, it did so for me. Other people I've asked seem to have no resonance with any of these associations.) It's cleaner to read and easier to type than either ``__ `` or various constructs starting with ``.. _``, which is a significant advantage given its frequency... ...alternately, we could lose ``.. `` entirely. It has ambiguity issues, as in this paragraph, and ``__ `` does have the edge in mnemonic value since we're already using underscore for links. (regarding anonymous hyperlinks) > An interesting idea, yes, but I'm not sure about its frequency. It wasn't > missed until now. Keep in mind that you're talking to a very unusual user base, if your goals for reST include having it be a general-purpose language for short web pages and other documents. Program documentation tends to be dense on certain types of markup - like lists, for example, which is part of why you have five kinds of lists defined in the core spec - and light on other kinds - like hyperlinks, especially hyperlink targets with long link text, since much what you're linking on are things like variable and function names, which tend to be short and which will probably have implicit targets defined through other document structure. I did some grepping through the reST distribution and my department's intranet website, looking at usage patterns. It's interesting. +-----------+----------+------------+-----------+ | | Size | List items | Targets | +===========+==========+============+===========+ | reST docs | 198K | 469 | 39 | +-----------+----------+------------+-----------+ | website | 794K | 1779 | 1355 | +-----------+----------+------------+-----------+ We use explicit link targets about **10 times** as heavily as you do. [#] The link texts were generally longer as well. This may explain our relative levels of concern about the current target syntax. .. [#] These numbers are after factoring out multiple links within a document pointing to the same target, which would be written as a single target in reST. People have a lot of different usage patterns. A group of programmers - let alone a group of programmers of a particular language in a particular interest group - will not exhibit all the patterns that will come up in a broader group. My guess is that if you were, say, talking to a Zope SIG and trying to replace StructuredText as a standard markup for Zope, rather than talking to a Python SIG and trying to institute a standard for docstrings, you would have heard more concerns about target syntax by now. > In our realm of human-language text parsing, it's hard to balance the > contradictory desires for simplicity, clarity, consistency, and > orthogonality. Something's gotta give. A little education is all that's > necessary to get past the less-than-ideal bits. A lot less education > than if you standardized on HTML though! Yeah, but they already *know* HTML... (*sigh*) Everyone and their monkey knows HTML. We've got a couple dozen people who know stuff that should be written down but are too busy to do it. We want to encourage them to write this stuff down. Giving them something which makes doing it quicker and less annoying, with the nontrivial side benefits of providing richer structure for tools to index and readable plaintext for use in applications that need it, would be a huge win. Unfortunately this means we're limited to about a two-minute learning curve, and tolerance for anything that's less convenient or efficient than what they already know will be extremely low. I showed STX to a couple of them, and one of the first things they commented on as being really cool was the hyperlink syntax. They use links all the time, and writing and reading :: "Python home page":http://www.python.org instead of :: Python home page is a clear and tangible win. (Even if they didn't accidentally transpose the "a" and the "/" in the closing tag thus accidentally including the rest of the document in the link and requiring them to curse a lot and then go back and fix it. :-) ) Of course, this particular syntax also leads to problems further down the road, which is why I'm talking with you rather than just using STX. I could probably sell them on :: `Python home page`__ __ http://www.python.org instead, but :: `Python home page`__ .. __: http://www.python.org is not a clear win, and `Python home page`_ .. _Python home page: http://www.python.org is right out. We'll have cases where named links will be useful, but we'll have many other cases where names are pointless, and I believe the latter are a large majority for most of our docs. For what it's worth, the other place I'm hoping to use reST has even *less* patient and trainable users. It's an online journal and discussion site. There are a few hundred thousand users, and the median user is a 16-year-old girl with no technical skills (except some basic HTML) who spends a couple of hours a week on the site complaining that no one really understands her. But reST is still very close to being a perfect fit for the application. I'd also like to see a clearly-specified markup completely displace STX, ending STX `dialect proliferation`_ in Zope once and for all. reST won't do this unless it's a clear win for all current STX users, which includes eliminating all areas in which reST is more awkward than STX. As far as I can see, hyperlink syntax is the only such area. Thanks, Alan .. _dialect proliferation: http://www.zope.org/Members/jim/StructuredTextWiki/DialectProliferation From goodger@users.sourceforge.net Thu Oct 18 05:19:59 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Thu, 18 Oct 2001 00:19:59 -0400 Subject: [Doc-SIG] updates Message-ID: I've added Paul Wright's and Alan Jaffray's XSL style sheet files to the reStructuredText sandbox: http://structuredtext.sourceforge.net/sandbox/ I've also updated the DPS and reStructuredText specs. Snapshot of the everything are available: - DPS code & spec: http://docstring.sourceforge.net/dps-snapshot.tgz - reStructuredText code & spec: http://structuredtext.sourceforge.net/rst-snapshot.tgz - reStructuredText sandbox: http://structuredtext.sourceforge.net/rst-sandbox-snapshot.tgz -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From goodger@users.sourceforge.net Thu Oct 18 05:40:06 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Thu, 18 Oct 2001 00:40:06 -0400 Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: Message-ID: Alan brings up some good points about usability. I will be mulling it all over for a while before I respond in detail. I would very much like to hear what others think. Meanwhile, a minor point I'd like to clarify: Alan Jaffray wrote: > I'll confess that I don't buy the argument that "allowing explicit markup > to start with something other than ``.. `` adds complexity". ... > Keeping the same number of constructs while making some of them simpler seems > like a reduction of complexity to me, It's *one more* distinct construct for the parser to catch (and the author & reader to remember), not the same number, therefore one construct more complex. I meant that adding another line-starting construct adds complexity in and of itself: one more string that a line can't otherwise start with. This added initial complexity may be offset by the benefits it offers, in which case there would be a net gain. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From goodger@users.sourceforge.net Thu Oct 18 05:47:27 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Thu, 18 Oct 2001 00:47:27 -0400 Subject: [Doc-SIG] updates In-Reply-To: Message-ID: I should mention that I've added the following to the reStructuredText spec: chained hyperlinks, new indirect hyperlinks (hyperlink targets referring to other hyperlink targets; what used to be called "indirect hyperlinks" are now "external hyperlinks", i.e. the ones pointing to URIs), and anonymous hyperlinks. http://structuredtext.sourceforge.net/spec/reStructuredText.txt -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From tony@lsl.co.uk Thu Oct 18 10:08:47 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Thu, 18 Oct 2001 10:08:47 +0100 Subject: [Doc-SIG] updates In-Reply-To: Message-ID: <006b01c157b4$7ef5c3d0$f05aa8c0@lslp7o.int.lsl.co.uk> > I should mention that I've added the following to the > reStructuredText spec: ...list omitted... OK, so that means the quickref is now out of date - it might be worth adding a note to some TODO list somewhere? I'll add it to my mental calendar, but if someone (David?) wants to update it separately I shan't be offended - efforts to get round to working on coding at home in the evening have failed of late (but paradoxically might have more chance next week when my mother is visiting). Tibs -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ Give a pedant an inch and they'll take 25.4mm (once they've established you're talking a post-1959 inch, of course) My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From tony@lsl.co.uk Thu Oct 18 10:46:02 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Thu, 18 Oct 2001 10:46:02 +0100 Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: Message-ID: <006c01c157b9$b3266a10$f05aa8c0@lslp7o.int.lsl.co.uk> Alan Jaffray wrote a good description of two alternate proposals for handling hyperlinks, comments and directives somewhat differently. One caveat - Alan says, in reference to things starting with ``..``: > All of them start with a comment syntax intended > to imply "hidden", That's not my reading - I read them as "special" things, not "hidden" things. Anyway, here we go. I'm afraid the following is very much "stream of consciousness", rather than a reasoned discussion... Current scheme, scheme 0: > .. __: http://somewhere anonymous uri > .. _blah: http://somewhere named uri > .. _blah: anchor > .. [blah] http://somewhere footnote > .. blah: http://somewhere comment > .. blah:: http://somewhere directive Alan's scheme 1 [1]_: > __ http://somewhere anonymous uri > __ blah: http://somewhere named uri > __ _blah anchor > __ [blah] blah blah footnote > .. blah: http://somewhere comment > .. blah:: foo directive Alan's scheme 2 [1]_: > .. http://somewhere anonymous uri > .. blah: http://somewhere named uri > .. _blah anchor > .. [blah] blah blah footnote > ## blah: http://somewhere comment > !! blah: foo directive .. [1] I took the liberty of replacing "directive" by "blah" to make comparison more blatant. For what it's worth, I am almost totally unable to decide whether his Scheme 1 is a good idea or not - his arguments are good, and it really comes down to style (and I remember when I thought what David was proposing was odd). I think I'd give it a cautious +0 (but I have to bear in mind, given Alan's later comments, that I'm the sort of person who is happy to write HTML and TeX, not to mention several different programming languages, so may not be a good judge in his constituency). Scheme 2 I find less "nice" - partly because "##" is **TOO** intrusive (I want comments to be that - stuff that can be ignored, because it's extra), and partly because "!!" *doesn't* jump out at me in most fonts I am likely to be using to read raw reST text - ".." is actually much more visible. The *idea* of separating the one form of ".." into three forms I don't *particularly* object to, but I suspect that David will have cogent arguments about "learning 3 things instead of 1". And if we can't *find* 3 things that everyone is happy with... I still remember when I finally got David's idea that "we'll delimit the *odd* stuff about a document with one symbol, so that the eye can spot it easily" (and, implicitly, just by running down the left margin of the text, which is a fairly natural thing to do). One does have to be careful about diluting that ability too much. Hmm - having just pasted the three schemes next to each other at the top of this email (interactivity, this is!), I must admit that scheme 1 just doesn't *look* as nice to me - those underscores feel fairly intrusive. I must admit that I don't particularly see the advantage, in scheme 2, of: > .. blah: http://somewhere named uri > .. _blah anchor over the equivalent entries in scheme 0 - I think that scheme 0 definitely scores here in having consistency for targets. And that begins to lead me back to David's argument - that consistency is a Good Thing (since it gives fewer odd cases to rememeber). In which case, maybe ``#_`` and ``.. _#:`` would be better cases for anononymity, for consistency with "anonymous" footnotes. Hmm. No, for myself I think I've worked back around to liking David's compromise, scheme 0 (albeit I can't remember if ``#_`` was discussed earlier, so perhaps modulo that discussion). But that doesn't address Alan's problem of users with *lots* of hyperlinks, and a reluctance to type a longer sequence of (apparently, to them) meaningless punctuation characters. *Maybe* the "correct" solution, to satisfy Alan's userbase's perceived reluctance to type (and that's evidently a common human flaw - I cite Unix shell commands!) is yet another variant: Tibs' proposal, scheme 3: .. http://somewhere anonymous uri .. _blah: http://somewhere named uri .. _blah: anchor .. [blah] http://somewhere footnote .. blah: http://somewhere comment .. blah:: http://somewhere directive The sole change that this makes to scheme 0 is to say that comments may not start with (something that looks like) a URI. We already know they may not start with something that looks like a directive, so this may not be *too* onerous. The disadvantage is that we've lost the initial "_", which served as a hint that this was a target URI - but then we don't have that for footnotes (in that case, because losing the underscore makes the footnote look more like a footnote). OK. So my currrent stance is probably: - scheme 0 - status quo - status quo is good - scheme 1 - not sure - scheme 2 - not sure - scheme 3 - prefer this to schemes 1 and 2 Tibs -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ "Bounce with the bunny. Strut with the duck. Spin with the chickens now - CLUCK CLUCK CLUCK!" BARNYARD DANCE! by Sandra Boynton My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From paul.wright@pobox.com Thu Oct 18 14:40:42 2001 From: paul.wright@pobox.com (Paul Wright) Date: Thu, 18 Oct 2001 14:40:42 +0100 (BST) Subject: [Doc-SIG] reStructuredText-to-HTML XSLT In-Reply-To: Message-ID: On Wed, 17 Oct 2001, David Goodger wrote: > I'm going to experiment with xml.dom.minidom to try to get better XML output > wrt whitespace. The trouble is that newlines are interpreted as spaces in > mixed content, so I've got to figure out a way to avoid newlines before & > after inline markup. We may have to give up newlines between body elements > also though. I ended up hacking the quicktest.py script so the delimiters were all null strings: def _rawxml(input, document): return document.asdom().toprettyxml('', '') That seems to work. > > (It also leaves footnotes in the middle of the document; do we want them > > all at the end? I suppose so. Hadn't thought about it.) > > I think there will be several choices, but the tree transforms should take > care of it. I'm not sure whether tree transformations refers to XSLT or to ReST transforming its tree before output, but XLST can put them at the end. The latest sheet I've got does this. It also does autonumbered footnoes, via the joys of XPath. I also had a go at tables and got those working to my satisfaction. The new sheet is at . I guess your stylesheet contributors should have a look at other peoples' sheets and think about merging them: Alan's done a few things I've not done and vice versa (feel free to mail me, Alan). I'll have a look at the other sheets when I've got a moment. -- ----- Paul Wright ------| "Well," said Aslan, "I suppose we could try lasers." -paul.wright@pobox.com--| http://pobox.com/~pw201 | From Juergen Hermann" Message-ID: On Thu, 18 Oct 2001 00:19:59 -0400, David Goodger wrote: >I've added Paul Wright's and Alan Jaffray's XSL style sheet files to th= e >reStructuredText sandbox: BTW, take a look at http://purl.net/wiki/python/TeudViewer which integrates 4XSLT, MoinMoin and Teud (a pydoc xml extension). I pla= n to add DPS to the mix. ;) Ciao, J=FCrgen -- J=FCrgen Hermann, Developer (jhe@webde-ag.de) WEB.DE AG, http://webde-ag.de/ From fdrake@acm.org Thu Oct 18 21:10:34 2001 From: fdrake@acm.org (Fred L. Drake) Date: Thu, 18 Oct 2001 16:10:34 -0400 (EDT) Subject: [Doc-SIG] [development doc updates] Message-ID: <20011018201034.72D8E28697@cj42289-a.reston1.va.home.com> The development version of the documentation has been updated: http://python.sourceforge.net/devel-docs/ Documentation as packaged with Python 2.2 beta 1. From fdrake@acm.org Thu Oct 18 22:00:20 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Thu, 18 Oct 2001 17:00:20 -0400 Subject: [Doc-SIG] Python 2.2 beta 1 documentation Message-ID: <15311.17124.615391.305548@grendel.zope.com> The Python 2.2 beta 1 documentation is now available in the usual places. The HTML packages are there as always, and one new package: a version for the iSilo document reader for PalmOS devices (see www.iSilo.com). It has problems still, but as long as you navigate by hyperlinks it should work just fine. ;-) If people are interested in this format I can work on solving the problems with it, so please let me know if you think you'll be interested in actually using docs in this format. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From goodger@users.sourceforge.net Fri Oct 19 04:04:03 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Thu, 18 Oct 2001 23:04:03 -0400 Subject: [Doc-SIG] rST hyperlink syntax In-Reply-To: <006c01c157b9$b3266a10$f05aa8c0@lslp7o.int.lsl.co.uk> Message-ID: I've posted "Reworking Explicit Markup", a new section from alternatives.txt__, separately from this discussion. It contains an organized analysis of the current and proposed syntaxes. .. __: http://structuredtext.sourceforge.net/spec/alternatives.txt [Alan] > Anchors and named URIs are entirely different - one is a marker of a > particular position in the document, the other associates a name > with an external resource and has identical semantics regardless of > its position in the document - yet they have the same syntax. Whether they're "entirely different" or quite similar is a matter of perception. (And terminology! [#]_) Internal hyperlink targets (called "anchors" above), external targets [#]_ ("named URIs"), and indirect targets associate a hyperlink name with a destination. The destination for an internal hyperlink is a position inside the document, while an external hyperlink's destination is a URI. This difference is reflected in the link block. .. [#] Call them internal/external/indirect "hyperlink targets" and they seem to have much more in common than calling them by completely different names. Let's get our terminology straight. Please see "Reworking Explicit Markup", posted separately. .. [#] Note that I recently changed the name from "indirect hyperlink target" to "external hyperlink target", since adding real indirect targets, e.g. ``.. _target: reference_``. An anonymous hyperlink target can be external, internal, or indirect. I don't see much use for anonymous internal hyperlink targets though. Another way to think of them is with regards to the hyperlink reference, the other end of the link. The target of ``hyperlink_`` in the text may be internal or external, directly or indirectly. There's no distinction at the reference. > Comments are freeform, unless they happen to start with an > underscore, in which case they can't contain a colon on the first > line. Stated that way, it sounds complicated, much worse than it actually is. There's specific syntax for hyperlink targets, footnotes, and directives. Anything not matching that syntax is a comment. > All of them start with a comment syntax intended to imply "hidden", > except that footnotes usually appear in visible output, and link > URLs sometimes do. [Tony] > That's not my reading - I read them as "special" things, not > "hidden" things. I agree. The explicit markup start (not "comment syntax"), ".." at the beginning of a block, indicates "exceptional" or "special". Again, a matter of perception. At present, there is a two-level syntax. First-level syntax is for the common, easily recognizable constructs: the "what you see is what you get" syntax. The explicit markup syntax is the one exception; it opens up a second-level syntax, generally more abstract and less representational, for special constructs. The first question here is, do we keep two levels of syntax, or do we (at least parially) flatten them by making new first-level syntax for all the second-level constructs? If we choose to keep the two levels, the next question is: can we modify the second-level syntax to make certain constructs simpler, and how? [Alan] > IMHO, the attempt to cram these various constructs into ``.. `` > seems like a mess, with very little advantage. If we ditch that > requirement:: > > __ http://somewhere anonymous uri > __ blah: http://somewhere named uri > __ _blah anchor > __ [blah] blah blah footnote > .. blah: http://somewhere comment > .. directive:: foo directive > > Anchors are shorter, no longer look like refuris, and don't > have the misleading colon which leads one to expect another argument, > containment of a block, or both. Again, a matter of perception. I don't consider the colon on internal targets to be misleading at all. ``.. _a:`` says "the hyperlink 'a' refers to whatever comes next", be it URI, reference, or a location in its own document. > Everything which can be linked to starts with ``__ ``, Good, except for the inconsistent internal target ("anchor"), which has an extra underscore. > There's a potential ambiguity between anchors and anonymous URIs > starting with an underscore or square bracket. The URI would have to > be escaped in that case; no big deal. It's another exception. > There's potential for human confusion between anonymous and named > URIs I wouldn't worry about that. The presence or absence of a space is immediately visible and significant to human eyes. > I'd actually prefer a still different syntax, but it's further out > in left field, since it requires changing some connotations. :: > > .. http://somewhere anonymous uri > .. blah: http://somewhere named uri > .. _blah anchor > .. [blah] blah blah footnote > ## blah: http://somewhere comment > !! directive: foo directive > > ``##`` strongly evokes "comment" for those familiar with any of a > variety of scripting languages. It doesn't look hidden, but having > comments look hidden is a mixed blessing -- IMHO comments *should* > jump out at you. I'm neutral on that: +1 for "comment" connotation, -1 for obtrusiveness of "##", -0 for addition of another first-level construct. > ``!!`` is intended to evoke "something odd or surprising is > happening here". Again, I'm neutral. > ``.. `` loses the "hidden" meaning and instead means "leading up to" > or "side note", and is thus used for targets. But again, internal targets are inconsistent: they alone need an underscore. [Tony] > I still remember when I finally got David's idea that "we'll delimit > the *odd* stuff about a document with one symbol, so that the eye > can spot it easily" (and, implicitly, just by running down the left > margin of the text, which is a fairly natural thing to do). That is a significant advantage IMHO. > In which case, maybe ``#_`` and ``.. _#:`` would be better cases for > anononymity, for consistency with "anonymous" footnotes. Hmm. Except that anonymous hyperlinks are not *numbered*, which connotation is the reason I chose "[#]" for auto-numbered footnotes. > Tibs' proposal, scheme 3: > .. http://somewhere anonymous uri > .. _blah: http://somewhere named uri > .. _blah: anchor > .. [blah] http://somewhere footnote > .. blah: http://somewhere comment > .. blah:: http://somewhere directive > > The sole change that this makes to scheme 0 is to say that comments > may not start with (something that looks like) a URI. We already > know they may not start with something that looks like a directive, > so this may not be *too* onerous. Onerous enough I think. I don't want to restrict comments any more than they are already. Putting a URI in a comment is not hard to imagine. > The disadvantage is that we've lost the initial "_", which served as > a hint that this was a target URI - but then we don't have that for > footnotes (in that case, because losing the underscore makes the > footnote look more like a footnote). Also the idea (rationalization) was that, like a section title, a footnote generates an implicit hyperlink target, thus obviating the need for an initial "_". [Alan] > I'd also like to see a clearly-specified markup completely displace > STX, ending STX `dialect proliferation`_ in Zope once and for all. > reST won't do this unless it's a clear win for all current STX > users, which includes eliminating all areas in which reST is more > awkward than STX. As far as I can see, hyperlink syntax is the only > such area. I understand and agree with Alan's concerns, and I *would* like to accommodate his users' needs. I think such improvements to reStructuredText are feasible and they would be overall improvements. However, the syntax must be consistent, unsurprising, and orthogonal. If that's not possible, then the added syntax must be minimally intrusive. I don't think we're there yet. I've made a minimal-change suggestion, #5 in the next post. Perhaps we need to look at this in a totally different way. Radical change, not incremental. Revolution, not evolution. Any ideas? -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From goodger@users.sourceforge.net Fri Oct 19 04:05:58 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Thu, 18 Oct 2001 23:05:58 -0400 Subject: [Doc-SIG] Reworking Explicit Markup Message-ID: .. extracted from http://structuredtext.sourceforge.net/spec/alternatives.txt Reworking Explicit Markup ========================= Alan Jaffray came up with the idea of anonymous hyperlinks, added to reStructuredText. Subsequently it was asserted that hyperlinks (especially anonymous hyperlinks) would play an increasingly important role in reStructuredText documents, and therefore they require a simpler and more concise syntax. This prompted a review of the current and proposed explicit markup syntaxes with regards to improving usability. 1. Original syntax:: .. _blah: internal hyperlink target .. _blah: http://somewhere external hyperlink target .. _blah: blahblah_ indirect hyperlink target .. __: http://somewhere anonymous external target .. __: blahblah_ anonymous indirect target .. [blah] http://somewhere footnote .. blah:: http://somewhere directive .. blah: http://somewhere comment Notes on the examples: * Anonymous internal targets are also possible, but probably not useful, so they're not included. * The comment text was intentionally made to look like a hyperlink target. Origins: * Except for the colon (a delimiter necessary to allow for phrase-links), hyperlink target ``.. _blah:" comes from Setext. * Comment syntax from Setext. * Footnote syntax from StructuredText ("named links"). * Directives and anonymous hyperlinks original to reStructuredText. Advantages: + Consistent explicit markup indicator: "..". + Consistent hyperlink syntax: ".. _" & ":". Disadvantages: - Anonymous target markup is awkward: ".. __:". - The explicit markup indicator ("..") is excessively overloaded? - Comment text is limited (can't look like a footnote, hyperlink, or directive). But this is probably not important. 2. Alan Jaffray's proposed syntax #1:: __ _blah internal hyperlink target __ blah: http://somewhere external hyperlink target __ blah: blahblah_ indirect hyperlink target __ http://somewhere anonymous external target __ blahblah_ anonymous indirect target __ [blah] http://somewhere footnote .. blah:: http://somewhere directive .. blah: http://somewhere comment The hyperlink-connoted underscores have become first-level syntax. Advantages: + Anonymous targets are simpler. + All hyperlink targets are one character shorter. Disadvantages: - Inconsistent internal hyperlink targets. Unlike all other named hyperlink targets, there's no colon. There's an extra leading underscore, but we can't drop it because without it, "blah" looks like a relative URI. Unless we restore the colon:: __ blah: internal hyperlink target - Obtrusive markup? 3. Alan Jaffray's proposed syntax #2:: .. _blah internal hyperlink target .. blah: http://somewhere external hyperlink target .. blah: blahblah_ indirect hyperlink target .. http://somewhere anonymous external target .. blahblah_ anonymous indirect target .. [blah] http://somewhere footnote !! blah: http://somewhere directive ## blah: http://somewhere comment Leading underscores have been (almost) replaced by "..", while comments and directives have gained their own syntax. Advantages: + Anonymous hyperlinks are simpler. + Unique syntax for comments. Connotation of "comment" from some programming languages (including our favorite). + Unique syntax for directives. Connotation of "action!". Disadvantages: - Inconsistent internal hyperlink targets. Again, unlike all other named hyperlink targets, there's no colon. There's a leading underscore, matching the trailing underscores of references, which no other hyperlink targets have. We can't drop that one leading underscore though: without it, "blah" looks like a relative URI. Again, unless we restore the colon:: .. blah: internal hyperlink target - All (except for internal) hyperlink targets lack their leading underscores, losing the "hyperlink" connotation. - Obtrusive syntax for comments. Alternatives:: ;; blah: http://somewhere (also comment syntax in Lisp & others) ,, blah: http://somewhere ("comma comma": sounds like "comment"!) - Iffy syntax for directives. Alternatives? 4. Tony Ibbs' proposed syntax:: .. _blah: internal hyperlink target .. _blah: http://somewhere external hyperlink target .. _blah: blahblah_ indirect hyperlink target .. http://somewhere anonymous external target .. blahblah_ anonymous indirect target .. [blah] http://somewhere footnote .. blah:: http://somewhere directive .. blah: http://somewhere comment This is the same as the current syntax, except for anonymous targets which drop their "__: ". Advantage: + Anonymous targets are simpler. Disadvantages: - Anonymous targets lack their leading underscores, losing the "hyperlink" connotation. - Anonymous targets are almost indistinguishable from comments. (Better to know "up front".) 5. David Goodger's proposed syntax: Perhaps going back to one of Alan's earlier suggestions might be the best solution. How about simply adding "__ " as a synonym for ".. __: "? These would become equivalent:: .. __: http://somewhere __ http://somewhere Would that be sufficient, with no other syntax changes? -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From tony@lsl.co.uk Fri Oct 19 10:28:15 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Fri, 19 Oct 2001 10:28:15 +0100 Subject: [Doc-SIG] Reworking Explicit Markup In-Reply-To: Message-ID: <008801c15880$618d6880$f05aa8c0@lslp7o.int.lsl.co.uk> David doing his good work as normal, so not much to say (erm, when did that stop me?) The interesting bit of this email is at `the end`_ - in summary, I'm +1 for David's proposed syntax, number 5 (sorry, they've been replaying Hitchhikers' Guide to the Galaxy on the radio recently over her, and I wouldn't want to keep anyone in needless suspense). David noted that he used "#" in anonymous footnotes because of the connotation of "number" - hah, I'm on the wrong continent again, I hadn't quite gotten that (pronouncing it "hash" probably doesn't help). OK, for a sizable constituency it will have that direct connotation, I can understand that. I'm less sanguine than he about the ease of remembering what can't go at the beginning of a comment, although I suppose "magic" allows:: .. Remember: http://www.python.org/ is a really neat site. to be a comment because of the trailing text? But not a great worry - comments are secondary, and we already had this discussion. Trivial note: there's an alternative 6 which follows on immediately (as does alternative 5) from a comment in alternative 1: > 1. Original syntax:: > Disadvantages: > - Anonymous target markup is awkward: ".. __:". so the "obvious" thing to do is drop the "__", giving ".. :". Unfortunately, this has no great advantage, whilst losing the "_" link connotation, and it *looks* odd (I suspect Alan's users would prefer something without a space embedded in the middle!). .. _the end: > 5. David Goodger's proposed syntax: Perhaps going back to one of > Alan's earlier suggestions might be the best solution. How about > simply adding "__ " as a synonym for ".. __: "? These would become > equivalent:: > > .. __: http://somewhere > > __ http://somewhere > > Would that be sufficient, with no other syntax changes? So one might type:: Useful languages for this purpose include Tcl__, Python_, Perl__ and Sather__ - but irrespective of practicality, Python_ will always be my first love. __ http://www.sometcl.resource/ .. _python: http://www.python.org/ __ http://www.perl.org/ __ http://www.sather.org/ Yes, I could see that working "visually". Decent error messages when one types "__" instead of "_" (and vice versa) will help, but I trust us (!) to do that. Could one could also do:: Useful languages for this purpose include Tcl__, Python__, Perl__ and Sather__ - but irrespective of practicality, Python_ will always be my first love. __ http://www.sometcl.resource/ .. _python: __ http://www.python.org/ __ http://www.perl.org/ __ http://www.sather.org/ as an alternative? Anyway, consider me a +1 on this idea, at least for the moment. Tibs -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ "Bounce with the bunny. Strut with the duck. Spin with the chickens now - CLUCK CLUCK CLUCK!" BARNYARD DANCE! by Sandra Boynton My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From Paul.Moore@atosorigin.com Fri Oct 19 10:32:31 2001 From: Paul.Moore@atosorigin.com (Moore, Paul) Date: Fri, 19 Oct 2001 10:32:31 +0100 Subject: [Doc-SIG] rST hyperlink syntax Message-ID: <714DFA46B9BBD0119CD000805FC1F53B01B5B075@UKRUX002.rundc.uk.origin-it.com> From: David Goodger [mailto:goodger@users.sourceforge.net] > I meant that adding another line-starting construct adds > complexity in and of itself: one more string that a line > can't otherwise start with. This added initial complexity > may be offset by the benefits it offers, in which > case there would be a net gain. That's my issue, as well. I like the minimal nature of just having one "line directive". I'd also point out that ``__`` is the sort of thing that (certain types of) people will use in plain text - it's a variant of a common way of denoting emphasis - I could end up writing, __ without thinking __ something like this, intended to emphasise a point (it's not correct reST for what I mean, but that's why I said "without thinking"). And an unfortunate word-wrap causes problems. OK, it's not likely - but is the gain worth it? Of course, I'm in the sort of target group who uses all 57 list constructs, but hardly ever writes a hyperlink, so I would think this... [Actually, re-reading the above, it sounds a bit of a strained argument. Maybe that implies that there isn't a really good argument against the construct. But I still *feel* like there's something wrong with it... :-)] Paul. From goodger@users.sourceforge.net Fri Oct 19 21:47:55 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Fri, 19 Oct 2001 16:47:55 -0400 Subject: [Doc-SIG] Reworking Explicit Markup In-Reply-To: <008801c15880$618d6880$f05aa8c0@lslp7o.int.lsl.co.uk> Message-ID: Tony J Ibbs (Tibs) wrote: > I'm less sanguine than he about the ease of remembering what can't go at > the beginning of a comment, although I suppose "magic" allows:: > > .. Remember: http://www.python.org/ is a really neat site. > > to be a comment because of the trailing text? No. It's not a hyperlink target because there's no leading underscore, and it's not a directive because there's only one colon after "Remember". And it's obviously not a footnote. Therefore it's a comment. I'm not troubled by the possibility of writing a comment that gets recognized as something else. On the one hand, comments should be rare beasts. On the other hand, they're an advanced feature; anybody who uses comments ought to understand how to avoid the other constructs. > Could one could also do:: > > Useful languages for this purpose include Tcl__, > Python__, Perl__ and Sather__ - but irrespective > of practicality, Python_ will always be my first > love. > > __ http://www.sometcl.resource/ > .. _python: > __ http://www.python.org/ > __ http://www.perl.org/ > __ http://www.sather.org/ > > as an alternative? I see no reason why not. Yes, it follows naturally. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From fdrake@acm.org Fri Oct 19 21:59:04 2001 From: fdrake@acm.org (Fred L. Drake) Date: Fri, 19 Oct 2001 16:59:04 -0400 (EDT) Subject: [Doc-SIG] [development doc updates] Message-ID: <20011019205904.1F95528697@beowolf.digicool.com> The development version of the documentation has been updated: http://python.sourceforge.net/devel-docs/ Documentation update beyond the Python 2.2 beta 1 docs. This matches the revised iSilo document conversion. From goodger@users.sourceforge.net Fri Oct 19 22:57:29 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Fri, 19 Oct 2001 17:57:29 -0400 Subject: [Doc-SIG] Representation of Horizontal Rules Message-ID: [Excerpted from the new file `DPS Document Tree Structure`__, which I've just begun. It will be on the web site once the snapshot is taken tonight. Not much in it yet though. __ http://docstring.sourceforge.net/spec/doctree.txt I'm leaning towards solution #2. Those of you working with the document tree, writing code or style sheets, please let me know if this will cause problems beyond minor revisions.] Having added the "horizontal rule" construct to the reStructuredText spec, a decision has to be made as to how to reflect the construct in the implementation of the document tree. Given this source:: Document ======== Paragraph -------- Paragraph The horizontal rule indicates a "transition" (in prose terms) or the start of a new "division". Before implementation, the parsed document tree would be::
Document <paragraph> Paragraph -------- <--- error here <paragraph> Paragraph There are several possibilities for the implementation. 1. Implement horizontal rules as "divisions" or segments. A "division" is a title-less, non-hierarchical section. The first try at an implementation looked like this:: <document> <section name="document"> <title> Document <paragraph> Paragraph <division> <paragraph> Paragraph But the two paragraphs are really at the same level; they shouldn't appear to be at different levels. There's really an invisible "first division". The horizontal rule splits the document body into two segments, which should be treated uniformly. 2. Treating "divisions" uniformly brings us to the second possibility:: <document> <section name="document"> <title> Document <division> <paragraph> Paragraph <division> <paragraph> Paragraph With this change, documents and sections will directly contain divisions and sections, but not body elements. Only divisions will directly contain body elements. Even without a horizontal rule anywhere, the body elements of a document or section would be contained within a division element. This makes the document tree deeper. This is similar to the way HTML treats document contents: grouped within a <BODY> element. 3. Implement them as "transitions", empty elements:: <document> <section name="document"> <title> Document <paragraph> Paragraph <transition> <paragraph> Paragraph A transition would be a "point element", not containing anything, only identifying a point within the document structure. This keeps the document tree flatter, but the idea of a "point element" like "transition" smells bad. A transition isn't a thing itself, it's the space between [#]_ two divisions. .. [#] Cool song by Dave Matthews. First time I heard it, I thought it was Peter Gabriel. Matthews' voice on this song sounds uncannily like Gabriel's, and the style & lyrics wouldn't be out of place either. Totally off topic. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From fdrake@acm.org Mon Oct 22 18:24:35 2001 From: fdrake@acm.org (Fred L. Drake) Date: Mon, 22 Oct 2001 13:24:35 -0400 (EDT) Subject: [Doc-SIG] [development doc updates] Message-ID: <20011022172435.28AF528697@cj42289-a.reston1.va.home.com> The development version of the documentation has been updated: http://python.sourceforge.net/devel-docs/ Various updates, including support for the "Site Navigation Bar" in Mozilla 0.9.5. From fdrake@acm.org Mon Oct 22 19:41:46 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Mon, 22 Oct 2001 14:41:46 -0400 Subject: [Doc-SIG] GNU Info documentation for Python 2.1.1 Message-ID: <15316.26730.592110.734796@grendel.zope.com> Milan Zamazal has contributed versions of the Python documentation in GNU Info format for Python 2.1.1. If you've been itching for this, grab your copy today! ftp://ftp.python.org/pub/python/doc/2.1.1/ -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Zope Corporation <a href="ftp://ftp.python.org/pub/python/doc/2.1.1/">GNU Info documentation for Python 2.1.1</a> -- The standard Python documentation is once more available in GNU Info format! From gustav@morpheus.demon.co.uk Mon Oct 22 20:45:18 2001 From: gustav@morpheus.demon.co.uk (Paul Moore) Date: Mon, 22 Oct 2001 20:45:18 +0100 Subject: [Doc-SIG] How to traverse a document object Message-ID: <f1t8ttss7h3rfvm3r0mrng2ho4detl97d6@4ax.com> I don't know if I'm missing something stupidly obvious here... I want to traverse a document generated by a dps.parsers.restructuredtext.Parser instance. I can see no way of doing so short of a manual tree-walk with type checks all the way - you know:: if type(current_node) =3D=3D section: # process a section, probably recursing on its children elif type(current_node) =3D=3D paragraph: # process a paragraph # etc, ad nauseam. This *can't* be the correct way of doing this. The example code in the tools directory isn't any help, as it builds on the asdom() method, which does the trick "for free". I tried looking at the xml.dom module, but that didn't offer anything that immediately leapt out at me as a suitable "visitor" interface. But I'm not familiar with XML, so I'm probably missing something. But IMHO, there *must* be a simple way of traversing the document model. At the moment, I can't see it. Can someone enlighten me? (Or if there isn't one, surely it needs implementing - and as it may well need support from the classes in nodes.py, I'd imagine it needs adding sooner rather than later?) As I say, I'm convinced I've missed something fundamental here... Paul. From goodger@users.sourceforge.net Mon Oct 22 22:44:36 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Mon, 22 Oct 2001 17:44:36 -0400 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <f1t8ttss7h3rfvm3r0mrng2ho4detl97d6@4ax.com> Message-ID: <B7FA0B83.194A0%goodger@users.sourceforge.net> Paul Moore wrote: > I don't know if I'm missing something stupidly obvious here... I want to > traverse a document generated by a dps.parsers.restructuredtext.Parser > instance. I can see no way of doing so short of a manual tree-walk with > type checks all the way You're not missing anything. The answer is simple: not implemented yet. (At least not in nodes.py; perhaps Tony's pydps implemented something?) > (Or if there isn't one, surely it needs implementing - and as it may well need > support from the classes in nodes.py, I'd imagine it needs adding sooner > rather than later?) And the classic open-source answer: please go ahead, patches gratefully accepted! Alternatively, explain what you are trying to do and how it will benefit humankind, and perhaps somebody else's interest will be piqued enough they'll implement it for you. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From gustav@morpheus.demon.co.uk Mon Oct 22 23:55:18 2001 From: gustav@morpheus.demon.co.uk (Paul Moore) Date: Mon, 22 Oct 2001 23:55:18 +0100 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <f1t8ttss7h3rfvm3r0mrng2ho4detl97d6@4ax.com> References: <f1t8ttss7h3rfvm3r0mrng2ho4detl97d6@4ax.com> Message-ID: <e659tt8331819fv5s646isknugofh62p9t@4ax.com> On Mon, 22 Oct 2001 20:45:18 +0100, Paul Moore <gustav@morpheus.demon.co.uk> wrote: >I don't know if I'm missing something stupidly obvious here... I want to >traverse a document generated by a dps.parsers.restructuredtext.Parser >instance. I can see no way of doing so short of a manual tree-walk with >type checks all the way - you know:: Hmm. I dug a bit deeper - I can do a bit better, by switching on the tagname attribute. But I can't find a robust way of terminating the recursion. I can't check the "children" attribute (if it's zero, don't recurse) as text nodes don't have this attribute. OK, getattr(node, 'children', 0) works, but that looks ugly. The problem seems to be that the _Node class has no useful attributes or methods to handle tree walks, whereas _Element contains children which are not themselves _Elements (via _TextElement, which again has no attributes to let me notice what's going on). OK, I can check for a tagname of "#text". That seems to work. But there's no way that this feels natural - it smacks too much of magic numbers... Grmph. This feels like it should be a natural application for the "Visitor" pattern. The following works:: # "Acceptor methods" - see the Visitor pattern for details # This one has to handle children def AcceptNode(self, visitor): visitor.Visit(self) for child in self.children: child.Accept(visitor) # This one doesn't handle children def AcceptText(self, visitor): visitor.Visit(self) # Install the methods - this feels as if it's # being unacceptably chummy with the node classes - # particularly by referring to the _Element class, # which has a leading underscore import dps.nodes dps.nodes._Element.Accept =3D AcceptNode dps.nodes.Text.Accept =3D AcceptText # Define a visitor, which just prints the tagname class V: def Visit(self, node): print node.tagname # Walk the document tree document.Accept(V()) In fact, this seems fairly nice, except for the fact that [Offtopic]_ a. I'm inserting new methods into the node classes, which is a little presumptuous of me. b. I need to know the class names of the node classes, which seems to be too tied to implementation specifics. Nevertheless, its a pretty good tree walking model. It might be nice to have this in the node classes, except that there may not be a single "correct" walk order (a bit like the normal preorder, postorder, inorder issues). .. [Offtopic] I would normally indent this list if I was writing "plain" (ie, no markup) text. I'm not sure what effect such indentation would have on reST. I get the impression I'd get an extra "blockquote" element that I didn't want. Is this harmful? (I guess that depends on the output formatter, and so the answer has to be "possibly"). Can it be avoided? In "plain" text, I *really* prefer the look of lists when they are indented. Even more offtopic - is this indented enough to be part of the footnote? I think the indentation rules need more clarification... [I did a test, and it is included...] Sorry, this has all turned into a bit of a brain-dump. But that's probably because I'm feeling that I'm having to invent something that I expected to be part of the basic infrastructure. Is it simply that no-one's got to the point of needing this implemented yet? It's an "output" issue, and the lack of output generators suggests that that may well be the problem. Thanks for listening, Paul. From Juergen Hermann" <jh@web.de Tue Oct 23 00:28:29 2001 From: Juergen Hermann" <jh@web.de (Juergen Hermann) Date: Tue, 23 Oct 2001 01:28:29 +0200 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <e659tt8331819fv5s646isknugofh62p9t@4ax.com> Message-ID: <m15voT2-007qasC@smtp.web.de> On Mon, 22 Oct 2001 23:55:18 +0100, Paul Moore wrote: >Grmph. This feels like it should be a natural application for the >"Visitor" pattern. Same idea here. Actually, it's already there, sort-of. The creation of t= he dom tree acts like the visitor pattern, only for a specific purpose. If = you ask me, the whole thing should be abstracted (as you proposed) and t= he the _dom_node and _rooted_dom_node could be implemented as ONE visitor. What I missed was a "toSAX" method, which could be easily added then. Ciao, J=FCrgen From lists@itamarst.org Tue Oct 23 11:36:23 2001 From: lists@itamarst.org (Itamar Shtull-Trauring) Date: Tue, 23 Oct 2001 12:36:23 +0200 Subject: [Doc-SIG] ANN: Teud 1.2, a documentation generator Message-ID: <3BD54827.3050208@itamarst.org> Teud - A Python documentation generator ======================================= What does it do? Converts python files to XML files containing the documentation for the objects in the python file. The XML files can be transformed into HTML using an XSLT stylesheet, etc. Teud tells you when a method in a class overrides or inherits from another class, and also supports PEP 245 interfaces (__implements__). What does it mean? teud is pronounced teh-OOD. It means "documentation" in Hebrew. What does the output look like? Well, the output can look however you want, just write a custom XSLT stylesheet. However, default output of with the fancy.css stylesheet that comes with Teud can be seen at: http://itamarst.org/twisted-docs/twisted.html How does it decide what to document? 1) If there is __all__, anything listed in it is public and is added to the XML file, anything not listed in it is not considered public but is added. 2) Anything imported from somewhere else (if that can be found out) and not in __all__ is not added to the XML file. 3) If there is no __all__, anything beginning with _ is not public. The default XSLT does not export non-public objects to the HTML file. Where do I download it? For more details and a TODO list, see http://twistedmatrix.com/users/jh.twistd/python/moin.cgi/TeudProject From goodger@users.sourceforge.net Wed Oct 24 03:07:14 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Tue, 23 Oct 2001 22:07:14 -0400 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <e659tt8331819fv5s646isknugofh62p9t@4ax.com> Message-ID: <B7FB9A90.195A8%goodger@users.sourceforge.net> Paul Moore wrote: > a. I'm inserting new methods into the node classes, which is a little > presumptuous of me. If you insert methods from outside the module, yes, you *would* be presumptuous. If you edit the nodes.py module and submit a patch, though, you'll be a contributing developer! > b. I need to know the class names of the node classes, which seems to > be too tied to implementation specifics. The document tree is meant to be an specific document/DTD/schema implementation only, not a generic DOM. > Nevertheless, its a pretty good tree walking model. It might be nice > to have this in the node classes, except that there may not be a > single "correct" walk order (a bit like the normal preorder, > postorder, inorder issues). I don't know how you'd do inorder with document trees. ;-) It's most useful to have a hook on the way in and on the way out of an element. I'm sure we can come up with a useful set of methods, perhaps without having to reinvent the wheel, using polymorphism and without resorting to magic. SAX comes to mind. Suggestions, references, and/or patches welcome. > .. [Offtopic] I would normally indent this list if I was writing > "plain" (ie, no markup) text. I'm not sure what effect such > indentation would have on reST. I get the impression I'd get an > extra "blockquote" element that I didn't want. Correct. > Is this harmful? Depends on what you mean by "harmful". :-) > Can it be avoided? In "plain" text, I *really* prefer the look > of lists when they are indented. A transform could be written that looks for a block quote containing only a list, and extracts the list from within the block quote. The spec could be changed to specify that this will happen. But what if we *want* a list inside a block quote? How else would we write it? > Even more offtopic - is this indented enough to be part of the > footnote? I think the indentation rules need more > clarification... [I did a test, and it is included...] Yes. OK, the nitty gritties of the indentation rules should be spelled out better. Added to the to-do. > Sorry, this has all turned into a bit of a brain-dump. But that's > probably because I'm feeling that I'm having to invent something > that I expected to be part of the basic infrastructure. Great value for the money though! > Is it simply that no-one's got to the point of needing this > implemented yet? In my case, yes. I haven't tackled the output end yet. What are you trying to do exactly? My interest is half-piqued. Provide me a bit of stimulus and it may become fully-piqued. > Thanks for listening, Any time. Cheaper than psychotherapy. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From tony@lsl.co.uk Wed Oct 24 09:40:19 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Wed, 24 Oct 2001 09:40:19 +0100 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <B7FB9A90.195A8%goodger@users.sourceforge.net> Message-ID: <002901c15c67$8340e660$545aa8c0@lslp862.int.lsl.co.uk> David Goodger wrote: > If you insert methods from outside the module, yes, you *would* be > presumptuous. Ah, but the advantage we have with the DPS nodes tree is that one *can* be presumptuous - it doesn't get one very far with "classic" DOM! For clarification, my (quick and dirty) HTML output mode works with a dictionary that links tag name to method name [1]_, with a special case for "#text" ('cos it's special). Thus it doesn't actually assume much about what includes what (although things will go strange if the structure is *not* what one would expect from the spec). Since I rather want a Writer class that can be customised easily, this dictionary approach seems simplest for the initial development - it's easy to subclass the Writer and just amend the dictionary entries. .. [1] Actually, the tag name keys a method name and some optional arguments, but that's enough detail for this discussion. I'm sure some visitor model would be nice at some stage, though - once one has understood the thing (!) it works very nicely (cf. the ``compiler`` package). Tibs -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ "Bounce with the bunny. Strut with the duck. Spin with the chickens now - CLUCK CLUCK CLUCK!" BARNYARD DANCE! by Sandra Boynton My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From tony@lsl.co.uk Wed Oct 24 09:55:45 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Wed, 24 Oct 2001 09:55:45 +0100 Subject: [Doc-SIG] Representation of Horizontal Rules In-Reply-To: <B7F61A08.193D3%goodger@users.sourceforge.net> Message-ID: <002a01c15c69$aaf15a30$545aa8c0@lslp862.int.lsl.co.uk> David Goodger wrote: > I'm leaning towards solution #2. Those of you working with the > document tree, writing code or style sheets, please let me know if > this will cause problems beyond minor revisions.] Hmm. OK, I can't see that adding "division" as yet another structure within the document would cause me *problems*, but... I'll reinsert the quote from the Chicago Manual of Style again, 'cos it seems to be David's inspiration (or, at least, support in his argument): Instead of subheads, extra space or a type ornament between paragraphs may be used to mark text divisions or to signal changes in subject or emphasis. However, personally I would lean strongly to option 3. This is mainly because I "see" such an ornament as a typographic element, more than a structural element - a sort of "gross elipsis", a giant semicolon, a pause in the flow of the text (which I take to be the meaning of the second alternative in the Chicago Manual's description). David says: > A transition isn't a thing itself and I think it's there that we disagree! *But* I clearly see that David's argument is supported by the "instead of subheads" clause, and if he (as our benevolent designer(!)) finds that this pushes towards option 2, then I shan't cavil too much. > 2. Treating "divisions" uniformly brings us to the second > possibility:: > > <document> > <section name="document"> > <title> > Document > <division> > <paragraph> > Paragraph > <division> > <paragraph> > Paragraph > > With this change, documents and sections will directly contain > divisions and sections, but not body elements. Only divisions will > directly contain body elements. Even without a horizontal rule > anywhere, the body elements of a document or section would be > contained within a division element. This makes the document tree > deeper. This is similar to the way HTML treats document contents: > grouped within a <BODY> element. There's an advantage in this for me, in fact. I want to be able to indicate that a paragraph *after* a title is special (specifically, when doing the title for package, module and class sections). Being able to enclose such a paragraph (or paragraphs) within a division [1]_ makes it *much* easier to do what I want, and without having to add any new classes to the DPS node tree. So although I may object (slightly) to the proposal on the grounds David wants it, I do like the idea for subtly different reasons. .. [1] For my purposes, I *think* all elements will be sprouting the optional presence of a "style" (or some such) attribute, making it easier to indicate (for instance) that this division is being used for "detail" about the module, etc. But more on this if/when it happens... Tibs -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ Give a pedant an inch and they'll take 25.4mm (once they've established you're talking a post-1959 inch, of course) My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From gustav@morpheus.demon.co.uk Wed Oct 24 22:31:08 2001 From: gustav@morpheus.demon.co.uk (Paul Moore) Date: Wed, 24 Oct 2001 22:31:08 +0100 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <B7FB9A90.195A8%goodger@users.sourceforge.net> References: <e659tt8331819fv5s646isknugofh62p9t@4ax.com> <B7FB9A90.195A8%goodger@users.sourceforge.net> Message-ID: <4e0ett030c7jqgvjs1s747o94jvoj4dhn9@4ax.com> On Tue, 23 Oct 2001 22:07:14 -0400, David Goodger <goodger@users.sourceforge.net> wrote: >Paul Moore wrote: >> a. I'm inserting new methods into the node classes, which is a little >> presumptuous of me. > >If you insert methods from outside the module, yes, you *would* be >presumptuous. If you edit the nodes.py module and submit a patch, >though, you'll be a contributing developer! =46air enough :-) The real point, I guess, was that I wasn't sure if what I was doing counted as a prototype for a generally useful feature, or just a one-off piece of code for the particular task I was attempting. On reflection, it looks like a general thing (basically, *all* writers will need to tree-walk the nodes, so it's general...) >> b. I need to know the class names of the node classes, which seems to >> be too tied to implementation specifics. > >The document tree is meant to be an specific document/DTD/schema >implementation only, not a generic DOM. I'm not sure I understand what you mean here. That's probably because I know almost nothing of XML, and in particular, I find the terminology confusing (what do you mean by a "generic DOM"?) Regardless, the point is probably moot, as this looks more like a prototype for a patch (which means that being tied to the implementation details is emphatically *not* an issue) as opposed to a separate module. >> Nevertheless, its a pretty good tree walking model. It might be nice >> to have this in the node classes, except that there may not be a >> single "correct" walk order (a bit like the normal preorder, >> postorder, inorder issues). > >I don't know how you'd do inorder with document trees. ;-) OK, so I got a bit over-excited there :-) >It's most useful to have a hook on the way in and on the way out of an >element. I'm sure we can come up with a useful set of methods, perhaps >without having to reinvent the wheel, using polymorphism and without >resorting to magic. SAX comes to mind. Suggestions, references, and/or >patches welcome. Yes, (what little I know of) SAX struck me as relevant. I tried looking in the Python library manual (not XML/SAX specific, I know, but the only documentation I had to hand) and that seemed to imply that SAX was related to the parsing end of things rather than to the tree-walking end. There were some vague hints about tree walker classes and visitors in the PyXML modules, but unless I missed it, there's virtually no documentation for those modules, so I couldn't find out any more. Question: This document model isn't a "real" XML DOM (by my reading of your comments). So we end up reinventing technologies like DOM tree walkers, etc. My naive reaction is "why aren't we using the XML DOM, then, so we get this sort of thing for free"? Presumably there *are* good reasons - I'd be interested to know what they are. (The biggest sign of a problem, I suspect, would be if the asdom() method was heavily used, implying that people habitually generated a "real" DOM to handle this thing - presumably because of failings in the DPS DOM). >> .. [Offtopic] I would normally indent this list if I was writing >> "plain" (ie, no markup) text. I'm not sure what effect such >> indentation would have on reST. I get the impression I'd get an >> extra "blockquote" element that I didn't want. > >Correct. Experimentation had confirmed this for me. >> Is this harmful? > >Depends on what you mean by "harmful". :-) "Not what I want" :-) Seriously, I guess the question is how "blockquote" elements are going to be visibly marked up in the various output formats. Until we actually *have* some more formats, the question is hard to answer. >> Can it be avoided? In "plain" text, I *really* prefer the look >> of lists when they are indented. > >A transform could be written that looks for a block quote containing >only a list, and extracts the list from within the block quote. The >spec could be changed to specify that this will happen. But what if we >*want* a list inside a block quote? How else would we write it? I think that's basically my point. A lot depends on what a block quote is intended to signify. I view blockquotes as basically a way of displaying a quotation, or something similar, without the "..." around it. As such, it would be a pretty rare thing. In LaTeX, I'd use the "quote" environment for this. My copy of "HTML - The Definitive Guide" says that <blockquote> tags cause the contents to be set of from the main text, usually with indented right and left margins, and *sometimes in italicised typeface* (my emphasis). And it does point out that it's intended for quotes. This isn't the sort of thing I'd want to use often... Maybe the blockquote element in the DPS model should be redefined (or just better defined) to clarify the intended use. I can see a number of possibilities: - It is intended for block quotations, and so the HTML <blockquote> and LaTeX quote environments are appropriate. I can't see this form getting much use. - It is for general text which is indented on both left and right. This would be more useful, for text to "stand out" from the surroundings. But it doesn't match the HTML <blockquote> tag - so there may be problems implementing this in a HTML writer. - It is for text indented on the left only. This is something people actually do a lot. It also matches the look of the source text, so it's fairly easy to understand. But again, it may be harder to implement, and it smacks of "visual" formatting, rather than "logical" formatting. >> Sorry, this has all turned into a bit of a brain-dump. But that's >> probably because I'm feeling that I'm having to invent something >> that I expected to be part of the basic infrastructure. > >Great value for the money though! Oh, definitely! > >> Is it simply that no-one's got to the point of needing this >> implemented yet? > >In my case, yes. I haven't tackled the output end yet. I think that's the problem. I can't conceptualise the data structure in isolation - I need to grasp how it translates into real output. That's not a criticism of what you've done, it's just that I work differently. And I need to get a handle on getting stuff out of the object model before I can completely understand it. That's a real chicken-and-egg problem, though, as I'm trying to understand the model so that I can implement an output program :-) >What are you trying to do exactly? My interest is half-piqued. Provide >me a bit of stimulus and it may become fully-piqued. Write an output processor, at the most basic level. More specifically, write a framework with which output processors can be built fairly simply. My first concrete implementation is likely to be some sort of dump of a summary of the structure - tweakable, so that different levels of structure can be seen. With that, I'll be able to explore the model for a given document. Once I get that, I'm looking to implement a LaTeX output processor. It shouldn't be hard to do others (such as yet another HTML writer). If it is, I'll have done something wrong... One thing that has already become clear to me is that it will be *far* easier to write output processors for "structural" markup languages (HTML, (La)TeX, DocBook, Texinfo, etc) than for "layout" oriented languages (PDF, PostScript, etc). Sufficiently so that I doubt it will ever be realistic to go direct to such formats - you'd have to implement line and page breaking algorithms, etc, etc. >> Thanks for listening, > >Any time. Cheaper than psychotherapy. Gibber, gibber... Paul. From gustav@morpheus.demon.co.uk Wed Oct 24 22:31:11 2001 From: gustav@morpheus.demon.co.uk (Paul Moore) Date: Wed, 24 Oct 2001 22:31:11 +0100 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <002901c15c67$8340e660$545aa8c0@lslp862.int.lsl.co.uk> References: <B7FB9A90.195A8%goodger@users.sourceforge.net> <002901c15c67$8340e660$545aa8c0@lslp862.int.lsl.co.uk> Message-ID: <nfbettkp28dg98nt9sjf5uld9utrc4hgun@4ax.com> On Wed, 24 Oct 2001 09:40:19 +0100, "Tony J Ibbs (Tibs)" <tony@lsl.co.uk> wrote: >David Goodger wrote: >> If you insert methods from outside the module, yes, you *would* be >> presumptuous. > >Ah, but the advantage we have with the DPS nodes tree is that one *can* >be presumptuous - it doesn't get one very far with "classic" DOM! Hmm. Why not - it's a feature of the language (Python) that you can insert methods into predefined classes. That applies to DPS node classes or XML DOM classes equally. You need to know some details of the implememtation, but that's where the presumption comes in... (And whether it's a *good* thing is a separate point). >For clarification, my (quick and dirty) HTML output mode works with a >dictionary that links tag name to method name [1]_, with a special case >for "#text" ('cos it's special). Thus it doesn't actually assume much >about what includes what (although things will go strange if the >structure is *not* what one would expect from the spec). Yes, I looked at your stuff and saw that. It's nice and general. There's some "feel" to it that still feels adhoc to me. Can't put my finger on it, though. It's one of those cases where I suspect there's a "clearly right" solution, and all of the other options lack that "spark" of clarity and "obvious rightness". Om... >Since I rather want a Writer class that can be customised easily, this >dictionary approach seems simplest for the initial development - it's >easy to subclass the Writer and just amend the dictionary entries. I hadn't thought of subclassing and changing the dictionary. Yes, that makes it nicely reusable. >I'm sure some visitor model would be nice at some stage, though - once >one has understood the thing (!) it works very nicely (cf. the >``compiler`` package). The visitor pattern is nice. However, it relies on co-operation from the class being visited, and getting the form of that co-operation right is hard (you're designing a general tree-walk framework, often without knowing all the ways it might need to be used - after all, you can't modify it in response to client requirements, that's the point.) Paul. From gustav@morpheus.demon.co.uk Wed Oct 24 22:31:12 2001 From: gustav@morpheus.demon.co.uk (Paul Moore) Date: Wed, 24 Oct 2001 22:31:12 +0100 Subject: [Doc-SIG] Output writers and XSLT In-Reply-To: <B7FB9A90.195A8%goodger@users.sourceforge.net> References: <e659tt8331819fv5s646isknugofh62p9t@4ax.com> <B7FB9A90.195A8%goodger@users.sourceforge.net> Message-ID: <p4cett0p3a1j4n5qcbnmof6avia656pplb@4ax.com> On Tue, 23 Oct 2001 22:07:14 -0400, David Goodger <goodger@users.sourceforge.net> wrote: >> Can it be avoided? In "plain" text, I *really* prefer the look >> of lists when they are indented. > >A transform could be written that looks for a block quote containing >only a list, and extracts the list from within the block quote. The >spec could be changed to specify that this will happen. But what if we >*want* a list inside a block quote? How else would we write it? You just said "transform". That made me think - we can *already* get XML out of reStructuredText. Given that, can we not use XSLT to generate whatever output formats we need? (You can tell I don't know much about XML, but I've read the brochures, can't you :-) Seriously, what little I know of XSLT implies that it might be possible to do this. I know someone (can't recall the reference just now) posted that they have reST->HTML code which goes via XML and XSLT. Is that a viable general approach? Does Python include XSLT processing modules? In the PyXML package, maybe? I dunno. Part of me feels that this is the way XML always works - lots of concepts which help people to think about problems, and lots of technology which never actually gets used to do the job, but which provides ideas to allow people to re-implement bits of it as needed. Cynically y'rs Paul. From Juergen Hermann" <jh@web.de Wed Oct 24 23:32:49 2001 From: Juergen Hermann" <jh@web.de (Juergen Hermann) Date: Thu, 25 Oct 2001 00:32:49 +0200 Subject: [Doc-SIG] Output writers and XSLT In-Reply-To: <p4cett0p3a1j4n5qcbnmof6avia656pplb@4ax.com> Message-ID: <m15wWXx-007qefC@smtp.web.de> On Wed, 24 Oct 2001 22:31:12 +0100, Paul Moore wrote: >I dunno. Part of me feels that this is the way XML always works - lots >of concepts which help people to think about problems, and lots of >technology which never actually gets used to do the job, but which >provides ideas to allow people to re-implement bits of it as needed. Or you know how to use the stuff, and then you get things like this: http://purl.net/wiki/python/TeudViewer?module=3Ddps And all this with _assembling_ the wheels, not reinventing them. ;) Ciao, J=FCrgen From goodger@users.sourceforge.net Thu Oct 25 03:46:22 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Wed, 24 Oct 2001 22:46:22 -0400 Subject: [Doc-SIG] Representation of Horizontal Rules In-Reply-To: <002a01c15c69$aaf15a30$545aa8c0@lslp862.int.lsl.co.uk> Message-ID: <B7FCF53D.195CB%goodger@users.sourceforge.net> > David Goodger wrote: >> I'm leaning towards solution #2. Tony J Ibbs (Tibs) wrote: > However, personally I would lean strongly to option 3. If I squint my left eye, I can see both sides of the argument. Once again, it's a matter of perception. Take a look at a novel or short story, and locate the "transitions", extra vertical whitespace or a line of three well-spaced asterisks. Is this construct merely the border between two segments of text, or is it an object in its own right, a vertical elipsis? I tried to find a DTD containing such a construct in either sense, to establish precedent. Neither DocBook nor TEI contain such a beast. Does anybody know of a publicly-available DTD suitable for the markup of typical prose, such as a novel? [Tony, re option 2] > There's an advantage in this for me, in fact. I want to be able to > indicate that a paragraph *after* a title is special (specifically, when > doing the title for package, module and class sections). Being able to > enclose such a paragraph (or paragraphs) within a division [1]_ makes it > *much* easier to do what I want, and without having to add any new > classes to the DPS node tree. So although I may object (slightly) to the > proposal on the grounds David wants it, I do like the idea for subtly > different reasons. Is this misguided embrace of option 2 really just an attempt to force me to choose option 3, in order to foil such a blatant abuse of markup? Tricky! But you can't fool me. I'm on to you... -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From goodger@users.sourceforge.net Thu Oct 25 04:46:10 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Wed, 24 Oct 2001 23:46:10 -0400 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <4e0ett030c7jqgvjs1s747o94jvoj4dhn9@4ax.com> Message-ID: <B7FD0095.195CC%goodger@users.sourceforge.net> [David] >> The document tree is meant to be an specific document/DTD/schema >> implementation only, not a generic DOM. [Paul] > I'm not sure I understand what you mean here. ... > (what do you mean by a "generic DOM"?) DOM is a generic XML data structure. It contains an ``Element`` class (among others), whose instances represent all elements. If you want to store a ``list`` element, it would be an ``Element`` instance whose ``tagName`` attribute was set to "list". It's not very useful from an object-oriented programming point of view; you have to switch on the ``tagName`` attribute instead of using polymorphism. Another way to put it is to use XML itself as a model. A proper XML fragment might look like this:: <list> <item> <paragraph> Item one. </paragraph> </item> </list> You could just as easily represent the above with a single element, "element", in this abomination:: <element tagName="list"> <element tagName="item"> <element tagName="paragraph"> Item one. </element> </element> </element> Think of each element as a class instance in the data structure, where the tag name is equivalent to the class, and you'll see the difference. Proper XML is to the abomination what an application-specific class library is to DOM. DOM *is* useful though. The reason DOM *is* used is because it *is* generic. You don't have to write up an application-specific class library just to represent an arbitrary data structure. The dps.nodes classes can only represent a DPS doc tree, nothing else. DOM can represent *any* XML instance. > Question: This document model isn't a "real" XML DOM (by my reading of > your comments). So we end up reinventing technologies like DOM tree > walkers, etc. My naive reaction is "why aren't we using the XML DOM, > then, so we get this sort of thing for free"? It's free, yes, but the cost is too high. It depends on how you want to build the data structure, and what you want to do with the data structure once it's complete. In most XML-processing applications, you parse an already-existing XML file to a data structure, for which DOM is a valid choice. The reStructuredText parser is *building* a document tree piecemeal, and it's easier and more powerful to say ``node = nodes.list()`` than it is to say ``node = minidom.Element("list")``, especially when you can customize the ``nodes.list`` class with specialized behaviour. As for processing the data structure once complete, I haven't done much yet but I'm sure there will be advantages if it's made up of custom objects. > (The biggest sign of a problem, I suspect, would be if the asdom() method was > heavily used, implying that people habitually generated a "real" DOM to handle > this thing - presumably because of failings in the DPS DOM). (Let's call it the DPS doc tree, to avoid misunderstandings.) Even if ``asdom()`` is called every time, it's still a win as far as I'm concerned. It's dirt easy to turn a DPS doc tree into a DOM tree, and the effort involved in coding the ``asdom()`` transformation has paid off many times over in the simplicity of the doc tree creation code, like ``node = nodes.list()``. > I view blockquotes as basically a way of displaying a quotation, or something > similar, without the "..." around it. Correct. > As such, it would be a pretty rare thing. I've used block quotes many times. For example, see my 2001-10-17 Doc-SIG post, "horizontal rules & text divisions". Used block quotes twice. > This isn't the sort of thing I'd want to use often... I decided to include block quotes in reStructuredText early on. StructuredText and Setext didn't have them; they both used simple indentation for structural purposes (sections). I believe block quotes are a generally useful construct. I'm *always* quoting stuff. I may not be a typical user, but then again I have an "in" with the guy who wrote the spec. ;-) > Maybe the blockquote element in the DPS model should be redefined (or > just better defined) to clarify the intended use. I'm starting to write a document defining the roles of each of the DPS doc tree elements, independently of the markup syntax. I've just barely begun. It's available at http://docstring.sourceforge.net/spec/doctree.txt. > I can see a number of possibilities: > > - It is intended for block quotations, and so the HTML <blockquote> and > LaTeX quote environments are appropriate. I can't see this form > getting much use. I can. And that is the indended role. > - It is for general text which is indented on both left and right. ... > - It is for text indented on the left only. ... These are presentation issues, not descriptive markup ones. > One thing that has already become clear to me is that it will be *far* > easier to write output processors for "structural" markup languages > (HTML, (La)TeX, DocBook, Texinfo, etc) than for "layout" oriented > languages (PDF, PostScript, etc). Sufficiently so that I doubt it will > ever be realistic to go direct to such formats - you'd have to implement > line and page breaking algorithms, etc, etc. If we have a TeX Writer, PostScript and PDF are almost free. Can't wait! -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From goodger@users.sourceforge.net Thu Oct 25 04:49:14 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Wed, 24 Oct 2001 23:49:14 -0400 Subject: [Doc-SIG] Re: Output writers and XSLT In-Reply-To: <p4cett0p3a1j4n5qcbnmof6avia656pplb@4ax.com> Message-ID: <B7FD03F9.195CF%goodger@users.sourceforge.net> Paul Moore wrote: > we can *already* get XML > out of reStructuredText. Given that, can we not use XSLT to generate > whatever output formats we need? Sure can. Remi Bertholet, Paul Wright, and Alan Jaffray already have. See the reStructuredText sandbox for their .xsl style sheets. > Is that a viable general approach? Maybe. Depends what you mean by "viable general". > Does Python include XSLT processing modules? In the PyXML package, maybe? In PyXML, yes, I believe so. But not in the standard library yet. Which rules it out as a general solution for now. Eventually, I want the "docutils" (umbrella package including DPS or a renaming of DPS) to be part of the standard library, so it can't use stuff from outside. If PyXML were to be included in the stdlib, though... -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From tony@lsl.co.uk Thu Oct 25 09:45:12 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Thu, 25 Oct 2001 09:45:12 +0100 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <B7FD0095.195CC%goodger@users.sourceforge.net> Message-ID: <002c01c15d31$5c04be80$545aa8c0@lslp862.int.lsl.co.uk> David Goodger and Paul Moore were discussing various things: David: > DOM *is* useful though. The reason DOM *is* used is because > it *is* generic. I rather like DOM - it's a bit clunky, but it is generic, and it provides a useful (to me) hook for thinking about (some properties of) XML [the fun, of course, is when you're thinking of XML as tree and "list" at the same time!]. But it is deliberately made so that one does *not* subclass its elements - when constructing a DOM tree you have (well, that's the theory) to ask the document instance to give you new nodes, and so one is restricted to the classes that are already defined [1]_. This means that, as David says, you have to use attribution to discriminate between elements, which is not very convenient for *specific* programming. .. [1] there are attempts (sorry, don't have a reference to hand) to automatically "mirror" a DOM tree by Python classes which have "nicer" names, I believe, but that has its own problems. David again: > The reStructuredText parser is *building* a document > tree piecemeal, and it's easier and more powerful to > say ``node = nodes.list()`` than it is to say > ``node = minidom.Element("list")``, As I'm currently working on code to build a DPS tree, I can vouch that it is easier *with* the DPS tree than it would be with DOM - not least because if I can abstract useful building concepts out of what I'm doing, I can submit a patch to David which will make it easier for everyone to do such stuff. Also, as I understand it, in a proper DOM you aren't meant to ask the package to construct an object for you - it is meant to be the document instance that knows how to do this. But I can't be bothered to look up the "correct manner". Then we move on to blockquotes: Paul (and then David) wrote: > > I view blockquotes as basically a way of displaying a > > quotation, or something similar, without the "..." > > around it. > > Correct. > > > As such, it would be a pretty rare thing. Depends entirely on one's application area! I still have plans to start a Wiki next year, using reST as its text format, following on from an apazine/fanzine I used to produce, which discusses matters relating to reading/books/etc. In *that* context, block quotes are quite likely to occur - both quoting external sources, and also quoting other people within discussions. *However*, notwithstanding the HTML "standard"s descrption, I've yet to see a browser that distinguishes the first two uses of block quotes - that is, quotation versus inset text - by using emphasis. It's another instance, I think, of browser writers following each other rather than the HTML text. Meanwhile, I happily use blockquotes a lot to inset text for "commentary" purposes - something that is difficult to convey otherwise (of course, I also use parentheses and em-dashes a lot in writing text, so perhaps I'm not a perfect examplar). David: > I may not be a typical user, but then again I have an "in" with the guy who > wrote the spec. ;-) !!!!! > I'm starting to write a document defining the roles of each > of the DPS doc tree elements, independently of the markup syntax. > I've just barely begun. > It's available at http://docstring.sourceforge.net/spec/doctree.txt. By the way, this is a wonderful thing to have started, even if it is in its early days yet. Tibs -- Tony J Ibbs (Tibs) http://www.tibsnjoan.co.uk/ Give a pedant an inch and they'll take 25.4mm (once they've established you're talking a post-1959 inch, of course) My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From tony@lsl.co.uk Thu Oct 25 09:48:38 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Thu, 25 Oct 2001 09:48:38 +0100 Subject: [Doc-SIG] Representation of Horizontal Rules In-Reply-To: <B7FCF53D.195CB%goodger@users.sourceforge.net> Message-ID: <002d01c15d31$d6c28ee0$545aa8c0@lslp862.int.lsl.co.uk> David Goodger wrote: > Is this misguided embrace of option 2 really just an attempt > to force me to choose option 3, in order to foil such a > blatant abuse of markup? Tricky! > But you can't fool me. I'm on to you... Aha - no, it was actually a sneaky attempt to *accept* option 2 so that I can subvert it for entirely the wrong purposes at a later date - but I'll have to be careful if you're getting *that* close... Tibs -- BikeCode0.2 http://www.tibsnjoan.co.uk/bikecode.html P: [Tibs] Tc B10 K:++ i29:30" h1.65m n1960 H+:~ v~ A+ M+ Rg- B: [AnthroTech] 3tRu U1c w37" Wr19:406 Mfr SAf bDh[Sachs]:C G3x7 8s Lrr1B Cb[Michael] VjsX col[MidnightBlue] T: [BurleyD'Lite] 2c2[Thomas] f++ VsX My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.) From fdrake@acm.org Thu Oct 25 16:56:18 2001 From: fdrake@acm.org (Fred L. Drake) Date: Thu, 25 Oct 2001 11:56:18 -0400 (EDT) Subject: [Doc-SIG] [development doc updates] Message-ID: <20011025155618.C21CA28697@cj42289-a.reston1.va.home.com> The development version of the documentation has been updated: http://python.sourceforge.net/devel-docs/ Experimental stylesheet changes -- code is now presented using proportional fonts (mostly since Guido really dislikes Courier). Please send comments on this change to me at python-docs@python.org. From gustav@morpheus.demon.co.uk Thu Oct 25 22:35:42 2001 From: gustav@morpheus.demon.co.uk (Paul Moore) Date: Thu, 25 Oct 2001 22:35:42 +0100 Subject: [Doc-SIG] Re: Output writers and XSLT In-Reply-To: <B7FD03F9.195CF%goodger@users.sourceforge.net> References: <p4cett0p3a1j4n5qcbnmof6avia656pplb@4ax.com> <B7FD03F9.195CF%goodger@users.sourceforge.net> Message-ID: <hlogttcnakss6hrl2hb80aeu6cihla7kht@4ax.com> On Wed, 24 Oct 2001 23:49:14 -0400, David Goodger <goodger@users.sourceforge.net> wrote: >Paul Moore wrote: >> we can *already* get XML >> out of reStructuredText. Given that, can we not use XSLT to generate >> whatever output formats we need? > >Sure can. Remi Bertholet, Paul Wright, and Alan Jaffray already have. = See >the reStructuredText sandbox for their .xsl style sheets. Interesting... The XSL style sheets don't look over complicated, which is clearly a good thing. But it is another language to learn. >> Is that a viable general approach? > >Maybe. Depends what you mean by "viable general". By "general", I specifically meant can it be used for output formats other than HTML? By "viable", I was thinking of whether it would be available to everyone - which comes down to the next point... >> Does Python include XSLT processing modules? In the PyXML package, = maybe? > >In PyXML, yes, I believe so. But not in the standard library yet. Which >rules it out as a general solution for now. Eventually, I want the >"docutils" (umbrella package including DPS or a renaming of DPS) to be = part >of the standard library, so it can't use stuff from outside. If PyXML = were >to be included in the stdlib, though... In other words, packages aimed at the core cannot use technologies which are not part of the core, even if such technologies are available in Python, and are appropriate. Grmph. I see your point (although I wish I didn't). OK, so it sounds like XSLT is not a "viable general approach", although docutils can usefully be a good showcase for its capabilities. ("Look - we implemented an output processor in only 100 lines of XSLT code"). I'll continue to look at tree-walking solutions. BTW, in my view, the key output formats which need to be supported are HTML and at least one TeX derivative (probably either LaTeX or Texinfo). HTML for web output, and TeX for hardcopy (PDF via PDFTeX, PostScript, general printed formats via DVI). If and when we have these 2 formats, we can (IMHO) say we have the output side of things covered. Does this seem right? Paul (posting because it takes less brain power than coding...). From gustav@morpheus.demon.co.uk Thu Oct 25 22:35:44 2001 From: gustav@morpheus.demon.co.uk (Paul Moore) Date: Thu, 25 Oct 2001 22:35:44 +0100 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <B7FD0095.195CC%goodger@users.sourceforge.net> References: <4e0ett030c7jqgvjs1s747o94jvoj4dhn9@4ax.com> <B7FD0095.195CC%goodger@users.sourceforge.net> Message-ID: <89qgttgkk7sh6t9s9vidrpeumt7tr73bd1@4ax.com> On Wed, 24 Oct 2001 23:46:10 -0400, David Goodger <goodger@users.sourceforge.net> wrote: >[David] >>> The document tree is meant to be an specific document/DTD/schema >>> implementation only, not a generic DOM. > >[Paul] >> I'm not sure I understand what you mean here. ... >> (what do you mean by a "generic DOM"?) > >DOM is a generic XML data structure. It contains an ``Element`` class = (among >others), whose instances represent all elements. If you want to store a >``list`` element, it would be an ``Element`` instance whose ``tagName`` >attribute was set to "list". It's not very useful from an = object-oriented >programming point of view; you have to switch on the ``tagName`` = attribute >instead of using polymorphism. Got you. That makes complete sense. But why does all my tree walking stuff (and Tibs') spend its time switching on tagname then? Actually, I know the answer to this - coding a "proper" object-oriented tree-walk is hard. It's the sort of thing the Visitor pattern is intended to handle, but as I pointed out in another message, Visitor relies on the right infrastructure being in place in the "visited" hierarchy - and designing that infrastructure is hard. It's probably significant that most of the classes in the DPS doc tree are of the form class paragraph(_TextElement): pass There's no polymorphism here. The class name is *only* relevant in setting the tagname attribute via introspection. In many ways, this tree isn't really object-oriented at all. Let me come back to this later_. >It's free, yes, but the cost is too high. It depends on how you want to >build the data structure, and what you want to do with the data = structure >once it's complete. In most XML-processing applications, you parse an >already-existing XML file to a data structure, for which DOM is a valid >choice. The reStructuredText parser is *building* a document tree = piecemeal, >and it's easier and more powerful to say ``node =3D nodes.list()`` than = it is >to say ``node =3D minidom.Element("list")``, especially when you can = customize >the ``nodes.list`` class with specialized behaviour. .. _later: OK, I see the point. I was looking at using the tree, not building it. I agree that building trees using DOM is verbose and clumsy (I've seen code for it before). So maybe building using specialised code, then using asdom() to get a DOM, which can then be processed by standard XML tools, is a valid approach. But as Juergen Hermann pointed out, asdom() is only one (trivial) example of a visitor pattern, so we probably need to factor out the visitor, and reimplement asdom in terms of it. I'll look at this. I do wonder about your comment "especially when you can customize the ``nodes.list`` class with specialized behaviour". Agreed, it's a valid advantage. But you don't *use* that advantage. The only significantly polymorphic aspects of nodes.py are the bits in support of asdom(). [The astext() method works polymorphically, but as I can't see where I might use this for other than a #text node, so making the polymorphism moot, I'm discounting this]. This isn't to criticise your design. I'm still trying to get a handle on it from an output point of view. I had started from the assumption that the DPS doc tree was pretty much inviolate, and I should work with it as it stands. It looks like there are probably changes needed to support output. I'm a bit nervous about fiddling with something that central, though... >As for processing the data structure once complete, I haven't done much = yet >but I'm sure there will be advantages if it's made up of custom objects. That's a fairly clear confirmation that you believe that there is a need to incorporate changes in support of output :-) Paul. [I'll comment on the blockquote stuff separately] From gustav@morpheus.demon.co.uk Thu Oct 25 22:35:46 2001 From: gustav@morpheus.demon.co.uk (Paul Moore) Date: Thu, 25 Oct 2001 22:35:46 +0100 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <B7FD0095.195CC%goodger@users.sourceforge.net> References: <4e0ett030c7jqgvjs1s747o94jvoj4dhn9@4ax.com> <B7FD0095.195CC%goodger@users.sourceforge.net> Message-ID: <m6sgtt456rqqfatpcbn6gfd81enp0i40b2@4ax.com> On Wed, 24 Oct 2001 23:46:10 -0400, David Goodger <goodger@users.sourceforge.net> wrote: >> I view blockquotes as basically a way of displaying a quotation, or = something >> similar, without the "..." around it. > >Correct. OK. >> As such, it would be a pretty rare thing. > >I've used block quotes many times. For example, see my 2001-10-17 = Doc-SIG >post, "horizontal rules & text divisions". Used block quotes twice. =46air enough. It's a style thing. Your call, I guess. I suppose that as = I tend to think of reST in the context of E-Mail (in this group), quotes aren't as common (because the standard E-Mail ">" quoting convention takes its place). >If we have a TeX Writer, PostScript and PDF are almost free. Can't wait! Your wish is my command... Paul. From gustav@morpheus.demon.co.uk Thu Oct 25 22:35:47 2001 From: gustav@morpheus.demon.co.uk (Paul Moore) Date: Thu, 25 Oct 2001 22:35:47 +0100 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <002c01c15d31$5c04be80$545aa8c0@lslp862.int.lsl.co.uk> References: <B7FD0095.195CC%goodger@users.sourceforge.net> <002c01c15d31$5c04be80$545aa8c0@lslp862.int.lsl.co.uk> Message-ID: <nqugtt04ltco4rpidbi56tkorvdbjf4l1m@4ax.com> On Thu, 25 Oct 2001 09:45:12 +0100, "Tony J Ibbs (Tibs)" <tony@lsl.co.uk> wrote: >Meanwhile, I happily use blockquotes a lot to inset text for >"commentary" purposes - something that is difficult to convey otherwise >(of course, I also use parentheses and em-dashes a lot in writing text, >so perhaps I'm not a perfect examplar). That's going to come back to haunt you if another output processor formats blockquotes more "quotishly". My point was the reverse. I use indented text a lot in plain text, for things like lists. I'm happy for reST processors to indent lists automatically for me, but I don't like to lose the ability to format reST source for readability. I prefer:: This is how I would normally format a list in plain text: 1. First item 2. Second item to this:: This is how reST requires it, if I am to avoid spurious blockquotes: 1. First item 2. Second item Maybe simply defining a special case - a blockquote which contains nothing but a list, is treated as a simple list, without the blockquote. Of course this makes it impossible to write a blockquote containing only a list, and it *is* a special case, which is bad in itself. I'm focussing on the fact that reST should be readable in its raw form, as well as after processing. Maybe that's not the best view to take, but I'm not sure how often reST will be read unprocessed. At the moment, 99.999% of the reST I see is unprocessed (not just due to the lack of output processors - for example, I would never bother putting an E-Mail through a formatter, I'd read it "raw". And I *like* using reST in E-Mail - it enhances the expressiveness). I dunno. Maybe it's simply a case where you have to accept that reST can't be expected to handle "pure" plain text without *any* concessions to markup needs... Paul. From goodger@users.sourceforge.net Fri Oct 26 01:36:07 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Thu, 25 Oct 2001 20:36:07 -0400 Subject: [Doc-SIG] Re: Output writers and XSLT In-Reply-To: <hlogttcnakss6hrl2hb80aeu6cihla7kht@4ax.com> Message-ID: <B7FE2836.196E9%goodger@users.sourceforge.net> [David;] >> If PyXML were to be included in the stdlib, though... [Paul;] > In other words, packages aimed at the core cannot use technologies which > are not part of the core, even if such technologies are available in > Python, and are appropriate. Grmph. I see your point (although I wish I > didn't). I would certainly support a push for inclusion in the core. I can't be the champion though; enough on my plate as it is. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From fdrake@acm.org Fri Oct 26 04:13:46 2001 From: fdrake@acm.org (Fred L. Drake) Date: Thu, 25 Oct 2001 23:13:46 -0400 (EDT) Subject: [Doc-SIG] [development doc updates] Message-ID: <20011026031346.8550628697@beowolf.digicool.com> The development version of the documentation has been updated: http://python.sourceforge.net/devel-docs/ Yet another experimental change to the presentation -- ditch the proportional font for code since some displays (especially interactive sessions and tabular displays) get messed up with proportional fonts. We do try to use monospaced fonts that are less ugly than Courier. As before, feedback on the fonts is welcome at python-docs@python.org. From goodger@users.sourceforge.net Fri Oct 26 04:21:55 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Thu, 25 Oct 2001 23:21:55 -0400 Subject: [Doc-SIG] How to traverse a document object In-Reply-To: <89qgttgkk7sh6t9s9vidrpeumt7tr73bd1@4ax.com> Message-ID: <B7FE4F12.196EF%goodger@users.sourceforge.net> Paul Moore wrote: > But why does all my tree walking stuff (and Tibs') spend its time switching > on tagname then? Actually, I know the answer to this - coding a "proper" > object-oriented tree-walk is hard. I don't know about that. I've got the inkling of an elegant structure glimmering in my mind (including a judicious use of a __getattr__ method for default behaviour). I just haven't needed it yet. Maybe you can beat me to it! > It's probably significant that most of the classes in the DPS doc tree > are of the form > > class paragraph(_TextElement): pass > > There's no polymorphism here. The class name is *only* relevant in > setting the tagname attribute via introspection. So far, perhaps so. There's a lot of infrastructure to be added yet. > I do wonder about your comment "especially when you can customize > the ``nodes.list`` class with specialized behaviour". Agreed, it's a > valid advantage. But you don't *use* that advantage. Not *yet*. > I had started from the assumption that the DPS doc tree was pretty much > inviolate, and I should work with it as it stands. Aha! Nothing could be further from the truth. You must leave such assumptions behind! > It looks like there are probably changes needed to support output. I'm > a bit nervous about fiddling with something that central, though... That's where SourceForge patches and peer review work their magic. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From goodger@users.sourceforge.net Fri Oct 26 04:25:38 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Thu, 25 Oct 2001 23:25:38 -0400 Subject: [Doc-SIG] lists & block quotes In-Reply-To: <m6sgtt456rqqfatpcbn6gfd81enp0i40b2@4ax.com> Message-ID: <B7FE4FF1.196EF%goodger@users.sourceforge.net> Paul Moore wrote: > I prefer:: > > This is how I would normally format a list in plain text: > > 1. First item > 2. Second item > > to this:: > > This is how reST requires it, if I am to avoid spurious blockquotes: > > 1. First item > 2. Second item Ah. You seem to see lists as "belonging" to the referring paragraph. That's one interpretation, perfectly valid. Representing that idea properly and completely makes for tricky content models and processing though. > I'm focussing on the fact that reST should be readable in its raw form, > as well as after processing. Maybe that's not the best view to take, but > I'm not sure how often reST will be read unprocessed. Are you implying that reStructuredText *will* or *will not* be read much in its unprocessed form? If the latter, I don't think there's an issue. In typical HTML renderers, a list is indented relative to the text before & after. That could be the reason why you prefer lists indented. > I dunno. Maybe it's simply a case where you have to accept that reST > can't be expected to handle "pure" plain text without *any* concessions > to markup needs... It's a balancing act. Can't please everybody all of the time. This is one area where the balance has been properly struck though, I think. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From goodger@users.sourceforge.net Fri Oct 26 05:30:38 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Fri, 26 Oct 2001 00:30:38 -0400 Subject: [Doc-SIG] inline hyperlink targets Message-ID: <B7FE5F2C.196F0%goodger@users.sourceforge.net> While working on the outline of doctree.txt_, I wanted to categorize the elements. My first try was with a nested list structure:: - Root element: document_ - Body elements: - General body elements: paragraph_, literal_block_, block_quote_, doctest_block_, table_, figure_, footnote_ - Lists: bullet_list_, enumerated_list_, definition_list_, field_list_, option_list_ But I wanted to be able to refer back to each item from other parts of the document. That made me change the structure to one of nested sections:: Root Element ============ document_ Body Elements ============= General Body Elements --------------------- paragraph_, literal_block_, block_quote_, doctest_block_, table_, figure_, footnote_ Lists ----- bullet_list_, enumerated_list_, definition_list_, field_list_, option_list_ This solution rankles. Why let the markup determine the structure of my writing? That's backwards. But the best I could do with the current syntax would be to include a bunch of hyperlink targets. And in order not to break up the list, the targets would have to be inside the list items:: - .. _root element: Root element: document_ - .. _body element: Body elements: - .. _general body elements: General body elements: paragraph_, literal_block_, block_quote_, doctest_block_, table_, figure_, footnote_ - .. _lists: Lists: bullet_list_, enumerated_list_, definition_list_, field_list_, option_list_ Very awkward. Then I came up with the idea of allowing explicit hyperlink targets as inline markup:: - _`Root element`: document_ - _`Body elements`: - _`General body elements`: paragraph_, literal_block_, block_quote_, doctest_block_, table_, figure_, footnote_ - _`Lists`: bullet_list_, enumerated_list_, definition_list_, field_list_, option_list_ This seems to work. It can be rationalized as a natural consequence of the rest of reStructuredText's hyperlink syntax. I have two concerns: - This markup seems a little too noisy at first. But that may be because it's coming at the beginning of a list item, and is followed by a colon (which is *not* part of the markup). An example in the middle of a paragraph helps to alleviate this concern:: The _`quick brown fox` jumped over the lazy dog. - Should the backquotes be required, even for single-word targets? Initially I'd say yes, because leading-underscore terms are so common in code, and in the documentation of said code as well. Trailing-underscore terms are much less common. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From garth@deadlybloodyserious.com Fri Oct 26 06:34:30 2001 From: garth@deadlybloodyserious.com (Garth T Kidd) Date: Fri, 26 Oct 2001 15:34:30 +1000 Subject: [Doc-SIG] inline hyperlink targets In-Reply-To: <B7FE5F2C.196F0%goodger@users.sourceforge.net> Message-ID: <NBBBIJGOIKKLHHFHILDNCELIKHAA.garth@deadlybloodyserious.com> > Very awkward. Then I came up with the idea of allowing > explicit hyperlink targets as inline markup:: > > - _`Root element`: document_ Oh, cute. +1. Also fantastic for automatic construction of indexes -- whenever you mention a term for the first time, _`blargle` it. From gustav@morpheus.demon.co.uk Fri Oct 26 20:02:00 2001 From: gustav@morpheus.demon.co.uk (Paul Moore) Date: Fri, 26 Oct 2001 20:02:00 +0100 Subject: [Doc-SIG] Re: lists & block quotes In-Reply-To: <B7FE4FF1.196EF%goodger@users.sourceforge.net> References: <m6sgtt456rqqfatpcbn6gfd81enp0i40b2@4ax.com> <B7FE4FF1.196EF%goodger@users.sourceforge.net> Message-ID: <kbcjttgnq8vig2vet28d402vmfi707sdio@4ax.com> On Thu, 25 Oct 2001 23:25:38 -0400, David Goodger <goodger@users.sourceforge.net> wrote: >Ah. You seem to see lists as "belonging" to the referring paragraph. = That's >one interpretation, perfectly valid. Representing that idea properly and >completely makes for tricky content models and processing though. Exactly. When I write lists, they are usually preceded by "lead-in" text, so viewing the list as attached to the preceding paragraph seems exactly right. But I take your point that it's tricky to model properly. And your implication that there is an alternative interpretation, with lists as independent entities, explains where my ideas and yours are clashing. I'll try to start thinking differently about it, and see where that takes me. >> I'm focussing on the fact that reST should be readable in its raw = form, >> as well as after processing. Maybe that's not the best view to take, = but >> I'm not sure how often reST will be read unprocessed. > >Are you implying that reStructuredText *will* or *will not* be read much= in >its unprocessed form? If the latter, Sorry, I wasn't clear. I'm implying that reStructuredText *will* be read in its raw form quite a lot. At the very least, the *author* will spend most of his time reading the raw form he's just typed... In raw form, lists aren't indented unless you type them that way. So my interpretation of list structure results in me tending to type things wrongly (or at least, in a way which gives the wrong document structure). >It's a balancing act. Can't please everybody all of the time. This is = one >area where the balance has been properly struck though, I think. Agreed. Both on the fact that it's a balancing act, and on the fact that you've hit the right balance - now that I understand your logic. Thanks for following this through with me. Paul. From tavis@calrudd.com Fri Oct 26 21:28:22 2001 From: tavis@calrudd.com (Tavis Rudd) Date: Fri, 26 Oct 2001 13:28:22 -0700 Subject: [Doc-SIG] font change in the development version of the docs Message-ID: <01102613282200.01979@lucy> Hi, I've just noticed that the font used to list module names, source snippets and method/function names has been changed in the devel version of the docs. IMHO, the old font was much more readable. Also, will this change affect the output from the mkhowto script? If it will there should be an option to use the original fonts. Cheers, Tavis From jaffray@pobox.com Mon Oct 29 02:20:45 2001 From: jaffray@pobox.com (Alan Jaffray) Date: Sun, 28 Oct 2001 21:20:45 -0500 (EST) Subject: [Doc-SIG] reStructuredText inline markup Message-ID: <Pine.LNX.4.21.0110180226580.3248-100000@starchild.astral.net> In the current reStructuredText specification, inline markup can't be nested and is not extensible. IMHO this is a problem. Nesting is needed in some very simple cases:: Most recent interpretation of the Second Amendment has been based on `*USA vs. Miller* (1939)`__. __ http://caselaw.lp.findlaw.com/scripts/getcase.pl?court=us&vol=307&invol=174 Extensibility beyond the current "roles" mechanism is also necessary. For example, one of my intended applications for rST currently has a frequently-used tag to refer to another user of the system:: I had lunch with <lj user="tikva" text="Rachel"> today. It's a nice semantically meaningful output-format-neutral element. I don't know how I'd do something equivalent in rST. If it weren't inline, I'd use a directive, and if it didn't have an argument, I'd use a role, but as it is, I think I'm stuck. The extensibility problem is relatively easy to address if you allow attributes or arguments in roles:: I had lunch with :lj user=tikva:`Rachel` today. But to me, that syntax looks confusing. I was never too fond of the `` :rolename:`text` `` syntax in the first place, and adding spaces makes it more confusing. I'd like to get something more block-looking to go around the rolename and arguments. I'd also like to require that it be postfix, both for simplicity, and to follow the general principle that the text should be primary and the way it's marked up should be an aside. :: I had lunch with `Rachel`{lj user=tikva} today. My guess is that most non-markup uses for braces are in programming language examples, and most of those will be in literal blocks or inline literals or interpreted text, so stealing the braces won't lead to too much extra escaping. The other problem is that lots of inline markup is obtrusive and ugly:: I had lunch with `Rachel`{lj user=tikva icon="badger.png"} today. If we think of these as inline directives, we can steal a play from the hyperlink book, and drag the role out-of-line:: I had lunch with `Rachel`{_} today. .. _Rachel: {lj user=tikva icon="badger.png"} There's even the possibility of:: I had lunch with `Rachel`{__} today. __ {lj user=tikva icon="badger.png"} I'm not sure about nesting. Some cases are easy, but any time you have two constructs that involve backquotes, problems will ensue because backquotes don't nest. But backquotes are a really nice unobtrusive delimiter for sections of text, and it'd be a shame to replace them with braces or angle brackets or something. I have some bad ideas. Anyone have some good ideas? Alan From usc@ieee.org Mon Oct 29 20:10:54 2001 From: usc@ieee.org (Ueli Schläpfer) Date: 29 Oct 2001 21:10:54 +0100 Subject: [Doc-SIG] reStructuredText inline markup In-Reply-To: Alan Jaffray's message of "Sun, 28 Oct 2001 21:20:45 -0500 (EST)" References: <Pine.LNX.4.21.0110180226580.3248-100000@starchild.astral.net> Message-ID: <m2snc2xl4h.fsf@hobbes.dyn.dhs.org> Alan Jaffray <jaffray@pobox.com> writes: > In the current reStructuredText specification, inline markup can't be > nested and is not extensible. IMHO this is a problem. > > Nesting is needed in some very simple cases:: > > Most recent interpretation of the Second Amendment has been based > on `*USA vs. Miller* (1939)`__. > > __ http://caselaw.lp.findlaw.com/scripts/getcase.pl?court=us&vol=307&invol=174 > I'll keep out of this battle -- but you should find plenty of material in the archive. > Extensibility beyond the current "roles" mechanism is also necessary. > For example, one of my intended applications for rST currently has a > frequently-used tag to refer to another user of the system:: > > I had lunch with <lj user="tikva" text="Rachel"> today. > > It's a nice semantically meaningful output-format-neutral element. > I don't know how I'd do something equivalent in rST. If it weren't > inline, I'd use a directive, and if it didn't have an argument, I'd > use a role, but as it is, I think I'm stuck. [...] Doesn't the current spec_ cover your wishes better than you seem to think? The spec says clearly that the role may be prefix or postfix, and that the interpretation is domain-dependent. .. _spec: *reStructuredText Markup Specification*, CVS version 1.22 of 2001/10/27 So nothing should keep you from supplying your own handler for the ``lj`` role and write:: I had lunch with `text=Rachel user=tikva`:lj: today. That's not more obtrusive than your example, :: I had lunch with <lj user="tikva" text="Rachel"> today. or is it? And it would be entirely up to you to use some mail-header inspired quoting mechanism, i.e.:: I had lunch with `Rachel <tikva>`:lj: today. All that you'd need to do in this case is to write a layer that interfaces with the rfc822 module! (Actually, to me this looks like a nice solution for your case, but there are obvious limits as to how much data you can stuff inline without getting something very obtrusive.) > I had lunch with `Rachel`{lj user=tikva} today. > > My guess is that most non-markup uses for braces are in programming > language examples, and most of those will be in literal blocks or > inline literals or interpreted text, so stealing the braces won't > lead to too much extra escaping. > > The other problem is that lots of inline markup is obtrusive and ugly:: > > I had lunch with `Rachel`{lj user=tikva icon="badger.png"} today. > > If we think of these as inline directives, we can steal a play from > the hyperlink book, and drag the role out-of-line:: > > I had lunch with `Rachel`{_} today. > > .. _Rachel: {lj user=tikva icon="badger.png"} How about:: I had lunch with `Rachel`_ today. .. _Rachel: .. lj:: user=tikva icon="badger.png" I'm not sure about the idented directive -- I could find no explicit exclusion, so I assume that it is correct syntax. But is it necessary, or would this do as well (similar to multiple targets for a hyperlink):: I had lunch with `Rachel`_ today. .. _Rachel: .. lj:: user=tikva icon="badger.png" > There's even the possibility of:: > > I had lunch with `Rachel`{__} today. > > __ {lj user=tikva icon="badger.png"} > [...] Just my 2 cents, Ueli From jaffray@pobox.com Mon Oct 29 21:10:31 2001 From: jaffray@pobox.com (Alan Jaffray) Date: Mon, 29 Oct 2001 16:10:31 -0500 (EST) Subject: [Doc-SIG] reStructuredText inline markup In-Reply-To: <m2snc2xl4h.fsf@hobbes.dyn.dhs.org> Message-ID: <Pine.LNX.4.21.0110291527450.19098-100000@starchild.astral.net> On 29 Oct 2001, Ueli Schl=E4pfer wrote: > Alan Jaffray <jaffray@pobox.com> writes: >=20 > > Nesting is needed in some very simple cases:: > >=20 > > Most recent interpretation of the Second Amendment has been based= =20 > > on `*USA vs. Miller* (1939)`__. > >=20 > > __ http://caselaw.lp.findlaw.com/scripts/getcase.pl?court=3Dus&vo= l=3D307&invol=3D174 > >=20 >=20 > I'll keep out of this battle -- but you should find plenty of material > in the archive. The only comments I can find, searching on "nested inline doc-sig" or "nested inline restructuredtext", are David's remark of "that way lies madness" with no explanation and Tony's note that it'd be a pain to=20 implement and he wasn't certain how important it was. > Doesn't the current spec_ cover your wishes better than you seem to > think? The spec says clearly that the role may be prefix or postfix, > and that the interpretation is domain-dependent. >=20 > .. _spec: *reStructuredText Markup Specification*, CVS version 1.22 of > 2001/10/27 Is that valid? The reference processor says:: Warning: [level 1] Hyperlink target at line 5 contains whitespace. Pe= rhaps a footnote was intended? > So nothing should keep you from supplying your own handler for the > ``lj`` role and write:: >=20 > I had lunch with `text=3DRachel user=3Dtikva`:lj: today. >=20 > That's not more obtrusive than your example, :: >=20 > I had lunch with <lj user=3D"tikva" text=3D"Rachel"> today. >=20 > or is it? Indeed, but they're both awful. :-) > And it would be entirely up to you to use some mail-header inspired > quoting mechanism, i.e.:: >=20 > I had lunch with `Rachel <tikva>`:lj: today. That works well in this case with only one argument that isn't too distracting when placed inline and has an evocative shorthand. But imagine:: The `text=3D"biohazard" src=3D"biohazard.png" height=3D20 width=3D20`= :img: symbol must be used on containers used to dispose of medical waste. That really needs to get placed yanked out of the flow of text. :: The `biohazard`{_} symbol must be used on containers used to dispose of medical waste. .. _biohazard: {img src=3D"biohazard.png" height=3D20 width=3D20} Alternately, if you prefer something directive-like:: The `biohazard`:_: symbol must be used on containers used to dispose of medical waste. .. _biohazard:: img src=3D"biohazard.png" height=3D20 width=3D20 I don't like that for two reasons. First, it doesn't obey the usual ``directive_name:: directive_args`` pattern. Second, it looks odd=20 when you make the interpreted text into a hyperlink:: The `biohazard`:_:_ symbol ... My brain tokenizes that as ``:_ :_``, while it does the right thing with ``{_}_``, turning it into ``{_} _``. > How about:: >=20 > I had lunch with `Rachel`_ today. >=20 > .. _Rachel: > =09 > .. lj:: user=3Dtikva icon=3D"badger.png" Now we're getting into using that target syntax for not only hrefs and anchors, but also macro inclusion. rST doesn't currently have anything which includes referenced text at the current position in the document. Not necessarily a bad idea, and macro-including directives would solve the inline markup issue, but it's getting into new territory. Alan From fdrake@acm.org Tue Oct 30 06:23:32 2001 From: fdrake@acm.org (Fred L. Drake) Date: Tue, 30 Oct 2001 01:23:32 -0500 (EST) Subject: [Doc-SIG] [development doc updates] Message-ID: <20011030062332.77F4928697@cj42289-a.reston1.va.home.com> The development version of the documentation has been updated: http://python.sourceforge.net/devel-docs/ Re-arranged the material in Chapter 2 (built-in things) to make it easier to start off with. Functions come before Types and Exceptions, and file objects are promoted one level in the outline, making them easier to find (they now appear in the table of contents instead of being hidden in the "Other Objects" category). From garth@deadlybloodyserious.com Wed Oct 31 02:29:30 2001 From: garth@deadlybloodyserious.com (Garth T Kidd) Date: Wed, 31 Oct 2001 13:29:30 +1100 Subject: [Doc-SIG] reStructuredText inline markup In-Reply-To: <Pine.LNX.4.21.0110291527450.19098-100000@starchild.astral.net> Message-ID: <NBBBIJGOIKKLHHFHILDNMEGNKIAA.garth@deadlybloodyserious.com> Yaaargh. Messy messy messy. I haven't read the spec for a while. What's wrong with user:`uid`? The filter/patterner/munger/renderer/whatever can substitute the full text for an appropriate link, right? > -----Original Message----- > From: doc-sig-admin@python.org [mailto:doc-sig-admin@python.org]On > Behalf Of Alan Jaffray > Sent: Tuesday, 30 October 2001 8:11 AM > To: usc@ieee.org > Cc: Alan Jaffray; Doc-SIG@python.org > Subject: Re: [Doc-SIG] reStructuredText inline markup > > > On 29 Oct 2001, Ueli Schläpfer wrote: > > Alan Jaffray <jaffray@pobox.com> writes: > > > > > Nesting is needed in some very simple cases:: > > > > > > Most recent interpretation of the Second Amendment > has been based > > > on `*USA vs. Miller* (1939)`__. > > > > > > __ > http://caselaw.lp.findlaw.com/scripts/getcase.pl?court=us&vol= > 307&invol=174 > > > > > > > I'll keep out of this battle -- but you should find plenty > of material > > in the archive. > > The only comments I can find, searching on "nested inline doc-sig" or > "nested inline restructuredtext", are David's remark of "that way lies > madness" with no explanation and Tony's note that it'd be a pain to > implement and he wasn't certain how important it was. > > > Doesn't the current spec_ cover your wishes better than you seem to > > think? The spec says clearly that the role may be prefix > or postfix, > > and that the interpretation is domain-dependent. > > > > .. _spec: *reStructuredText Markup Specification*, CVS > version 1.22 of > > 2001/10/27 > > Is that valid? The reference processor says:: > > Warning: [level 1] Hyperlink target at line 5 contains > whitespace. Perhaps a footnote was intended? > > > So nothing should keep you from supplying your own handler for the > > ``lj`` role and write:: > > > > I had lunch with `text=Rachel user=tikva`:lj: today. > > > > That's not more obtrusive than your example, :: > > > > I had lunch with <lj user="tikva" text="Rachel"> today. > > > > or is it? > > Indeed, but they're both awful. :-) > > > And it would be entirely up to you to use some mail-header inspired > > quoting mechanism, i.e.:: > > > > I had lunch with `Rachel <tikva>`:lj: today. > > That works well in this case with only one argument that isn't too > distracting when placed inline and has an evocative shorthand. > But imagine:: > > The `text="biohazard" src="biohazard.png" height=20 width=20`:img: > symbol must be used on containers used to dispose of > medical waste. > > That really needs to get placed yanked out of the flow of text. :: > > The `biohazard`{_} symbol must be used on containers used > to dispose > of medical waste. > > .. _biohazard: {img src="biohazard.png" height=20 width=20} > > Alternately, if you prefer something directive-like:: > > The `biohazard`:_: symbol must be used on containers used > to dispose > of medical waste. > > .. _biohazard:: img src="biohazard.png" height=20 width=20 > > I don't like that for two reasons. First, it doesn't obey the usual > ``directive_name:: directive_args`` pattern. Second, it looks odd > when you make the interpreted text into a hyperlink:: > > The `biohazard`:_:_ symbol ... > > My brain tokenizes that as ``:_ :_``, while it does the right thing > with ``{_}_``, turning it into ``{_} _``. > > > How about:: > > > > I had lunch with `Rachel`_ today. > > > > .. _Rachel: > > > > .. lj:: user=tikva icon="badger.png" > > Now we're getting into using that target syntax for not only hrefs and > anchors, but also macro inclusion. rST doesn't currently > have anything > which includes referenced text at the current position in the > document. > Not necessarily a bad idea, and macro-including directives would solve > the inline markup issue, but it's getting into new territory. > > Alan > > > > > _______________________________________________ > Doc-SIG maillist - Doc-SIG@python.org > http://mail.python.org/mailman/listinfo/doc-sig From jaffray@pobox.com Wed Oct 31 03:28:43 2001 From: jaffray@pobox.com (Alan Jaffray) Date: Tue, 30 Oct 2001 22:28:43 -0500 (EST) Subject: [Doc-SIG] reStructuredText inline markup In-Reply-To: <NBBBIJGOIKKLHHFHILDNMEGNKIAA.garth@deadlybloodyserious.com> Message-ID: <Pine.LNX.4.21.0110302217590.1794-100000@starchild.astral.net> On Wed, 31 Oct 2001, Garth T Kidd wrote: > I haven't read the spec for a while. What's wrong with user:`uid`? Huh? That's not even a markup construct in the current spec. Nor does it capture "<TEXT> referring to user <USERNAME>", which was the simplest example I gave of useful inline markup that the current spec can't handle. Alan From goodger@users.sourceforge.net Wed Oct 31 05:01:38 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Wed, 31 Oct 2001 00:01:38 -0500 Subject: [Doc-SIG] nesting (was re: reStructuredText inline markup) In-Reply-To: <m2snc2xl4h.fsf@hobbes.dyn.dhs.org> Message-ID: <B804EFE1.1A337%goodger@users.sourceforge.net> [Alan] > In the current reStructuredText specification, inline markup can't > be nested and is not extensible. IMHO this is a problem. > > Nesting is needed in some very simple cases:: > > Most recent interpretation of the Second Amendment has been > based on `*USA vs. Miller* (1939)`__. > > __ http://caselaw.lp.findlaw.com/scripts/getcase.pl? > court=us&vol=307&invol=174 BTW, the ``__`` syntax is now implemented. There have been some changes to the doc tree though: "reference" replaces "link", and "target" now uses a "refuri" attribute to hold what used to be data (the data is now used for an inline target). > I'm not sure about nesting. Some cases are easy, but any time you > have two constructs that involve backquotes, problems will ensue > because backquotes don't nest. But backquotes are a really nice > unobtrusive delimiter for sections of text, and it'd be a shame to > replace them with braces or angle brackets or something. I have some > bad ideas. Anyone have some good ideas? [Ueli] > I'll keep out of this battle -- but you should find plenty of material > in the archive. [Alan] > The only comments I can find, searching on "nested inline doc-sig" > or "nested inline restructuredtext", are David's remark of "that way > lies madness" with no explanation and Tony's note that it'd be a > pain to implement and he wasn't certain how important it was. You didn't look back far enough, and your search may have been too specific (try searching for only "nest"). Try, for example, Ed Loper's 2001-03-21 post, which details some rules for nested inline markup. I think the complexity is prohibitive for the marginal benefit. (And if you can understand that tree without going mad, you're a better man than I. ;-) Inline markup is already fragile. Allowing nested inline markup would only be asking for trouble IMHO. If it proves absolutely necessary, it can be added later. The rules for what can appear inside what must be well thought out first though. -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From goodger@users.sourceforge.net Wed Oct 31 05:27:46 2001 From: goodger@users.sourceforge.net (David Goodger) Date: Wed, 31 Oct 2001 00:27:46 -0500 Subject: [Doc-SIG] extensibility (was re: reStructuredText inline markup) In-Reply-To: <Pine.LNX.4.21.0110291527450.19098-100000@starchild.astral.net> Message-ID: <B804F601.1A339%goodger@users.sourceforge.net> extensibility (was re: reStructuredText inline markup) [Alan] > Extensibility beyond the current "roles" mechanism is also > necessary. For example, one of my intended applications for rST > currently has a frequently-used tag to refer to another user of the > system:: > > I had lunch with <lj user="tikva" text="Rachel"> today. > > It's a nice semantically meaningful output-format-neutral element. It's also markup-heavy and very application specific. If you want that level of markup, you'll have to live with markup that looks like markup. > The extensibility problem is relatively easy to address if you allow > attributes or arguments in roles:: > > I had lunch with :lj user=tikva:`Rachel` today. Instead, think of the role as the tag name; you can parse the text between the backquotes however you like. > But to me, that syntax looks confusing. I was never too fond of the > `` :rolename:`text` `` syntax in the first place, and adding spaces > makes it more confusing. It's a last resort, for application-specific constructs. It's useful in moderation, but I hope that the ``:role:`text``` syntax is never abused. > I'd also like to require that it be postfix, both for simplicity, > and to follow the general principle that the text should be primary > and the way it's marked up should be an aside. :: > > I had lunch with `Rachel`{lj user=tikva} today. As Ueli pointed out, postfix is OK too. [Ueli] > And it would be entirely up to you to use some mail-header inspired > quoting mechanism, i.e.:: > > I had lunch with `Rachel <tikva>`:lj: today. [Alan] > That works well in this case with only one argument that isn't too > distracting when placed inline and has an evocative shorthand. And if this is the main or only use of interpreted text in your application, you could drop the role altogether:: I had lunch with `Rachel <tikva>` today. Maybe you could do a text to username lookup in your app:: I had lunch with `Rachel` today. [Alan] > But imagine:: > > The `text="biohazard" src="biohazard.png" height=20 > width=20`:img: symbol must be used on containers used to dispose > of medical waste. > > That really needs to get placed yanked out of the flow of text. What may be needed is the equivalent of SGML/XML's named entities. Something like this (syntax arbitrary and subject to debate):: The #biohazard# symbol must be used on containers used to dispose of medical waste. .. substitution:: biohazard text="biohazard" source="biohazard.png" height=20 width=20 (Although the "text=" attribute may be redundant and unnecessary.) ``#biohazard#`` would be replaced by whatever the ``substitution:: biohazard`` directive generates. Instead of ``#name#``, the syntax could be a variant of interpreted text too. Something like:: `name`@ or `name`# or `name`& [Alan] > If we think of these as inline directives, we can steal a play from > the hyperlink book, and drag the role out-of-line:: > > I had lunch with `Rachel`{_} today. > > .. _Rachel: {lj user=tikva icon="badger.png"} > > There's even the possibility of:: > > I had lunch with `Rachel`{__} today. > > __ {lj user=tikva icon="badger.png"} You do like curly braces, don't you? ;-) What is the end result of this markup? Is it going to end up as a hyperlink? Please show us how you would mark it up in HTML. [Ueli] > How about:: > > I had lunch with `Rachel`_ today. > > .. _Rachel: > > .. lj:: user=tikva icon="badger.png" > > I'm not sure about the idented directive -- I could find no explicit > exclusion, so I assume that it is correct syntax. It's not included in the three things allowed in a link block: nothing or empty (internal hyperlink target), URI (external target), reference (indirect target). I suppose a hyperlink target's link block could be generalized to allow a directive also ("custom hyperlink target"?), but I'm not sure if it's warranted for the general case. And even if directives were allowed inside hyperlink targets' link blocks, they would still need to produce a hyperlink target. Non-hyperlink cases wouldn't benefit. (Note that the way the syntax works now, the link block would have to immediately follow the target marker, with no blank line in-between, unlike Ueli's example.) [Ueli] > But is it necessary, or would this do as well (similar to multiple > targets for a hyperlink):: > > I had lunch with `Rachel`_ today. > > .. _Rachel: > .. lj:: user=tikva icon="badger.png" That depends on what the "lj" construct actually does. Looking at the above, I'd expect "Rachel" to be a reference to a picture or object where the ``.. _Rachel:`` target points. [Alan] > Now we're getting into using that target syntax for not only hrefs > and anchors, but also macro inclusion. rST doesn't currently have > anything which includes referenced text at the current position in > the document. Not necessarily a bad idea, and macro-including > directives would solve the inline markup issue, but it's getting > into new territory. It may be the right territory though. Generalizing further, the "substitution" directive could contain text, or a directive which resolves to text or an image or some other inline-compatible object. > it looks odd when you make the interpreted text into a hyperlink:: > > The `biohazard`:_:_ symbol ... > > My brain tokenizes that as ``:_ :_``, while it does the right thing > with ``{_}_``, turning it into ``{_} _``. That's *horrible*! This is supposed to be a readable markup. We must exercise restraint! [Ueli] > Doesn't the current spec_ cover your wishes better than you seem to > think? The spec says clearly that the role may be prefix or postfix, > and that the interpretation is domain-dependent. > > .. _spec: *reStructuredText Markup Specification*, CVS version 1.22 > of 2001/10/27 [Alan, referring to Ueli's ``.. _spec:`` construct above] > Is that valid? The reference processor says:: > > Warning: [level 1] Hyperlink target at line 5 contains > whitespace. Perhaps a footnote was intended? It probably should be a footnote. Notice how helpful the parser is? -- David Goodger goodger@users.sourceforge.net Open-source projects: - Python Docstring Processing System: http://docstring.sourceforge.net - reStructuredText: http://structuredtext.sourceforge.net - The Go Tools Project: http://gotools.sourceforge.net From tony@lsl.co.uk Wed Oct 31 10:20:46 2001 From: tony@lsl.co.uk (Tony J Ibbs (Tibs)) Date: Wed, 31 Oct 2001 10:20:46 -0000 Subject: [Doc-SIG] reStructuredText inline markup In-Reply-To: <Pine.LNX.4.21.0110291527450.19098-100000@starchild.astral.net> Message-ID: <004601c161f5$b4885580$545aa8c0@lslp862.int.lsl.co.uk> Despite his saying he won't get involved, I like Ueli's analysis of possible ways around your problem. I'd add that I think Alan is maybe working to the wrong model - I think of reST as more like a simple text formatting language, rather than more like a data description language. Consider how one would derive (for instance) TeX code from it, and what that would look like on the page. Alan Jaffray said: > The only comments I can find, searching on "nested inline doc-sig" or > "nested inline restructuredtext", are David's remark of "that way lies > madness" with no explanation and Tony's note that it'd be a pain to > implement and he wasn't certain how important it was. As David says, there's more history than that. My failing memory (isn't it always) hints that ST has never supported nested inline markup (or at least, not predictably) - that may have been despite claims to the contrary. Don't know about setext. My own "prototype" system was very simple, and was re based, and I was leaving such stuff for later - whilst it is clearly *possible* to do nested inline markup with simple re usage (you recognise one level, split the text out and leave "markers" behind, then recognise the next level, etc., taking care not to introduce ordering problems), it's a pain (I knew broadly what to do, but the implementation would be that sort of fun that isn't, if you see what I mean, and there were other things to do). Trying to get three people (e.g., me, Edward Loper and David) to agree on what made *sense* in terms of nesting was difficult, too - what about edge cases like ``*Emphasis enclosing **bold***``? I'm sure David could write his parser to cope with nested inline markup, but the nest of snakes isn't so much in the implementation as in the description of what is allowed - it looked like it was always going to introduce potential unexpectedness. The "solution" of dropping **strong** emphasis was not acceptable, which leaves the other "solution" of leaving it alone until a strong case for the need for it is made, possibly with appropriate patches (to code *and* documentation). My initial reaction to that approach was one of dismay, but some intense thought quickly showed me that, in practice, I could easily live with the restriction, at least for the initial roll-out of reST and DPS. "simple is better than complex" Tibs -- BikeCode0.2 http://www.tibsnjoan.co.uk/bikecode.html P: [Tibs] Tc B10 K:++ i29:30" h1.65m n1960 H+:~ v~ A+ M+ Rg- B: [AnthroTech] 3tRu U1c w37" Wr19:406 Mfr SAf bDh[Sachs]:C G3x7 8s Lrr1B Cb[Michael] VjsX col[MidnightBlue] T: [BurleyD'Lite] 2c2[Thomas] f++ VsX My views! Mine! Mine! (Unless Laser-Scan ask nicely to borrow them.)