Difference between revisions of "Module:Excerpt/doc"

From blackwiki
Jump to navigation Jump to search
blackwiki>Pppery
(Update dependencies)
blackwiki>Sophivorus
(Start updating the documentation, still a long way to go)
Line 1: Line 1:
 
{{Module rating|beta}}
 
{{Module rating|beta}}
 
{{high-use|6644}}
 
{{high-use|6644}}
{{Uses Lua|Module:Excerpt/i18n|Module:Hatnote}}
+
{{Uses Lua|Module:Excerpt/i18n}}
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) -->
+
 
 +
This module aims to be a '''transclusion engine''', whereby other modules and templates may transclude any part of any page.
 +
 
 
== Usage ==
 
== Usage ==
  
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|lead}}</code>
+
=== Templates ===
:''Main documentation: {{tl|Transclude lead excerpt/doc}}''
+
 
Transcludes the lead of an article as an excerpt.
+
This module has only one entry point for templates:
  
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|linked}}</code>
+
* <code><nowiki>{{#invoke:Excerpt|main}}</nowiki></code> — Wraps the get() entry point, see its documentation for details
:''Main documentation: {{tl|Transclude linked excerpt/doc}}''
 
Transcludes as an excerpt the lead of an article selected randomly from wikilinks on a page.
 
  
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|listitem}}</code>
+
The main entry point gives access to most if not all the functionality of the module and should suffice for most simple templates, but in more sophisticated cases, it my become necessary to create a custom submodule like [[Module:Excerpt/templates]] to implement the template.
:''Main documentation: {{tl|Transclude list item excerpt/doc}}''
 
Transcludes as an excerpt the lead of an article selected randomly from list items on a page.
 
  
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|random}}</code>
+
=== Modules ===
:''Main documentation: {{tl|Transclude random excerpt/doc}}''
 
Transcludes as an excerpt the lead of an article selected randomly from the parameters.
 
  
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|selected}}</code>
+
* <code><nowiki>get(page, options)</nowiki></code> Main entry point for modules
:''Main documentation: {{tl|Transclude selected excerpt/doc}}''
 
Transcludes the lead of a selected article as an excerpt.
 
  
<code><nowiki>{{</nowiki>#invoke:{{BASEPAGENAME}}|excerpt}}</code>
+
== Developers ==
:''Main documentation: {{tl|Excerpt/doc}}''
 
Transcludes part of an article into another article.
 
  
== Note ==
+
Before saving any change to this module, please preview with:
Before saving a change to this module, please preview with:
+
 
 +
* [[Module:Excerpt/testcases]]
 +
* [[Template:Excerpt/testcases]]
 
* [[Template:Transclude lead excerpt/testcases]]
 
* [[Template:Transclude lead excerpt/testcases]]
 +
* [[Template:Transclude lead excerpt/testcases2]]
 
* [[Template:Transclude linked excerpt/testcases]]
 
* [[Template:Transclude linked excerpt/testcases]]
 
* [[Template:Transclude list item excerpt/testcases]]
 
* [[Template:Transclude list item excerpt/testcases]]
 
* [[Template:Transclude random excerpt/testcases]]
 
* [[Template:Transclude random excerpt/testcases]]
 
* [[Template:Transclude selected excerpt/testcases]]
 
* [[Template:Transclude selected excerpt/testcases]]
* [[Template:Excerpt/testcases]]
 
  
 
== See also ==
 
== See also ==
* [[Template:Excerpt]]
+
 
{{Portal templates navbox}}
+
* [[Module:Excerpt/templates]]
 +
* [[Module:Excerpt slideshow]]
 +
* [[Module:Random slideshow]]
  
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |
 
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | |

Revision as of 13:36, 1 June 2020

Template:Uses Lua

This module aims to be a transclusion engine, whereby other modules and templates may transclude any part of any page.

Usage

Templates

This module has only one entry point for templates:

  • {{#invoke:Excerpt|main}} — Wraps the get() entry point, see its documentation for details

The main entry point gives access to most if not all the functionality of the module and should suffice for most simple templates, but in more sophisticated cases, it my become necessary to create a custom submodule like Module:Excerpt/templates to implement the template.

Modules

  • get(page, options) — Main entry point for modules

Developers

Before saving any change to this module, please preview with:

See also