Flat code block syntax
Waylan Limberg
waylan at gmail.com
Tue Dec 4 23:58:10 EST 2007
It should also be pointed out that if you are defining the language
used in each block, that helps as well:
some text...
~~~~{.python}
some python code
~~~~
more text
~~~~{.python}
more code
~~~~
We know the lang def only goes on the beginning marker, not the end,
so that helps keep things clear. Of course, I believe some have
proposed syntax that has the lang def at the end (or support for
either). That could make this argument irrelevant. Personaly, I would
suggest we only allow it at the begginging. I like to know what type
of code I'm reading before I start - rather than scrolling down to the
end.
On Dec 4, 2007 11:43 PM, Waylan Limberg <waylan at gmail.com> wrote:
> On Dec 4, 2007 4:29 PM, Thomas Nichols <nichols7 at googlemail.com> wrote:
> > I've been using the ~~~ syntax for marking code blocks for a few weeks,
> > and it's certainly an improvement over the existing four-space indent.
> > However, it can be difficult to see at a glance where one code block
> > begins and another ends, as in the following example:
> >
> > some normal text
> >
> > ~~~~
> >
> > some code
> >
> > ~~~~
> >
> > some more code... no, wait...
> >
> > ~~~~
> >
> > now *this* is code
> >
> > ~~~~
> >
> > and this ... errrr ...
> >
> > ~~~~
> >
>
> This is interesting, but if I understand the proposal correctly, there
> is no (upper) restriction of the number of tildes you can use as long
> as both the beginning and ending lines are of equal length. That means
> the first block could use 4 while the second could use 6. For example:
>
> Some text...
>
> ~~~~
> some code
> ~~~~
>
> More text...
>
> ~~~~~~
> more code
> ~~~~~~
>
> I realize that eliminating the blank lines helps also, but the
> differing lengths are easy enough for my eyes to catch.
>
>
> --
> ----
> Waylan Limberg
> waylan at gmail.com
>
--
----
Waylan Limberg
waylan at gmail.com
More information about the Markdown-Discuss
mailing list