Content deleted Content added
Sophivorus (talk | contribs) →Usage: Add methods |
Sophivorus (talk | contribs) No edit summary |
||
Line 25:
== Methods ==
==== getLead ====
* <code>getLead( wikitext )</code> — Returns the lead section from the given wikitext. The lead section is defined as everything before the first section title. If there's no lead section, an empty string will be returned.▼
* <code>getSections( wikitext )</code> — Returns a Lua table with the section titles as keys and the section contents as values. This method doesn't get the lead section (use getLead for that).▼
* <code>getSection( wikitext, title )</code> — Returns the content of the section with the given title, including subsections. If you don't want subsections, use getSections instead. If the given section title appears more than once, only the first will be returned. If the section is not found, nil will be returned.▼
* <code>getSectionTag( wikitext, name )</code> — Returns the contents of the <nowiki><section></nowiki> tag with the given name (see [[Help:Labeled section transclusion]]). If the tag is not found, nil will be returned.▼
<code>getLead( wikitext )</code>
▲
==== getSections ====
<code>getSections( wikitext )</code>
▲
==== getSection ====
<code>getSection( wikitext, title )</code>
▲
==== getSectionTag ====
<code>getSectionTag( wikitext, name )</code>
▲
==== getLists ====
<code>getLists( wikitext )</code>
Returns a table with each value a list.
== See also ==
|