Cette page est en anglais parce que le développeur de ce module est anglophone et que certaines infos ici lui sont plus ou moins destinées.
The version of Text_Wiki I use is alpha 20.1
My modifications
Here follow the little modifications I have done on Text_Wiki
Rule image: make up an align="center"
We make up an align="center" value for the tag
Ok, this value doesn't exist, but USERS often want it, and as wiki syntax if for USERS who don't know much of html and is here to make life easy for THEM, we create it. Proefficient html coders will understand our trick.
In Render/Xhtml/Image.php we add :
unset($options['attr']['align']);
$options['attr']['style'] .= 'display:block;margin-left:auto;margin-right:auto;';
}
Rule image: try to guess width and height of images
Web browsers are known to render a webpage faster when they are told with and height of images in the image tag, so we take a guess :
if (!$options['attr']['width'] && !$options['attr']['height']) {
$imageFile = trim($src,'"');
if (strpos($src,':')) {
discard protocol
$imageFile = substr($imageFile,strpos($src,':')+3);
discard hostname but keep the leading slash
$imageFile = substr($imageFile,strpos($imageFile,'/'));
}
$imageSize = getimagesize($_SERVER['DOCUMENT_ROOT'].$imageFile);
if (is_array($imageSize)) {
$options['attr']['width'] = $imageSize0;
$options['attr']['height'] = $imageSize1;
}
}
Bug : // are rendered inside
Rule wikilink: we don't check if the page exists
This is a little particularity of my system that even non existent pages have a link to them. I just get rid of some code in Render/Xhtml/Wikilink.php (maybe a config var would be cool.
Rule freelink: we don't check if the page exists
Obviously we do the same for freelinks.
Fiddle with entities
I remove the html entities translation in Parse/Translatehtml.php because it cripples my UTF-8 caracters :-(
Change freelinks to [page_linked text shown]
This is a personal point of view, but I don't like these free links: ((free link page|what is shown)) so I have changed the regexp in Parse/Freelink.php to have that syntax for free links: [page_linked text shown]
The main goal of this is to be consistent . The goal of this wikifarm is to be used by muggles and I want to make it easy for them. The one linking rule would then be:
You want to make a link: use []
The ((|)) just looks to distant from the other syntaxes.
customisation of interwiki links
little change in Render/Interwiki.php so that you can have a full html char instead of just a link (to get interwiki links like this one : )
little change in Parse/Interwiki.php so that you can put @ and . in interwiki links.
Ecrire votre commentaire
Vous devez vous connecter pour pouvoir ajouter un commentaire.