Changes

Jump to navigation Jump to search
→‎See also: add JS doclink
<noinclude>{{Documentation subpage}}
{{timw|{{BASEPAGENAME}}}}
</noinclude>
This renders a link to a particular anchor in automatically-generated documentation for a class at https://doc.wikimedia.org/mediawiki-core/master/php/ .
Like {{tl|class doclink}} it takes a class in <tt>mediawiki/core</tt> and an optional <code>type=interface</code>. It adds an an <code>anchor</code> parameter to scroll to a particular part of the file (without the <code>#</code>) and a <code>method </code> parameter for the method name (or any text) to display.

Doxygen generates long <code>id</code> attributes for methods, so you have to click on a link to a method to get its <code>anchor</code> value from the URL. But the <code>id</code>s seem stable.

It seems you can add whitespace around the <code>|</code> to make the template invocation more readable.

{| class="wikitable"
! Code
! Preview
|-
| <pre>{{method doclink | class=Parser | anchor=a4979a4906f0cb0c1823974a47d5bd12f | method=Parser::setFunctionHook }}</pre>
| {{method doclink | class=Parser | anchor=a4979a4906f0cb0c1823974a47d5bd12f | method=Parser::setFunctionHook }}
|-
| <pre><code>{{method doclink |class=RCFeedEngine | type=interface|anchor=a654d2f1299fea499b4786db3dcca73a6 |method=<code>RCFeedEngine</code>'s <code>send()</code> method}}</pre>
| {{method doclink |class=RCFeedEngine | type=interface | anchor=a654d2f1299fea499b4786db3dcca73a6 | method=<code>RCFeedEngine</code>'s <code>send()</code> method}}
|}

== See also ==

* {{tl|Class doclink}} to link to the class or interface
* {{tl|File doclink}}
* {{tl|js doclink}} for Javascript API links

<includeonly>
[[Category:External link templates]]
</includeonly>
Anonymous user

Navigation menu