DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:typography

Typography Plugin

Compatible with DokuWiki

  • 2017-02-19 "Frusterick Manners" yes
  • 2016-06-26 "Elenor Of Tsort" yes
  • 2015-08-10 "Detritus" yes
  • 2014-09-29 "Hrun" yes

plugin Plugin extends wiki markup to give wiki users ability to write beautiful text

Last updated on
2017-01-10
Provides
Syntax
Repository
Source
Conflicts with
edittable

Similar to fontcolor, fontfamily, fontsize2, wrap

Tagged with style, typography

Download and Installation

Install the plugin through the Extension Manager or Plugin Manager using the download URL above, which points to latest version of the plugin. Refer to plugin installation instructions.

This plugin depends on PHP GD library (gdlib) to generate color picker icons. If gdlib is not installed on the web server, you may choose only red color from font color toolbar menu .

Feature

This is a “formatting” type syntax plugin for styling text (non-semantic approach). Sometimes there is need for nice looking slogan, quotation or article paragraph. For full control you need full control over font displaying as CSS can give. Typography plugin extends DokuWiki markup by typesetting abilities.

  • It brings all font related directives from CSS as wiki syntax. (Such as color, size, fontname)
  • It gives ability to adjust settings for text look, but does not influence subtle stuff like text baseline or vertical alignment.
  • It provides additional short (or single property) syntax those are compatible with fontcolor, fontfamily and fontsize2.

Examples/Usage

For information please visit plugin home page (v0.1101 / 2011-01-18).

Using "typo" syntax

<typo fc:red; bg:lightyellow; fs:150%; ff:san-serif;>extended text formatting</typo>.

The Wiki source showed above will converted to HTML:

<span style="color:red; background-color:lightyellow; font-size:150%; font-family:serif; ">extended text formatting</span>.

"typo" syntax parameters

Parameters css property
fc: (font) color
bg: background-color
fs: font-size
ff: font-family
fw: font-weight
fv: font-variant
lh: line-height
ls: letter-spacing
ws: word-spacing
va: vertical-align
sp: white-space

Using short syntax with Toolbar menu

The Typography plugin provides additional short (or single property) syntax those are compatible with fontcolor, fontfamily and fontsize2. If you have enabled these three plugin, the short syntax are treated by relevant plugins instead of this plugin. These short syntax are available through toolbar icons: .

<fc Turquoise>Specific color text</fc>        = <typo fc:Turquoise;>Specific color text</typo>
<ff 'Comic Sans MS'>Different font used</ff>  = <typo ff:'Comic Sans MS';>Different font used</typo>
<fs 200%>Large size text</fs>                 = <typo fs:200%;>Large size text</typo>

Renderer support

Starting with release 2014-10-13 this plugin also supports ODT export (Open Document Text format). On the left side you see a screenshot taken from a typography test page opened in a browser, on the right side you see the page exported to ODT:

XHTML rendering ODT rendering

As you might see there are currently some limitations regarding the ODT export:

  • altering the text size is currently not supported Altering the text size is supported since release 2015-04-02.
  • after a line-height typography tag is closed, a new paragraph begins. ODT only supports setting the line-height per paragraph. The XHTML renderer stays in the same line after the tag is closed.
  • word spacing is not supported by the ODT format
  • the white space options are currently not supported

Note: The ODT export feature of typography plugin requires PHP 5 >= 5.3.0

Development

Since 2014-07-28, the plugin code has moved to github repository to provide better accessibility for install and further development opportunity. Thanks Pawel for your early works and encouraging me to move the code to github. — s.saharas.sahara

2014-07-28 14:57

The ODT renderer feature is contribution from Lars (LarsDW223).

The original source code of v0.1101 is available from: http://treecode.pl/typography.html

Change Log from github repository

ToDo/Wish List

  • add fw: (font-weight) and sp: (white-space) parameters
  • it would be nice to have the text-align parameter

Known Bugs and Issues

Not working

  • This plugin doesn't seem to be working at all for me. Is anyone else having the same problem? ~~lenehey 10/31/2010
  • I get just garbage out of this plugin. dokuwiki 2010-11-07a “Anteater”. Schplurtz. 13/03/2011
    • Can't second it. The first two given examples on the plugin homepage are working as they should. — M. S.Matthias Schulte
      lupo49

      2011/03/14 18:17
    • The examples given worked fine in my “Anteater” — antoniomch 4/4/2011
    • This plugin works. There are only certain conditions in which it will work. I find that it does not work for lists, and thus need to apply the code to every single “bullet” in the list for it to apply. Not a huge issue, but using styled formatting works fine. -eiri. 12/13/2013
  • This plugin is incompatible with the EditTable plugin which is not working anymore when Typography is active. -Ronan 2014/08/04 (using DokuWiki Binky version)
    • The EditTable plugin worked fine with the Typography plugin on the DW “Ponder Stibbons”. — s.saharas.sahara

      2014-08-06 02:40
  • The font weight does not work, please check and give an example 2015-08-07
  • All the features I've tried work fine with dokuwiki Release 2015-08-10a “Detritus”. You have to have those semi-colons though. I've used the <typo> and <fs> tags with great success.
  • on USB Stick-Version of “Elenor Of Tsort” the color picker doesn't show colors. Did solve it by removing the if-case
    //if ($isSameHost && $isColorSet) {   
  •   // }
plugin/typography.txt · Last modified: 2017-03-04 10:38 by s.sahara