User Tools

Site Tools


computer_science:wiki_color_syntax

This is an old revision of the document!


color Plugin

—- plugin —- description: Opportunity to write colored text in DokuWiki author : Harald Hanche-Olsen email : harald.hanche-olsen@ntnu.no type : Syntax lastupdate : 2018-10-12 compatible : 2009-12-25, 2010-11-07, 2011-05-25, 2012-01-25, 2014-05-05, 2014-09-29d, Adora Belle, Weatherwax, Binky, Ponder Stibbons, Detritus,Elenor Of Tsort, Frusterick Manners, Greebo depends : conflicts : similar : fontcolor, emphasis, wrap tags : typography, highlight, color, text

downloadurl: https://github.com/hanche/dokuwiki_color_plugin/archive/2018-10-12.zip sourcerepo : https://github.com/hanche/dokuwiki_color_plugin bugtracker : https://github.com/hanche/dokuwiki_color_plugin/issues

screenshot_img: https://folk.ntnu.no/hanche/tmp/dokuwiki_color_plugin.png


Installation

Please use the extension manager to install the plugin, no configuration needed.

Usage

Place this code sample in your playground:

<color green>text</color>
<color blue/lightgrey>text</color>
<color #FF0000>text</color>
<color /#FFff00>text</color>
<color rgb(80%,0%,0%)/rgb(100%,80%,100%)>text</color>
<color hsl(120,100%,30%)/hsl(180,50%,90%)>text</color>

and you will see something like this:

Color plugin in action

This plugin supports the X11 color names, hex triples (like #123 or #123456 for rgb), hex quadruples (#1234 or #12345678 for rgba), rgb, rgba, hsl, and hsla color specifications. This plugin does not try hard to catch syntax errors in your color specifications, however. If you use these specifications wrong, you may simply notice that they won't work. Beware that not all color specifications work on all browsers. Check Can I Use if in doubt.

  • The plugin works by wrapping contents in a <span> element with a suitable style attribute. Therefore, you cannot wrap it around block level items such as headers, lists, and tables.
  • You cannot use it inside headers either, since you can't use wiki syntax within a header.

Discussion

This source for this plugin is shown in the Sample Plugin Tutorial.

Development

Christopher Smith seems to have left the plugin unmaintained. User leeyc0 provided hosting of the plugin on github, but has no time to maintain it either. Harald Hanche-Olsen took over in October 2018. The plugin is considered fairly stable, though, and the new maintainer does not foresee a very active maintenance schedule.

Update History

  • 2018-10-12 New maintainer
  • 2018-10-10 Added support for rgb[a](…) and hsl[a](…) color specifications
  • 2018-08-09 Added code for handling metadata to the render method
  • 2016-06-25 Added ODT support based on branch “redesign”
  • 2014-01-04 hosted in github by leeyc0
  • 2008-02-06 — Fixed a security vulnerability in the colour pattern. Any users of this plugin should apply this update. — Christopher Smith 2008-02-06 17:20
computer_science/wiki_color_syntax.1599092798.txt.gz · Last modified: 2020/09/03 00:26 by cosmo