]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/todo/color_plugin.mdwn
response
[ikiwiki.git] / doc / todo / color_plugin.mdwn
index f8fd1109188166dcd0c6eb71c8b8f66ad84cc0c9..069e2d4c2ac2f2897973cbfefee0be4190e30ddc 100644 (file)
@@ -1,6 +1,6 @@
 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
 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
-<span class="color">foo bar baz</span>.
+`<span class="color">foo bar baz</span>`.
 
 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 ;)
 
 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 ;)
@@ -14,3 +14,28 @@ 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]]
 but I don't have a better idea right now.
 
 What do you think about it? --[[Paweł|ptecza]]
+
+> 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]]
+> 
+>      \[[color red,green """
+>      Xmas-colored markdown here
+>      """]]
+
+>> 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? ;)
+
+>>> I was thinking one would be foreground, the other background. Don't
+>>> know if setting the background makes sense or not.
+
+>> 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]]
+
+>> Yes, it's a good intro plugin, have at it! --[[Joey]]