[Pmwiki-users] A though on list syntax

Christian Ridderström chr
Mon Apr 19 14:16:02 CDT 2004


Hi

I've noticed that when I write lists in e-mails, I often write like this:

* A item, with a long paragraph with text, where the second line
  is indented to indicate that it belongs to the item.

So even though I like the current notation where whitespace on the
beginning of a line indicates preformatted text, I also really would like
to be able to do lists as I described in the example above. The reason is 
that that way has started to feel very natural to me.

One solution that essentially keeps both notations would be to keep 
producing preformatted text for most situations, unless all of these 
conditions are satisfied:
* The previous line/paragraph contains an item (enumerated or itemized), 
  or the previous line was an intendented continuation of an item.
* The current line is indented with spaces so that the first 
  non-whitespace character on the line is aligned with the first 
  non-whitespace character of the previous line (not counting the '*' or 
  '#' of course)


Here are some examples (indented with one TAB to separate them from the 
explaining/separating text):

An example with preformatted text:
	Markup:				Renders as:
	Bla bla ...			Bla bla ...
	    Preformatted text		    Preformmated text

And an example with an item with extra lines:
	Bla bla...			Bla bla...
	* Bla bla bla 			 * Bla bla bla blu blu
	  blu blu blu			   blu blr blr
	  blr blr

	  Preformatted text		  Preformatted text
	  (the line above not an item)	  (the line above not an item)

Illustrating that the amount of whitespace between the '*' and the first 
character is important.

	Bla bla...			Bla bla...
	*Bla bla bla			 * Bla bla bla bla bla (more
	 bla bla (more text belonging	   text belonging to the item
         to the item above)		   above)
	  Preformatted text		  Preformatted text

An example with a second level item:
	Bla bla...			Bla bla...
	* An item			 * An item
	** A subitem,			   * A subitem, bla bla
	   bla bla bla...		     bla...

As for implementation, it should at least in theory be possible to set a 
variable indicating that the previous line was an item and the variable 
could contain the n:o spaces required for the current line to be 
interpreted as an extension of the previous item.

I should also mention that this does not restrict you in the whitespace
indentation of preformatted text after a list, since the list notation
allows you to arbitrarily choose how much whitespace you want betwwen the
'*' and the first character. This is illustrated in the examples below,
where the preformatted text is indented with two spaces, so the item must
have either no space or two spaces between the '*' and the first text of
the item:

	Bla bla...			Bla bla...
	*An item			 * An item
	  Preformatted text		  Preformatted text
	*  An item			 * An item
	  Preformatted text		  Preformatted text

This was kind of difficult to explain using words, but I think it would be
quite obvious to simply use. Anyway, I just wanted to mention this since
I'm using it so much in my e-mails...

/Christian

-- 
Christian Ridderstr?m                           http://www.md.kth.se/~chr





More information about the pmwiki-users mailing list