DokuWiki

It's better when it's simple

User Tools

Site Tools


plugin:fontsize

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
plugin:fontsize [2013-12-30 19:26] – [Discussion] 89.69.55.1plugin:fontsize [2024-12-23 03:57] (current) – [Discussion] 2601:85:c500:29ef:e981:1354:fb21:698
Line 1: Line 1:
-====== fontsize plugin ======+====== FontSize Plugin ======
  
 ---- plugin ---- ---- plugin ----
-description: This plugin allows text in different sizes.+description: Allow different font sizes
 author     : Jesús A. Álvarez author     : Jesús A. Álvarez
 email      : zydeco@namedfork.net email      : zydeco@namedfork.net
 type       : syntax type       : syntax
 lastupdate : 2008-04-25 lastupdate : 2008-04-25
-compatible : >= 2005-07-01+compatible : !Hogfather
 depends    :  depends    : 
 conflicts  conflicts 
 similar    :  similar    : 
-tags       : style, typography+tags       : !broken, style, typography
  
-downloadurl: http://namedfork.net/files/dokuwiki-plugin-fontsize.tgz+downloadurl: https://trello.com/1/cards/5b05a6ddb3dd6d590cd2dac7/attachments/5b05a6f0f970d45e5a5e2f72/download/fontsize.zip 
 +bugtracker :  
 +sourcerepo :  
 +donationurl:  
 + 
 +screenshot_img: 
 ---- ----
- 
-^  Download | [[http://namedfork.net/files/dokuwiki-plugin-fontsize.tgz|dokuwiki-plugin-fontsize.tgz]] | 
  
 ===== Description ===== ===== Description =====
 +
 This plugin allows to write text in different sizes. This plugin allows to write text in different sizes.
  
 ===== Syntax ===== ===== Syntax =====
-Enclose the text in ''%%##%%'' tags to make it larger, and in ''%%,,%%'' to make it smaller.\\ + 
-Add more #or ,to increase or decrease the size in steps of 20%.+Enclose the text in ''%%##%%'' tags to make it larger, and in ''%%,,%%'' to make it smaller. 
 + 
 +Add more ''#'' or '','' to increase or decrease the size in steps of 20%.
  
   ##this text is shown at 120% of the base size##, ###this is 140%### ####and this is 160%####   ##this text is shown at 120% of the base size##, ###this is 140%### ####and this is 160%####
   ,,this is smaller, at 80%,, and ,,,this is at 60%,,,   ,,this is smaller, at 80%,, and ,,,this is at 60%,,,
   ,,if I were to put a comma after a small text,,%%,%% I would need to enclose the comma in double percent signs   ,,if I were to put a comma after a small text,,%%,%% I would need to enclose the comma in double percent signs
-   
-##this text is shown at 120% of the base size##, ###this is 140%### ####and this is 160%#### 
-,,this is smaller, at 80%,, and ,,,this is at 60%,,, 
-,,if I were to put a comma after a small text,,%%,%% I would need to enclose the comma in double percent signs 
  
 ===== Source Code ===== ===== Source Code =====
 +
 Create a directory ''fontsize'' in ''/wiki/lib/plugins'' and save the code in a ''syntax.php'' file there. Create a directory ''fontsize'' in ''/wiki/lib/plugins'' and save the code in a ''syntax.php'' file there.
-<code php>+ 
 +<code php syntax.php>
 <?php <?php
 /** /**
Line 43: Line 47:
 * @author     Jesús A. Álvarez <zydeco [at] namedfork [dot] net> * @author     Jesús A. Álvarez <zydeco [at] namedfork [dot] net>
 */ */
-  
-if(!defined('DOKU_INC')) define('DOKU_INC',realpath(dirname(__FILE__).'/../../').'/'); 
-if(!defined('DOKU_PLUGIN')) define('DOKU_PLUGIN',DOKU_INC.'lib/plugins/'); 
-require_once(DOKU_PLUGIN.'syntax.php'); 
    
 class  syntax_plugin_fontsize extends DokuWiki_Syntax_Plugin { class  syntax_plugin_fontsize extends DokuWiki_Syntax_Plugin {
Line 57: Line 57:
  'name'   => 'Font Size Plugin',  'name'   => 'Font Size Plugin',
  'desc'   => 'Allow different font sizes.',  'desc'   => 'Allow different font sizes.',
- 'url'    => 'http://www.dokuwiki.org/plugin:fontsize',+ 'url'    => 'https://www.dokuwiki.org/plugin:fontsize',
  );  );
  }  }
Line 74: Line 74:
     }     }
  
- function handle($match, $state, $pos, &$handler){+ function handle($match, $state, $pos, Doku_Handler $handler){
  switch ($state) {  switch ($state) {
  case DOKU_LEXER_ENTER:  case DOKU_LEXER_ENTER:
Line 88: Line 88:
  }  }
  
- function render($mode, &$renderer, $data) {+ function render($mode, Doku_Renderer $renderer, $data) {
  if ($mode == 'xhtml') {  if ($mode == 'xhtml') {
  list($state, $match) = $data;  list($state, $match) = $data;
Line 107: Line 107:
 //Setup VIM: ex: et ts=4 enc=utf-8 : //Setup VIM: ex: et ts=4 enc=utf-8 :
 </code> </code>
 +
 ===== Discussion ===== ===== Discussion =====
  
 Hi. Is is me or I can't get the system to recognize a link if it's put in smalltext? Hi. Is is me or I can't get the system to recognize a link if it's put in smalltext?
- 
  
 <code> <code>
Line 156: Line 156:
 ------- -------
 Patching plugin works, thank you! Patching plugin works, thank you!
 +
 +--------
 +
 +I wanted to link to a larger text, like
 +
 +<code>
 +[[fs|####test####]]
 +</code>
 +
 +but the number-signs are not resolved. I tried adding the patch above in syntax.php, but it did not work. Outside of the links, it works fine. Any idea?
 +
 +
 +----
 +24/06/2020 15:42:46
 +Does not seems to work with HogFather 5.3
 +
 +
 +----
 +
 +25/09/2020 08:05
 +I fixed this plugin for usage with HogFather, shown below:
 +<file php fontsize-hogfather.patch>--- syntax-before.php   2020-09-25 08:09:45.294662375 -0500
 ++++ syntax.php  2020-09-25 08:08:40.477774548 -0500
 +@@ -36,7 +36,7 @@
 +         $this->Lexer->addExitPattern(',,+', 'plugin_fontsize');
 +     }
 +
 +-       function handle($match, $state, $pos, &$handler){
 ++       function handle($match, $state, $pos, Doku_Handler $handler){
 +                switch ($state) {
 +                        case DOKU_LEXER_ENTER:
 +                                if ($match{1} == '#')
 +@@ -50,7 +50,7 @@
 +                return array();
 +        }
 +
 +-       function render($mode, &$renderer, $data) {
 ++       function render($mode, Doku_Renderer $renderer, $data) {
 +                if ($mode == 'xhtml') {
 +                        list($state, $match) = $data;
 +                        switch ($state) {
 +</file>
 +Apply using the following command: \\ ''patch syntax.php < fontsize-hogfather.patch''
 +
 +----
 +2024-12-23
 +
 +This plugin does not work with "Kaos" and will corrupt your conf\local.php file.
plugin/fontsize.1388428015.txt.gz · Last modified: by 89.69.55.1

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