Content deleted Content added
Sophivorus (talk | contribs) Start documenting |
Sophivorus (talk | contribs) No edit summary |
||
Line 13:
</syntaxhighlight>
Then, use and combine the available methods freely. For example:
<syntaxhighlight lang="lua">
* <code>getLead( wikitext )</code> — Get the lead section from the given wikitext. The lead section is defined as everything before the first section. Returns the wikitext of the lead section. May be empty if there's no lead section.▼
local files = parser.getFiles( wikitext )
* <code>getSections( wikitext )</code> — Get all the sections from the given wikitext. Returns a map from section title to section content. This method doesn't get the lead section, use <code>getLead</code> for that.▼
for file in files do
* <code>getSection( wikitext, title )</code> — Returns the content of the section with the given title from the given wikitext. Includes subsections. If the given section title appears more than once, only the first one will be returned.▼
-- Do stuff
end
</syntaxhighlight>
Here's a list of available methods:
▲* <code>getLead( wikitext )</code> —
▲* <code>getSections( wikitext )</code> —
▲* <code>getSection( wikitext, title )</code> — Returns the content of the section with the given title
For the ultimate documentation, see the source code below.
== See also ==
|