|
Cookbook /
ModuleGuidelines-TalkPmWikiDeveloper
MarkupWriting
This is a talk page for improving ModuleGuidelines. Additional base recipe componentsAnother useful line to add to every recipe is # declare $Package for (:if enabled $Package:) recipe installation check global $Package; $Package = 1; LayoutLayout variables allow substitutions and additions to the page template. CSS
CSS can be included directly into the page using .
For example if the recipe includes a $HTMLHeaderFmt ['package-css'] = "<link rel='stylesheet' type='text/css' href='\$PubDirUrl/css/package.css' />\n"; To include the CSS file only when the recipe is used (ie not for every page of the wiki), and only once (ie not for every time the markup is used in a page), place the following in the function that is called by the Markup function
# include the CSS file in the PmWiki page if required
static $css_generated = false; // stylesheet not added to page
if (! $css_generated) {
global $HTMLHeaderFmt; // reference the PmWiki HTMLHeaderFMT array
$HTMLHeaderFmt ['package-css'] =
"<link rel='stylesheet' type='text/css' href='\$PubDirUrl/css/package.css' />\n";
$css_generated = true; // remember the stylesheet was added to the page
};
Talk page for the Module Guidelines recipe (users?). |