From: David G. <go...@py...> - 2003-03-10 18:53:37
|
David Abrahams wrote: > I'm not wedded to the syntax. ``` could work. That would be ambiguous. Currently, to mark up a backquote as an inline literal, you'd use:: ````` That wouldn't be possible if we adopted ``` as "squeezing" markup. >> Could you show us specific examples where you'd like to do character-level >> markup? > > In a pseudocode example, > > F(a1, a2,... aN) > > you might want most of the 'a's to be represented as ``code`` while > the numbers and the 'N' are represented in an italic variable-width > font (subscripted). Thanks; good example. > I think it might be enough to add a generalized escape which allows > arbitrary ugliness when it's absolutely needed. That would still > allow the rest of our ReST to stay pretty. There is already such a generalized (although verbose) mechanism for inline markup: interpreted text with roles. They could be done like this:: subscript: `1`:sub: or :sub:`1` superscript: `2`:sup: or :sup:`2` There's still the problem of character-level markup though: whitespace is required. One of the tricks listed in the To Do list is to use an escaped character: Escaped period or quote or dash as a disappearing catalyst to allow character-level inline markup? Escaped dash isn't a good choice (may be useful as a soft hyphen). Periods are used as markup (explicit markup start, ".. "), so might legitimately be escaped without the intention of the period "disappearing". That leaves the quote. The idea was that this could be used as markup:: F(``a``\'`1`:sub:, ``a``\'`2`:sub:, ... ``a``\'`N`:sub:) Exceedingly ugly, don't you think? But combining this idea with setting up a "squeeze environment", I came up with this:: F(\"``a`` `1`:sub:\", \"``a`` `2`:sub:\", ... \"``a`` `N`:sub:\") Here, the escaped-double-quote sequence acts as "squeeze delimiters". Add in escaped spaces as non-breaking spaces, and the above could be condensed to:: \"F(``a`` `1`:sub:,\ ``a`` `2`:sub:,\ ...\ ``a`` `N`:sub:)\" Also ugly, but less obtrusively so (maybe). It's ugly, but specialized and obscure enough that it may not matter. Another example:: \"*re* ``Structured`` *Text*\" >> Here's another idea: a "squeeze" directive used in a substitution:: >> >> Here's how to make |reStructuredText| do character-level markup. >> >> .. |reStructuredText| squeeze:: >> >> *re* ``Structured`` *Text* >> >> "Squeeze" will remove whitespace from its contents. > > The problem is that it squeezes a whole paragraph. Only the "*re* ``Structured`` *Text*" paragraph, which is inserted into the preceding paragraph by the substitution mechanism. Yes, this example is a bit of a kludge. > Unless... maybe we could have a category of directive which embeds > a paragraph in the surrounding ones. Not sure what you mean. A directive can emit a paragraph; all directives used in substitutions have to. > That would allow nearly arbitrary markup changes > without adding too much ugliness to the ReST language. The processing of a directive's contents are up to the directive, so anything goes. >> ----------- >> >> Unfortunately for Docutils, I'm currenly trying to fulfill a >> low-level need [*]_ (get a job), so I don't feel much impetus to >> fulfill higher-level needs like writing open-source software. > > Sorry to hear that; I wish I could help you. Thanks. Wasn't meant to be a complaint, just a warning. Should have added: "Therefore don't expect a quick response". In any case, this would be a major syntax addition that needs to be well thought out. -- David Goodger http://starship.python.net/~goodger Programmer/sysadmin for hire: http://starship.python.net/~goodger/cv |