2008-07-14 17:29:19 +02:00
|
|
|
Recently I've wanted to colour some piece of text on my Ikiwiki page.
|
|
|
|
It seems that Markdown can do it only using HTML tags, so I used
|
2008-07-15 10:12:13 +02:00
|
|
|
`<span class="color">foo bar baz</span>`.
|
2008-07-14 17:29:19 +02:00
|
|
|
|
|
|
|
However, in my opinion mixing Markdown syntax and HTML tags is rather ugly,
|
|
|
|
so maybe we should create a new color plugin to add more color to Ikiwiki ;)
|
|
|
|
I know that another Wikis have similar plugin, for example
|
|
|
|
[WikiDot](http://www.wikidot.com/).
|
|
|
|
|
|
|
|
I've noticed that htmlscrubber plugin strips `style` attribute, because of
|
|
|
|
security, so probably we need to use `class` attribute of HTML. But then
|
|
|
|
we have to customize our `local.css` file to add all color we want to use.
|
|
|
|
It's not as easy in usage like color name or definition as plugin argument,
|
|
|
|
but I don't have a better idea right now.
|
|
|
|
|
|
|
|
What do you think about it? --[[Paweł|ptecza]]
|
2008-07-14 22:08:54 +02:00
|
|
|
|
|
|
|
> Making a plugin preserve style attributes can be done, it just has to add
|
|
|
|
> them after the sanitize step, which strips them. The general method is
|
|
|
|
> adding placeholders first, and replacing them with the real html later.
|
|
|
|
>
|
|
|
|
> The hard thing to me seems to be finding a syntax that is better than a
|
|
|
|
> `<span>`. A preprocessor directive is not really any less ugly than html
|
|
|
|
> tags, though at least it could play nicely with nested markdown: --[[Joey]]
|
|
|
|
>
|
2008-07-21 13:45:54 +02:00
|
|
|
> \[[!color red,green """
|
2008-07-14 22:08:54 +02:00
|
|
|
> Xmas-colored markdown here
|
|
|
|
> """]]
|
2008-07-15 10:12:13 +02:00
|
|
|
|
|
|
|
>> I'm glad you like that idea. In my opinion your syntax looks good.
|
|
|
|
>> Out of curiosity, why did you used 2 colors in your example? What is HTML
|
|
|
|
>> result for it? ;)
|
|
|
|
|
2008-07-16 23:50:51 +02:00
|
|
|
>>> I was thinking one would be foreground, the other background. Don't
|
|
|
|
>>> know if setting the background makes sense or not.
|
|
|
|
|
2008-07-15 10:12:13 +02:00
|
|
|
>> I can try to create that plugin, if you are too busy now. I'm not Perl
|
|
|
|
>> hacker, but I wrote a lot of Perl scripts in my life and color plugin
|
|
|
|
>> doesn't seem to be very hard task. --[[Paweł|ptecza]]
|
2008-07-16 23:50:51 +02:00
|
|
|
|
|
|
|
>> Yes, it's a good intro plugin, have at it! --[[Joey]]
|