diff options
author | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2024-01-21 10:01:36 +0000 |
---|---|---|
committer | petko <petko@524c5546-5005-0410-9a3e-e25e191bd360> | 2024-01-21 10:01:36 +0000 |
commit | b1be9b16828e907f4ba8881f9f05e5410e33168a (patch) | |
tree | e9441af82a0fa3490ce6b070414ccecc488dc0ce /wikilib.d/PmWiki.LinkVariables | |
parent | b6f637fa328bfb18ee5eff593d74dae7f5b0222c (diff) | |
download | pmwiki.svn-b1be9b16828e907f4ba8881f9f05e5410e33168a.tar.bz2 |
Documentation update.
git-svn-id: svn://pmwiki.org/pmwiki/trunk@4584 524c5546-5005-0410-9a3e-e25e191bd360
Diffstat (limited to 'wikilib.d/PmWiki.LinkVariables')
-rw-r--r-- | wikilib.d/PmWiki.LinkVariables | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wikilib.d/PmWiki.LinkVariables b/wikilib.d/PmWiki.LinkVariables index ec4e79cd..e0dd6a49 100644 --- a/wikilib.d/PmWiki.LinkVariables +++ b/wikilib.d/PmWiki.LinkVariables @@ -1,9 +1,9 @@ version=pmwiki-2.3.29 ordered=1 urlencoded=1 -author=Petko +author=simon charset=UTF-8 -csum=$EnableRedirectQuiet = 2; (+91) +csum=hlt (+171) name=PmWiki.LinkVariables -rev=77 +rev=78 targets=PmWiki.LinkVariables,PmWiki.Links,PmWiki.PageVariables,Cookbook.PagePaths,PmWiki.BasicVariables,PmWiki.InterMap,Cookbook.DotsInLinks,PmWiki.PageDirectives,Category.PmWikiDeveloper,!PmWikiDeveloper -text=(:Summary:variables that control the display of links in pages:)%0a(:Audience: admins (advanced):)%0a:$EnableLinkPageRelative:When enabled, causes PmWiki to use relative urls for page links instead of absolute urls.%0a $EnableLinkPageRelative = 1;%0a%0a:$EnableLinkPlusTitlespaced: When enabled, a [[links|link]] written like [@[[Name|+]]@] will display the "Spaced Title". Default is to display the "Title" of the page. See the page [[PageVariables]] for [@{$Title}@] and [@{$Titlespaced}@].%0a%0a:$PagePathFmt: This array lists the order in which PmWiki looks for the page that you ''most likely'' are attempting to link to. The default is listed below. Look at Cookbook:PagePaths for some ideas.%0a [=array('{$Group}.$1', '$1.$1', '$1.{$DefaultName}')=]%0a%0a:$LinkPageExistsFmt:The (HTML) string to output for links to already existing wiki pages. Defaults to %0a [=%3ca class='wikilink' href='\$LinkUrl'>\$LinkText%3c/a>=]%0a%0a:$LinkPageCreateFmt:The (HTML) string to output for links to non-existent wiki pages. The default is to add a '?' after the link text with a link to the page edit/create form. Defaults to%0a [=%3ca class='createlinktext' href='\$PageUrl?action=edit'>\$LinkText%3c/a>=]%0a [=%3ca class='createlink' href='\$PageUrl?action=edit'>?%3c/a>=]%0a%0a:$LinkPageCreateSpaceFmt:Same as $LinkPageCreateFmt, but used when the link text has a space in it. %0a%0a:$LinkPageSelfFmt:The (HTML) string to output for self-referencing links (i.e. links to the page itself). Defaults to%0a [=%3ca class='selflink' href='\$LinkUrl'>\$LinkText%3c/a>=]%0a%0a:$LinkCategoryFmt:The (HTML) string to output for links to wiki category pages. Defaults to %0a [=%3ca class='categorylink' href='\$LinkUrl'>\$LinkText%3c/a>=]%0a%0a%0a:$UrlLinkFmt:The (HTML) string to output for URL-links that begin with 'http:', 'ftp:', etc. Defaults to%0a [=%3ca class='urllink' href='\$LinkUrl' title='\$LinkAlt' rel='nofollow'>\$LinkText%3c/a>=]%0a-> All InterMap links default to $UrlLinkFmt, unless there is a specific $IMapLinkFmt entry.%0a%0a:$IMapLinkFmt: an array of link formats for various link "schemes". Not set as default.%0a->Examples of custom formats to allow different styling via classes: %0a->Links to http: standard url links:%0a [= $IMapLinkFmt['http:'] = "%3ca class='httplink urllink' href='\$LinkUrl'>\$LinkText%3c/a>"; =] %0a->Links to https: secure pages:%0a [= $IMapLinkFmt['https:'] = "%3ca class='httpslink urllink' href='\$LinkUrl'>\$LinkText%3c/a>"; =] %0a->Links to PmWiki: InterMap shortcut:%0a [= $IMapLinkFmt['PmWiki:'] = "%3ca class='pmwikilink urllink' href='\$LinkUrl'>\$LinkText%3c/a>";=]%0a->Note that if you have enabled ObfuscateLinkIMap (core function based on DeObMail), the snippet can be customized in:%0a [= $IMapLinkFmt['obfuscate-mailto:'] =]%0a->The default (for ObfuscateLinkIMap) is:%0a [= $IMapLinkFmt['obfuscate-mailto:'] = "%3cspan class='_pmXmail' title=\"\$LinkAlt\">%3cspan class='_t'>\$LinkText%3c/span>%3cspan class='_m'>\$LinkUrl%3c/span>%3c/span>"; =]%0a->The @@ObfuscateLinkIMap@@ logic expects the snippet to have some recognisable properties -- classes, elements, otherwise it may not work. Start with the default snippet, make small modifications, and test if it works.%0a%0a:$AddLinkCSS:An array of additional custom link CSS classes, that are added to the link format $UrlLinkFmt, $IMapLinkFmt or $LinkPageExistsFmt. Currently can have 2 elements:\\%0a@@$AddLinkCSS['othergroup'] = "''crossgroup''";@@ # add "''crossgroup''" class to wikilinks to other wikigroups\\%0a@@$AddLinkCSS['samedomain'] = "''currentsite''";@@ # add "''currentsite''" class to URL or Path links to resources on the same domain.%0a%0a:$InterMapFiles:An array consisting a list of files and pages containing [[InterMap]] entries to be loaded.%0a%0a:$MakePageNameFunction:Name of a custom function to replace `MakePageName(), which converts strings into valid page names.%0a%0a:$MakePageNamePatterns: $MakePageNamePatterns is an array of regular expression replacements that is used to map the page link in a ''free link'' such as [@[[free link]]@] into a page name. Currently the default sequence is: [@%0a "/'/" => '', # strip single-quotes%0a "/[^$PageNameChars]+/" => ' ', # convert to spaces characters not allowed in pagenames%0a '/((^|[^-\\w])\\w)/' => 'cb_toupper', # capitalize 1st letter of words%0a '/ /' => '' # remove spaces%0a@]%0a: :Note that if you change $MakePageNamePatterns, the documentation links may break. This can be fixed by re-setting $MakePageNamePatterns to the default in local/PmWiki.php.%0a%0a:$MakePageNameSplitPattern:See Cookbook:DotsInLinks.%0a%0a:$WikiWordCountMax:The maximum number of times to convert each WikiWord encountered on a page. Defaults to 1,000,000. Common settings for this variable are zero (disable WikiWord links) and one (convert only the first occurrence of each WikiWord).%0a $WikiWordCountMax = 0; # disable WikiWord links%0a $WikiWordCountMax = 1; # convert only first WikiWord%0a%0a:$WikiWordCount:An array that allows the number of WikiWord conversions to be set on a per-WikiWord basis. The default is to use $WikiWordCountMax unless a value is set in this array. By default PmWiki sets @@$WikiWordCount['PmWiki']=1@@ to limit the number of conversions of "PmWiki".%0a $WikiWordCount[=['PhD']=0; # Don't convert "PhD"=]%0a $WikiWordCount['WikiWord']=5; # Convert WikiWord 5 times%0a # the following lines keep a page from linking to itself%0a $title = [=FmtPageName=]('$Title_',$pagename);%0a $WikiWordCount[$title]=0; %0a %0a:$EnableRedirectQuiet:Enable the @@quiet=1@@ parameter for the [[PmWiki.PageDirectives#redirect|redirect directive]]. On publicly edited wikis it is advisable not to enable quiet redirects.%0a $EnableRedirectQuiet = 0; # disable quiet redirects (default)%0a $EnableRedirectQuiet = 1; # enable quiet redirects with quiet=1%0a $EnableRedirectQuiet = 2; # enable quiet redirects unless quiet=0%0a%0a:$QualifyPatterns:An array of regular expression replacements applied when text from one page is included in another, used by the function Qualify(). The two default patterns rewrite links like [@[[Page]]@] into [@[[Group/Page]]@], and page (text) variables like [@{$Title}@] into [@{Group.Page$Title}@] so that they work the same way in the source page and in the including page.%0a%0aCategories: [[!PmWiki Developer]] -time=1705077482 +text=(:Summary:variables that control the display of links in pages:)%0a(:Audience: admins (advanced):)%0a:$EnableLinkPageRelative:When enabled, causes PmWiki to use relative urls for page links instead of absolute urls.%0a-> %25hlt php%25@@$EnableLinkPageRelative = 1;@@%0a%0a:$EnableLinkPlusTitlespaced: When enabled, a [[links|link]] written like %25pmhlt%25[@[[Name|+]]@] will display the "Spaced Title". Default is to display the "Title" of the page. See the page [[PageVariables]] for [@{$Title}@] and [@{$Titlespaced}@].%0a%0a:$PagePathFmt: This array lists the order in which PmWiki looks for the page that you ''most likely'' are attempting to link to. The default is listed below. Look at Cookbook:PagePaths for some ideas.%0a-> %25hlt php%25[@array('{$Group}.$1', '$1.$1', '$1.{$DefaultName}')@]%0a%0a:$LinkPageExistsFmt:The (HTML) string to output for links to already existing wiki pages. Defaults to %0a-> %25hlt html%25[@%3ca class='wikilink' href='\$LinkUrl'>\$LinkText%3c/a>@]%0a%0a:$LinkPageCreateFmt:The (HTML) string to output for links to non-existent wiki pages. The default is to add a '?' after the link text with a link to the page edit/create form. Defaults to%0a-> %25hlt html%25[@%3ca class='createlinktext' href='\$PageUrl?action=edit'>\$LinkText%3c/a>@]%0a-> %25hlt html%25[@%3ca class='createlink' href='\$PageUrl?action=edit'>?%3c/a>@]%0a%0a:$LinkPageCreateSpaceFmt:Same as $LinkPageCreateFmt, but used when the link text has a space in it. %0a%0a:$LinkPageSelfFmt:The (HTML) string to output for self-referencing links (i.e. links to the page itself). Defaults to%0a-> %25hlt html%25[@%3ca class='selflink' href='\$LinkUrl'>\$LinkText%3c/a>@]%0a%0a:$LinkCategoryFmt:The (HTML) string to output for links to wiki category pages. Defaults to %0a-> %25hlt html%25[@%3ca class='categorylink' href='\$LinkUrl'>\$LinkText%3c/a>@]%0a%0a%0a:$UrlLinkFmt:The (HTML) string to output for URL-links that begin with 'http:', 'ftp:', etc. Defaults to%0a-> %25hlt html%25[@%3ca class='urllink' href='\$LinkUrl' title='\$LinkAlt' rel='nofollow'>\$LinkText%3c/a>@]%0a-> All InterMap links default to $UrlLinkFmt, unless there is a specific $IMapLinkFmt entry.%0a%0a:$IMapLinkFmt: an array of link formats for various link "schemes". Not set as default.%0a->Examples of custom formats to allow different styling via classes: %0a->Links to http: insecure url links:%0a--> %25hlt php%25[@$IMapLinkFmt['http:'] = "%3ca class='httplink urllink' href='\$LinkUrl'>\$LinkText%3c/a>"; @] %0a->Links to https: secure pages:%0a--> %25hlt php%25[@$IMapLinkFmt['https:'] = "%3ca class='httpslink urllink' href='\$LinkUrl'>\$LinkText%3c/a>"; @] %0a->Links to PmWiki: InterMap shortcut:%0a--> %25hlt php%25[@$IMapLinkFmt['PmWiki:'] = "%3ca class='pmwikilink urllink' href='\$LinkUrl'>\$LinkText%3c/a>";@]%0a->Note that if you have enabled ObfuscateLinkIMap (core function based on DeObMail), the snippet can be customized in:%0a--> %25hlt php%25[@$IMapLinkFmt['obfuscate-mailto:'] @]%0a->The default (for ObfuscateLinkIMap) is:%0a--> %25hlt php%25[@$IMapLinkFmt['obfuscate-mailto:'] = "%3cspan class='_pmXmail' title=\"\$LinkAlt\">%3cspan class='_t'>\$LinkText%3c/span>%3cspan class='_m'>\$LinkUrl%3c/span>%3c/span>"; @]%0a->The @@ObfuscateLinkIMap@@ logic expects the snippet to have some recognisable properties -- classes, elements, otherwise it may not work. Start with the default snippet, make small modifications, and test if it works.%0a%0a:$AddLinkCSS:An array of additional custom link CSS classes, that are added to the link format $UrlLinkFmt, $IMapLinkFmt or $LinkPageExistsFmt. Currently can have 2 elements:\\%0a%25hlt php%25@@$AddLinkCSS['othergroup'] = "''crossgroup''"; # add "''crossgroup''" class to wikilinks to other wikigroups @@ \\%0a%25hlt php%25@@$AddLinkCSS['samedomain'] = "''currentsite''"; # add "''currentsite''" class to URL or Path links to resources on the same domain. @@%0a%0a:$InterMapFiles:An array consisting a list of files and pages containing [[InterMap]] entries to be loaded.%0a%0a:$MakePageNameFunction:Name of a custom function to replace %25hlt php%25[@MakePageName()@], which converts strings into valid page names.%0a%0a:$MakePageNamePatterns: $MakePageNamePatterns is an array of regular expression replacements that is used to map the page link in a ''free link'' such as %25pmhlt%25[@[[free link]]@] into a page name. Currently the default sequence is: %25hlt php%25[@%0a "/'/" => '', # strip single-quotes%0a "/[^$PageNameChars]+/" => ' ', # convert to spaces characters not allowed in pagenames%0a '/((^|[^-\\w])\\w)/' => 'cb_toupper', # capitalize 1st letter of words%0a '/ /' => '' # remove spaces%0a@]%0a: :Note that if you change $MakePageNamePatterns, the documentation links may break. This can be fixed by re-setting $MakePageNamePatterns to the default in @@local/PmWiki.php@@.%0a%0a:$MakePageNameSplitPattern:See Cookbook:DotsInLinks.%0a%0a:$WikiWordCountMax:The maximum number of times to convert each WikiWord encountered on a page. Defaults to 1,000,000. Common settings for this variable are zero (disable WikiWord links) and one (convert only the first occurrence of each WikiWord).%0a-> %25hlt php%25@@$WikiWordCountMax = 0; # disable WikiWord links@@%0a-> %25hlt php%25@@$WikiWordCountMax = 1; # convert only first WikiWord@@%0a%0a:$WikiWordCount:An array that allows the number of WikiWord conversions to be set on a per-WikiWord basis. The default is to use $WikiWordCountMax unless a value is set in this array. By default PmWiki sets %25hlt php%25@@$WikiWordCount['PmWiki']=1@@ to limit the number of conversions of "PmWiki".%0a-> %25hlt php%25[@$WikiWordCount[=['PhD']=0; # Don't convert "PhD"=]%0a$WikiWordCount['WikiWord']=5; # Convert WikiWord 5 times%0a# the following lines keep a page from linking to itself%0a$title = [=FmtPageName=]('$Title_',$pagename);%0a$WikiWordCount[$title]=0; @]%0a %0a:$EnableRedirectQuiet:Enable the @@quiet=1@@ parameter for the [[PmWiki.PageDirectives#redirect|redirect directive]]. On publicly edited wikis it is advisable not to enable quiet redirects.%0a-> %25hlt php%25@@$EnableRedirectQuiet = 0; # disable quiet redirects (default) @@%0a-> %25hlt php%25@@$EnableRedirectQuiet = 1; # enable quiet redirects with quiet=1 @@%0a-> %25hlt php%25@@$EnableRedirectQuiet = 2; # enable quiet redirects unless quiet=0 @@%0a%0a:$QualifyPatterns:An array of regular expression replacements applied when text from one page is included in another, used by the function %25hlt php%25@@Qualify()@@. The two default patterns rewrite links like %25pmhlt%25[@[[Page]]@] into [@[[Group/Page]]@], and page (text) variables like [@{$Title}@] into [@{Group.Page$Title}@] so that they work the same way in the source page and in the including page.%0a%0aCategories: [[!PmWiki Developer]] +time=1705175668 |