DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:icon

icon Plugin

Compatible with DokuWiki

  • 2024-02-06 "Kaos" unknown
  • 2023-04-04 "Jack Jackrum" unknown
  • 2022-07-31 "Igor" yes
  • 2020-07-29 "Hogfather" unknown

plugin Easily use SVG icon sets as images

Last updated on
2022-09-29
Provides
Action
Repository
Source

Similar to icons

Tagged with icon

This plugin allows you to reference icons from popular icon sets simply by name to include them as images into your wiki pages. The icons can easily be resized and colored.

Installation

Install the plugin using the Plugin Manager and the download URL above, which points to latest version of the plugin. Refer to Plugins on how to install plugins manually.

Examples/Usage

Icons are used just like any other image. The prefix icon: specifies that an icon is wanted.

{{icon:cow.svg}}

:!: This means you no longer can have a real media namespace called icon!

Since the linked icon is not an existing local image, you probably want to prevent the default linking. Just use the nolink flag:

{{icon:cow.svg?nolink}}

Of course you can also use standard image resizing:

{{icon:cow.svg?nolink&100x100}}

And of course the standard title mechanism (for hover tooltips) works and the icon can be used with the link syntax as usual:

[[animal:cow|{{icon:cow.svg|This is a cow link}}]]

Advanced configuration

Additional pseudo-namespaces can be used to further configure the icon. Just make sure the icon itself is at the end.

{{icon:twbs:link:w-3em:h-auto:cup-hot.svg?nolink}}

You can pick the icon set to be used, by specifying one of the following keywords. The example above uses a Twitter Bootstrap icon.

Namespace Repository
mdi Material Design Icons (default when none is given)
fab Font Awesome Brands
fas Font Awesome Solid
fa Font Awesome Regular
twbs Twitter Bootstrap Icons

You can define a color by either giving a hex color or a color from the template's style.ini. The example above refers to the default link color. To create a red icon you could use:

{{icon:ff0000:cow.svg}}

Instead of using the standard pixel based resizing syntax, you can also use any valid SVG unit to specify height and width. Prefix them with w- and h-. You can also use the auto keyword. The example above will resize the icon to a width of 3em and adjust the height automatically.

plugin/icon.txt · Last modified: 2024-03-05 09:07 by andi

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki