From: David A. <da...@bo...> - 2003-03-10 19:31:55
|
David Goodger <go...@py...> writes: > 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` Nice! > 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? Yes, but serviceable. Did we discuss the idea that escaped whitespace disappears? F(``a``\ `1`:sub:, ``a``\ `2`:sub:, ... ``a``\ `N`:sub:) > 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". Icky (IMO). > 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). Yes. It's unfortunate that you really want '\ ' for a , since the need for breaking non-space comes up much more often in my work. > 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. Ah! I missed the substitution mechanism. >> 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. I think I just meant "substitution" ;-) > In any case, this would be a major syntax addition that needs to be > well thought out. There's the rub, eh? -- Dave Abrahams Boost Consulting www.boost-consulting.com |