[pmwiki-users] Fixme icon
Robert Riebisch
rr at bttr-software.de
Fri Jan 10 04:07:39 PST 2020
Hi Petko,
>> Now I wish to apply "vertical-align: middle;" to that icon.
>>
>> I tried different variants, but it won't work:
>>
>> Markup('FIXME', 'directives', '/\\(:FIXME:\\)/', "(:div
>> class=icon:)$PubDirUrl/fixme.gif\"FIXME\"\n(:divend:)");
>>
>> This shows the icon + a trailing "(:divend:)" in PmWiki preview. :-(
>>
>> I'll also take other solutions, of course.
>
> I would only add to pub/css/local.css the styles like this:
>
> img[src$="fixme.gif"] { vertical-align: middle; }
Sorry, I didn't get it.
Did you mean:
Put this to config.php:
Markup('FIXME', 'directives', '/\\(:FIXME:\\)/',
"$PubDirUrl/fixme.gif\"FIXME\"");
*And* this to pub/css/local.css:
img[src$="fixme.gif"] { vertical-align: middle; }
?
Is
img[src$="fixme.gif"] { vertical-align: middle; }
something special from PmWiki or is it a CSS feature?
I've never seen that syntax before?
No $PubDirUrl required?
Is pub/css/local.css processed by the PmWiki engine and not just
delivered to the browser?
Anyway, I couldn't get it work. :-(
> If your markup produces line breaks that need to be processed again by
> the markup engine (like the divend needs to be start-of-line to work),
> you need to either do it before the "split" rule, or have a function
> that calls the function PRR().
OK
> In your case the former is easy, instead of 'directives' use '<split' as
> a second argument. For the latter, see PmWiki:CustomMarkup and
> PmWiki:Functions or some existing addon.
I used '<split' like this:
Markup('FIXME', '<split', '/\\(:FIXME:\\)/', "(:div
class=icon:)$PubDirUrl/fixme.gif\"FIXME\"\n(:divend:)");
It works fine together with:
img.icon { vertical-align: middle; }
But it breaks, when there's something else on the same line, e.g.,
(:FIXME:) CPU, RAM, disk space, OS
HTML source code will become:
<div class='icon' ><img src='https://{**snip**}/pub/fixme.gif'
alt='FIXME' title='FIXME' />
</div> CPU, RAM, disk space, OS
and "CPU, RAM, disk space, OS" will be shown on a separate line, which
is not, what I want (or how DokuWiki works).
Markup('FIXME', '<split', '/\\(:FIXME:\\)/', "(:div
class=icon:)$PubDirUrl/fixme.gif\"FIXME\"\n(:divend:)\\");
produces:
<div class='icon' ><img
src='https://wiki.bttr-software.de/pub/fixme.gif' alt='FIXME'
title='FIXME' />
</div>\ CPU, RAM, disk space, OS
No solution.
Cheers,
Robert
--
+++ BTTR Software +++
Home page: https://www.bttr-software.de/
DOS ain't dead: https://www.bttr-software.de/forum/
More information about the pmwiki-users
mailing list