[kramdown-users] Attributes on li elements

Shawn Van Ittersum svicalifornia at gmail.com
Sun Mar 14 15:27:58 EDT 2010


So there's an existing precedent for this syntax proposal.  Even better! :)

Thanks,
Shawn

On Sun, 14 Mar 2010 15:25:58 -0400, Eric Sunshine wrote:
> I was going to argue that this would cause a conflict with header 
> elements in which there already can be whitespace between the header 
> and the attribute. However, I realized that, since headers are block 
> level elements, your whitespace-is-significant idea is really a 
> generalization of the particular special case for headers.
> 
> -- ES
> 
> 
> On 3/14/2010 3:09 PM, Shawn Van Ittersum wrote:
>> That would be my second choice (and it's one of the syntaxes I tried 
>> to get kramdown to do what I wanted).
>> 
>> However, the nice thing about appending the block attributes on the 
>> same line after some spaces is that they are very easy to add and 
>> remove, without having to add lines for the each instance of 
>> attributes and get the indentation right for each one.  I'm working 
>> with a big nested list, so there will be variation of the 
>> indentation.  It would be great to paste the block attributes at the 
>> ends of lines.
>> 
>> I think it also looks a bit cleaner, as the attributes appear at the 
>> end of the lines that to which they apply:
>> 
>> * Task one  {.high}
>> * Task two  {.medium}
>> * Task three  {.low}
>> 
>> This looks clearer and more readable (and obviously, more compact 
>> vertically) than the alternative:
>> 
>> * Task one
>>    {.high}
>> * Task two
>>    {.medium}
>> * Task three
>>    {.low}
>> 
>> Thanks,
>> Shawn
>> 
>> On Sun, 14 Mar 2010 14:51:00 -0400, Eric Sunshine wrote:
>>> Perhaps take the indentation of the attribute specification into account:
>>> 
>>>    * Foo
>>>    * Bar
>>>      {:.li-attr}
>>>    {:.ul-attr}
>>> 
>>> -- ES
>>> 
>>> 
>>> On 3/14/2010 2:47 PM, Shawn Van Ittersum wrote:
>>>> How about checking for spaces before the attributes to determine
>>>> whether it applies to the immediately preceding span (no spaces) or
>>>> to the current block?  Examples:
>>>> 
>>>> **span element**{:.span_attributes}
>>>> 
>>>> Any block element (p, li, etc)   {:.block_attributes}
>>>> 
>>>> Block element ending with a **span element**{:.span_attributes}
>>>> {:.block_attributes}
>>>> 
>>>> Shawn
>>>> 
>>>> On Sun, 14 Mar 2010 19:30:05 +0100, Thomas Leitner wrote:
>>>>>> I'd like to apply a class to some elements of an unordered list:
>>>>>> 
>>>>>> * Top item
>>>>>> * Second item
>>>>>> * Not as important {.low-priority}
>>>>>> * When we get around to it {.low-priority}
>>>>>> 
>>>>>> But the above Markdown does not apply the "low-priority" class to the
>>>>>> LI.  I've tried putting the attributes list after the asterisk, and
>>>>>> on the next line, with and without indent, and so far nothing has
>>>>>> worked.  Can you tell me how to accomplish this?
>>>>> 
>>>>> This is not possible in kramdown and I can't think of a syntax to
>>>>> enable this.
>>>>> 
>>>>> -- Thomas
>>>>> _______________________________________________
>>>>> kramdown-users mailing list
>>>>> kramdown-users at rubyforge.org
>>>>> http://rubyforge.org/mailman/listinfo/kramdown-users
>>>> _______________________________________________
>>>> kramdown-users mailing list
>>>> kramdown-users at rubyforge.org
>>>> http://rubyforge.org/mailman/listinfo/kramdown-users
>>>> 
>>> _______________________________________________
>>> kramdown-users mailing list
>>> kramdown-users at rubyforge.org
>>> http://rubyforge.org/mailman/listinfo/kramdown-users
>> _______________________________________________
>> kramdown-users mailing list
>> kramdown-users at rubyforge.org
>> http://rubyforge.org/mailman/listinfo/kramdown-users
>> 
> _______________________________________________
> kramdown-users mailing list
> kramdown-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/kramdown-users


More information about the kramdown-users mailing list