О «Докувики»
Дополнительные возможности
Для предпринимателей
Наше сообщество
Следуйте за нами на Фейсбуке, в Твиттере и других социальных сетях.
Конфиденциальность (англ.)
О «Докувики»
Дополнительные возможности
Для предпринимателей
Наше сообщество
Следуйте за нами на Фейсбуке, в Твиттере и других социальных сетях.
Конфиденциальность (англ.)
Это старая версия документа!
Плагин типографики расширяет разметку «ДокуВики» за счет возможностей набора текста. Тег разметки <typo> определяет свойства шрифта CSS, такие как вид шрифта, размер, жирность и цвет текста. Параметр состоит из пар свойство-значение CSS (свойство: значение;), каждая пара должна быть разделена точкой с запятой (;), однако последняя может быть опущена. Вы можете использовать сокращенное короткое имя вместо полного имени свойства.
Некоторое конкретное короткое имя также доступно как тег разметки; <ff> (семейство шрифтов / имя), <fs> (размер), <fc> (цвет), <bg> (цвет фона), <fw> (вес). Плагин типографики полностью заменяет: fontfamily, fontsize2 и fontcolor.
short name | css property name | description |
---|---|---|
fc | color | цвет текста |
bg | background-color | цвет фона текста |
fs | font-size | размер шрифта текста (большой или мелкий) |
fw | font-weight | weight of a font (thick or thin characters in text) |
fv | font-variant | display text in a small-caps font |
ff | font-family | font family for text, must be single quoted if a font name contains white-space and non-ASCII characters |
lh | line-height | space between the lines |
ls | letter-spacing | an extra space between characters (in px, em, etc) |
ws | word-spacing | an additional space between words (in px, em, etc) |
sp | white-space | specifies how white-space is handled (preserve or collapse) |
va | vertical-align | sets the vertical alignment |
- | text-transform | controls the capitalization of text (capitalize, uppercase or lowercase) |
- | text-shadow | adds shadow to text |
wf | (web-font) | specify a web font class which prefixed «wf-» |
Sometimes, inline styles are necessary when you are building a page by hand. You should however avoid them whenever possible for «semantic markup», better maintainability, and reusability. The wrap plugin will provide most powerful and flexible method for specifying a class attribute.
Typography plugin provides short name (or single property) syntax those are compatible with fontfamily, fontcolor, 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:
.
Single parameter example:
<typo font-size:large;>Large</typo>, <typo fs:x-large>Very large</typo>, <fs:xx-large>Huge</fs>, and <fs smaller>smaller</fs> size text
Multiple parameter example:
<typo fs:larger; fw:bold; ff:serif>Bold serif</typo>, <fs:large; fv:small-caps>Small-caps</fs> text
Nesting syntax:
<ff:'Georgia', 'MS Serif', serif><fs:36px; lh:1.1> There is nothing either good or bad, \\ but thinking makes it so. </fs>\\ <fs:smaller;>//-- William Shakespeare, “Hamlet”, Act 2 scene 2//</fs></ff>
Using Web font
For getting started with the Google Fonts API, you may add a stylesheet link to request the desired web font(s) in conf/meta.html file, for example:
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Tangerine"> <style> .wf-tangerine { font-family: Tangerine, serif; } </style>
Then you can use the font name (eg. Tangerine) in the font-family value:
<ff Tangerine; fs:48px>Making the Web Beautiful!</ff> <wf:tangerine; fs:48px>Making the Web Beautiful!</wf>
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:
As you might see there are currently some limitations regarding the ODT export:
Note: The ODT export feature of typography plugin requires PHP 5 >= 5.3.0
Typography plugin for DokuWiki was initially developed by Paweł Piekarski, original version (v0.1101 / 2011-01-18) is still available from http://treecode.pl/typography.html .
Since 2014-07-28, the plugin code has moved to github repository to provide better accessibility for install and further development opportunity. Thanks Paweł for your early work and encouraging me to move the code to github. — s.sahara 2014-07-28 14:57
The ODT renderer feature is contribution from Lars (LarsDW223).
fw:
(font-weight) and sp:
(white-space) parameters<typo fw:900;>Heavy text</typo>
//if ($isSameHost && $isColorSet) { // }