Difference between revisions of "Template:Links to/testcases"

From blackwiki
Jump to navigation Jump to search
imported>Jdaloner
m (Jdaloner moved page Template:Linksto/testcases to Template:Links to/testcases: To match parent page.)
imported>Jdaloner
("linksto" --> "links to")
 
Line 1: Line 1:
 
{{ Testcases notice <!--|toc=on-->}}
 
{{ Testcases notice <!--|toc=on-->}}
  
Each test says "On behalf of the parent page (namespace:basename, Template:Linksto),  
+
Each test says "On behalf of the parent page (namespace:basename, Template:Links to),  
 
what links to section X"?
 
what links to section X"?
There is no section X at Template:Linksto, but the query only ever looks for the pattern #X.
+
There is no section X at Template:Links to, but the query only ever looks for the pattern #X.
 
It relies on the high probability that if a page is found to link "here" and it has
 
It relies on the high probability that if a page is found to link "here" and it has
 
also one of my section names, and preceded by a # sign, it probably does.
 
also one of my section names, and preceded by a # sign, it probably does.
  
Required links, or patterns that simulate links, linksto on this page to work:  
+
Required links, or patterns that simulate links, links to on this page to work:  
:*[[../sandbox]]  simulates linksto mechanism for wikilinks
+
:*[[../sandbox]]  simulates links to mechanism for wikilinks
:*<kbd>{<nowiki/>{ Section link|Template:Linksto|See also }}</kbd>  
+
:*<kbd>{<nowiki/>{ Section link|Template:Links to|See also }}</kbd>  
:*{{ section link | Template:Linksto/doc | See also }}  
+
:*{{ section link | Template:Links to/doc | See also }}  
:*[[ ../doc#See also ]] (linksto only finds wikilinks, nothing else)
+
:*[[ ../doc#See also ]] (links to only finds wikilinks, nothing else)
:*[[ ../ ]] (linksto only finds wikilinks, nothing else)
+
:*[[ ../ ]] (links to only finds wikilinks, nothing else)
#Section link Template:Linksto Question [../|sublinks]]?   
+
#Section link Template:Links to Question [../|sublinks]]?   
#Section link Template:Linksto Question "''tick''" marks?  
+
#Section link Template:Links to Question "''tick''" marks?  
#Section link Template:Linksto THis has/all/ the issues  
+
#Section link Template:Links to THis has/all/ the issues  
#Section link Template:Linksto THis has" all the issues  
+
#Section link Template:Links to THis has" all the issues  
#Section link Template:Linksto THis has all the_issues  
+
#Section link Template:Links to THis has all the_issues  
#Section link Template:Linksto THis_has_all_the_issues  
+
#Section link Template:Links to THis_has_all_the_issues  
#Section link Template:Linksto THis has/all the issues  
+
#Section link Template:Links to THis has/all the issues  
#Section link Template:Linksto THis "has" all the issues  
+
#Section link Template:Links to THis "has" all the issues  
#Section link Template:Linksto THis "has"/all the_issues
+
#Section link Template:Links to THis "has"/all the_issues
  
 
Before lumping in ELs with WLs, EL's took 10 or more related searches:
 
Before lumping in ELs with WLs, EL's took 10 or more related searches:
Line 40: Line 40:
  
 
|-
 
|-
| {{ canonicalurl:template:linksto/doc#See also }} <br/>
+
| {{ canonicalurl:template:links to/doc#See also }} <br/>
{<nowiki/>{ canonicalurl:Template:Linksto/doc#See also }}
+
{<nowiki/>{ canonicalurl:Template:Links to/doc#See also }}
 
| insource:"canonicalurl:{{{2}}} {{{1}}}"
 
| insource:"canonicalurl:{{{2}}} {{{1}}}"
  
 
|-
 
|-
| [{{ fullurl:template:linksto/doc#See also }}] <br/>
+
| [{{ fullurl:template:links to/doc#See also }}] <br/>
&#91;{{ fullurl:Template:linksto/doc#See also }}] <br/>
+
&#91;{{ fullurl:Template:links to/doc#See also }}] <br/>
&#91;{<nowiki/>{ fullurl:Template:linksto/doc#See also }}]  
+
&#91;{<nowiki/>{ fullurl:Template:links to/doc#See also }}]  
 
| insource:"fullurl:{{{2}}} {{{1}}}"
 
| insource:"fullurl:{{{2}}} {{{1}}}"
  
 
|-
 
|-
| [//en.wikipedia.org/wiki/template:linksto/doc#See_also] <br/>
+
| [//en.wikipedia.org/wiki/template:links to/doc#See_also] <br/>
[<nowiki/>/<nowiki/>/en.wikipedia.org/wiki/template:<mark>l</mark>inksto/doc#See_also]
+
[<nowiki/>/<nowiki/>/en.wikipedia.org/wiki/template:<mark>l</mark>inks to/doc#See_also]
 
| insource:"{{ fullurl:{{{2}}} {{{1}}} }}"
 
| insource:"{{ fullurl:{{{2}}} {{{1}}} }}"
  
 
|-
 
|-
| https:{{SERVER}}{{localurl:template:linksto/doc}}#{{anchorencode:See also}} <br/>
+
| https:{{SERVER}}{{localurl:template:links to/doc}}#{{anchorencode:See also}} <br/>
https:{<nowiki/>{SERVER}}{<nowiki/>{localurl:template:linksto/doc}}#{<nowiki/>{anchorencode:See also}}
+
https:{<nowiki/>{SERVER}}{<nowiki/>{localurl:template:links to/doc}}#{<nowiki/>{anchorencode:See also}}
 
| insource:"server localurl:{{{2}}} anchorencode {{{1}}}"  <br/>
 
| insource:"server localurl:{{{2}}} anchorencode {{{1}}}"  <br/>
 
insource:"https server localurl {{{2}}} anchorencode {{{1}}}"
 
insource:"https server localurl {{{2}}} anchorencode {{{1}}}"
  
 
|-
 
|-
|https:{{ SERVER }}{{ localurl: Template:linksto/doc }}#See_also<br/>
+
|https:{{ SERVER }}{{ localurl: Template:links to/doc }}#See_also<br/>
 
can be produced two ways: <br/>
 
can be produced two ways: <br/>
https:{<nowiki/>{ SERVER }}/wiki/Template:linksto/doc#See_also<br/>
+
https:{<nowiki/>{ SERVER }}/wiki/Template:links to/doc#See_also<br/>
https:{<nowiki/>{ SERVER }}{<nowiki/>{ localurl: Template:linksto/doc }}#See_also
+
https:{<nowiki/>{ SERVER }}{<nowiki/>{ localurl: Template:links to/doc }}#See_also
 
| insource:"https SERVER wiki {{{2}}} {{{1}}}"  <br/>
 
| insource:"https SERVER wiki {{{2}}} {{{1}}}"  <br/>
 
insource:"https SERVER localurl:{{{2}}} {{{1}}}"  <br/>
 
insource:"https SERVER localurl:{{{2}}} {{{1}}}"  <br/>
Line 74: Line 74:
  
 
Via {{tl|Section link}}: success means this page shows up in the search link.
 
Via {{tl|Section link}}: success means this page shows up in the search link.
*{{linksto/sandbox|See also|{{NAMESPACE}}:{{BASEPAGENAME}}/doc}}
+
*{{links to/sandbox|See also|{{NAMESPACE}}:{{BASEPAGENAME}}/doc}}
*{{linksto/sandbox|See also|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
*{{links to/sandbox|See also|{{NAMESPACE}}:{{BASEPAGENAME}}}}
  
 
Via <code>[<nowiki/>[fullpagename#section name]]</code>:<br />
 
Via <code>[<nowiki/>[fullpagename#section name]]</code>:<br />
 
Success means that the search link highlights the match corresponds to the simulated section link.
 
Success means that the search link highlights the match corresponds to the simulated section link.
 
The number signs (that make the ordered list) satisfy the regexp that simulates linksto mechanism.
 
The number signs (that make the ordered list) satisfy the regexp that simulates linksto mechanism.
#THis "has"/all the_issues {{linksto/sandbox|THis "has"/all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis "has"/all the_issues {{links to/sandbox|THis "has"/all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#THis "has" all the issues {{linksto/sandbox|THis "has" all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis "has" all the issues {{links to/sandbox|THis "has" all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#THis has/all the issues {{linksto/sandbox|THis has/all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis has/all the issues {{links to/sandbox|THis has/all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#THis_has_all_the_issues {{linksto/sandbox|THis has all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis_has_all_the_issues {{links to/sandbox|THis has all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#THis has all the_issues {{linksto/sandbox|THis has all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis has all the_issues {{links to/sandbox|THis has all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#THis has" all the issues {{linksto/sandbox|THis has" all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis has" all the issues {{links to/sandbox|THis has" all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#THis has/all/ the issues {{linksto/sandbox|THis has/all/ the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis has/all/ the issues {{links to/sandbox|THis has/all/ the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#Question "''tick''" marks? {{linksto/sandbox|Question "''tick''" marks?|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#Question "''tick''" marks? {{links to/sandbox|Question "''tick''" marks?|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#Question [../|sublinks]]?  {{linksto/sandbox|Question [../{{!}}sublinks]]?|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#Question [../|sublinks]]?  {{links to/sandbox|Question [../{{!}}sublinks]]?|{{NAMESPACE}}:{{BASEPAGENAME}}}}
  
 
== [[Template:{{TEMPLATENAME|testcases}}|Main template]] ==
 
== [[Template:{{TEMPLATENAME|testcases}}|Main template]] ==
 
{{clear}}
 
{{clear}}
Linksto template has two parts:  
+
Links to template has two parts:  
 
# linksto part links to a fullpagename, in this case [[../]].
 
# linksto part links to a fullpagename, in this case [[../]].
 
# regex part links to the following patterns (# char required).
 
# regex part links to the following patterns (# char required).
  
 
Via {{tl|Section link}}: success means this page shows up in the search link
 
Via {{tl|Section link}}: success means this page shows up in the search link
*{{linksto|See also|{{NAMESPACE}}:{{BASEPAGENAME}}/doc}}
+
*{{links to|See also|{{NAMESPACE}}:{{BASEPAGENAME}}/doc}}
*{{linksto|See also|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
*{{links to|See also|{{NAMESPACE}}:{{BASEPAGENAME}}}}
  
 
Via wikilink: The number signs (that make the ordered list) satisfy the regexp.
 
Via wikilink: The number signs (that make the ordered list) satisfy the regexp.
#THis "has"/all the_issues {{linksto|THis "has"/all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis "has"/all the_issues {{links to|THis "has"/all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#THis "has" all the issues {{linksto|THis "has" all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis "has" all the issues {{links to|THis "has" all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#THis has/all the issues {{linksto|THis has/all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis has/all the issues {{links to|THis has/all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#THis_has_all_the_issues {{linksto|THis has all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis_has_all_the_issues {{links to|THis has all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#THis has all the_issues {{linksto|THis has all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis has all the_issues {{links to|THis has all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#THis has" all the issues {{linksto|THis has" all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis has" all the issues {{links to|THis has" all the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#THis has/all/ the issues {{linksto|THis has/all/ the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#THis has/all/ the issues {{links to|THis has/all/ the issues|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#Question "''tick''" marks? {{linksto|Question "''tick''" marks?|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#Question "''tick''" marks? {{links to|Question "''tick''" marks?|{{NAMESPACE}}:{{BASEPAGENAME}}}}
#Question [../|sublinks]]?  {{linksto|Question [../{{!}}sublinks]]?|{{NAMESPACE}}:{{BASEPAGENAME}}}}
+
#Question [../|sublinks]]?  {{links to|Question [../{{!}}sublinks]]?|{{NAMESPACE}}:{{BASEPAGENAME}}}}
  
  

Latest revision as of 19:12, 18 April 2018

Each test says "On behalf of the parent page (namespace:basename, Template:Links to), what links to section X"? There is no section X at Template:Links to, but the query only ever looks for the pattern #X. It relies on the high probability that if a page is found to link "here" and it has also one of my section names, and preceded by a # sign, it probably does.

Required links, or patterns that simulate links, links to on this page to work:

  1. Section link Template:Links to Question [../|sublinks]]?
  2. Section link Template:Links to Question "tick" marks?
  3. Section link Template:Links to THis has/all/ the issues
  4. Section link Template:Links to THis has" all the issues
  5. Section link Template:Links to THis has all the_issues
  6. Section link Template:Links to THis_has_all_the_issues
  7. Section link Template:Links to THis has/all the issues
  8. Section link Template:Links to THis "has" all the issues
  9. Section link Template:Links to THis "has"/all the_issues

Before lumping in ELs with WLs, EL's took 10 or more related searches:

  • Brackets and linking and labeling are ignored to limit the number of searches that would otherwise have to be done. The EL patters are not necessarily links, but are ELs with the section name of interest that need further investigation.
  • {{ Localurl and {{ anchorencode are used in tandem with SERVER.
  • https:{{fullurl or https:{{SERVER could be used instead of [{{fullurl or [{{SERVER
  • The colon : character is part of an atomic term in canonicalurl:namespace or fullurl:namespace constructs
  • {{ fullurl could be proceeded by https: to create a link.

Lumping WLs and ELs together, the search parameter linksto is not used for WLs. Rather if the page has the fullpagename and section of interest in proximity, and the section has a # sign in front of it (basically), that's a go; it needs investigating concerning the section-name change even if it is not a link.

URL-styled links to Template:Links to/doc#See also
What they write. How we match.
https://blackwiki.org/index.php?title=Template:Links_to/doc#See_also

{{ canonicalurl:Template:Links to/doc#See also }}

insource:"canonicalurl:{{{2}}} {{{1}}}"
[1]

[https://blackwiki.org/index.php?title=Template:Links_to/doc#See_also]
[{{ fullurl:Template:links to/doc#See also }}]

insource:"fullurl:{{{2}}} {{{1}}}"
to/doc#See_also

[//en.wikipedia.org/wiki/template:links to/doc#See_also]

insource:"{{ fullurl:{{{2}}} {{{1}}} }}"
https:https://blackwiki.org/index.php?title=Template:Links_to/doc#See_also

https:{{SERVER}}{{localurl:template:links to/doc}}#{{anchorencode:See also}}

insource:"server localurl:{{{2}}} anchorencode {{{1}}}"

insource:"https server localurl {{{2}}} anchorencode {{{1}}}"

https:https://blackwiki.org/index.php?title=Template:Links_to/doc#See_also

can be produced two ways:
https:{{ SERVER }}/wiki/Template:links to/doc#See_also
https:{{ SERVER }}{{ localurl: Template:links to/doc }}#See_also

insource:"https SERVER wiki {{{2}}} {{{1}}}"

insource:"https SERVER localurl:{{{2}}} {{{1}}}"

Sandbox version

Via {{Section link}}: success means this page shows up in the search link.


Via [[fullpagename#section name]]:
Success means that the search link highlights the match corresponds to the simulated section link. The number signs (that make the ordered list) satisfy the regexp that simulates linksto mechanism.

  1. THis "has"/all the_issues Template:Links to#THis "has"/all the issues:  Template:Plain link · Template:Plain link
  1. THis "has" all the issues Template:Links to#THis "has" all the issues:  Template:Plain link · Template:Plain link
  1. THis has/all the issues Template:Links to#THis has/all the issues:  Template:Plain link · Template:Plain link
  1. THis_has_all_the_issues Template:Links to#THis has all the issues:  Template:Plain link · Template:Plain link
  1. THis has all the_issues Template:Links to#THis has all the issues:  Template:Plain link · Template:Plain link
  1. THis has" all the issues Template:Links to#THis has" all the issues:  Template:Plain link · Template:Plain link
  1. THis has/all/ the issues Template:Links to#THis has/all/ the issues:  Template:Plain link · Template:Plain link
  1. Question "tick" marks? Template:Links to#Question "tick" marks?:  Template:Plain link · Template:Plain link
  1. Question [../|sublinks]]? Template:Links to#Question [../|sublinks]]?:  Template:Plain link · Template:Plain link


Main template

Links to template has two parts:

  1. linksto part links to a fullpagename, in this case Template:Links to.
  2. regex part links to the following patterns (# char required).

Via {{Section link}}: success means this page shows up in the search link


Via wikilink: The number signs (that make the ordered list) satisfy the regexp.

  1. THis "has"/all the_issues Template:Links to#THis "has"/all the issues:  Template:Plain link · Template:Plain link
  1. THis "has" all the issues Template:Links to#THis "has" all the issues:  Template:Plain link · Template:Plain link
  1. THis has/all the issues Template:Links to#THis has/all the issues:  Template:Plain link · Template:Plain link
  1. THis_has_all_the_issues Template:Links to#THis has all the issues:  Template:Plain link · Template:Plain link
  1. THis has all the_issues Template:Links to#THis has all the issues:  Template:Plain link · Template:Plain link
  1. THis has" all the issues Template:Links to#THis has" all the issues:  Template:Plain link · Template:Plain link
  1. THis has/all/ the issues Template:Links to#THis has/all/ the issues:  Template:Plain link · Template:Plain link
  1. Question "tick" marks? Template:Links to#Question "tick" marks?:  Template:Plain link · Template:Plain link
  1. Question [../|sublinks]]? Template:Links to#Question [../|sublinks]]?:  Template:Plain link · Template:Plain link


Together the above link to the basepagename plus the pattern, simulate the success mechanism. Success means activating the search link and seeing corresponding, highlighted, pattern match.