Hi schplurtz.
You have been working late. ;-)
I have done exactly has you instructed (BTW you are very good at instructions must have been a teacher in your other life).
This is the file I have came up with.
<?php
/**
* Font Size Plugin: Allow different font sizes
*
* @license GPL 3 (http://www.gnu.org/licenses/gpl.html)
* @author Jesús A. Álvarez <zydeco@namedfork.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 {
function getInfo(){
return array(
'author' => 'Jesús A. Álvarez',
'email' => 'zydeco@namedfork.net',
'date' => '2008-04-25',
'name' => 'Font Size Plugin',
'desc' => 'Allow different font sizes.',
'url' => 'https://www.dokuwiki.org/plugin:fontsize',
);
}
function getType() { return('formatting'); }
function getSort() { return 131; }
function connectTo($mode) {
$this->Lexer->addEntryPattern('##+(?=.*##+)',$mode,'plugin_fontsize');
$this->Lexer->addEntryPattern(',,+(?=.*,,+)',$mode,'plugin_fontsize');
}
function postConnect() {
$this->Lexer->addExitPattern('##+', 'plugin_fontsize');
$this->Lexer->addExitPattern(',,+', 'plugin_fontsize');
}
function handle($match, $state, $pos, Doku_Handler $handler){
switch ($state) {
case DOKU_LEXER_ENTER:
if ($match{1} == '#')
$size = (strlen($match)*20)+80 .'%';
else
$size = 120-(strlen($match)*20) . '%';
return array($state, $size);
case DOKU_LEXER_UNMATCHED: return array($state, $match);
case DOKU_LEXER_EXIT: return array($state, '');
}
return array();
}
function render($mode, &$renderer, $data) {
if ($mode == 'xhtml') {
list($state, $match) = $data;
switch ($state) {
case DOKU_LEXER_ENTER:
$renderer->doc .= "<span style='font-size:$match;'>"; break;
case DOKU_LEXER_UNMATCHED:
$renderer->doc .= $renderer->_xmlEntities($match); break;
case DOKU_LEXER_EXIT:
$renderer->doc .= '</span>'; break;
}
return true;
}
return false;
}
}
//Setup VIM: ex: et ts=4 enc=utf-8 :
The problem I have now is with your last instruction.
Once you're done changing this, reload your page.
I tried putting it back on the server using Extension Manager - Manual Install - Choose File -.
But Extension Manager will not let me pick up the directory 'fontsize' I can only pick a file so if I only pick the file syntax.php it does not do anything, except giving the error 'Header does not match it's checksum'.
So I tried with FileZila FTP. Uploaded 'fontsize' directory to the /lib/plugins directory.
Once this is done. Strange things happen.
I can not edit page anymore on DW. The Extension Manger does not work anymore.
FontSize is not working. Some Pages are working others not.
Site is not usable. Until I remove FontSize!!!.
I haven't tried Manua Install with a URL because I am not sure how to do it. I guess I would have to upload the fontsize directory to a Site and then give the URL of that file to Extension Manager... I might try that.
Are you seeing what went wrong?
Thanks again for your help.
Bat.