[pmwiki-users] publishPDF changes skin

John Rankin john.rankin at affinity.co.nz
Wed Oct 19 17:22:20 CDT 2005


On Thursday, 20 October 2005 10:38 AM, nexyufuli evo <noskule at gmx.net> wrote:
>> hi, john, I /guess I got thru this css and $HtmlStylesFmt stuff  and 
>> what has to be included first and defined after , so no more questions 
>> about changing styles. //;-)/   What I coudnt "correctly" solve  are 
>> changes of selflink  and stylechanges on wikicmds . Is is done be the 
>> $ExtensionMarkup [link] in markup.php (line 663). How could  /I 
>> disable this without changing the code? /
>> grz nos
>>
>oky, also solved. This $ExtensionMarkup [link] = false has to be 
>includet bevor. I dont understand why somtimes bevor and somtimes after 
>but it works .... grz nos
>
The short answer is: always set values before calling a recipe,
and if that doesn't work, contact the recipe author.

Let me see if I can clarify this. It's to do with setting values for
use later and setting values to enable the recipe to make a decision.

In general, setting values before will always work. The structure of
the markup extensions consists of the following logic block repeated
many times:

<is this extension enabled?> yes! <begin>
   do some 'work'
<end>

So, we have to tell the recipe whether something is enabled /before/
we invoke the recipe.

The 'work' often involves setting some variable that pmwiki will
use later, such as the format of a link. These generally involve
code of the form SDV(variable name, variable value), which says
'if this variable already has a value, do nothing, otherwise set 
it to the specified value'. So we can set the variable value
either before or after the recipe to control the value.

If we set the variable value /before/ the recipe, the SDV in the
recipe will honour our choice. However, if we set the variable 
/after/ the recipe, we have to use name = value, not 
SDV(name, value), because the recipe's setting will then take 
precedence.

But sometimes, a recipe doesn't use SDV, so the recipe will
over-write a value specified before.

So, a safe strategy is to ask ourselves the following:

Does the recipe need to know the value of this to decide
what to do, in which case set the value before.

Does the recipe set the value of this so pmwiki can do
something with it later, in which case setting the
value before should work; if it doesn't, set it after
with name = value, not SDV. And inform the recipe author,
so he or she can tidy that bit of code.

Phew!

-- 
JR
--
John Rankin






More information about the pmwiki-users mailing list