Template:Assistant/extract section/doc

Usage edit

This template extracts the content of a section of a web page. Two required unnamed parameters are the name of the page and the name of the section. Wikilink markup is stripped from the section headings for comparison with the unnamed parameter.

Subsections are included in the extract. The section heading at the top of the section is not included unless optional named parameter heading is non-blank. Categorization is filtered out, so extracted material won't categorize the transcluding page.

If a third unnamed parameter is provided, extraction does not stop at the end of the section named by the second parameter, but instead continues until-and-unless the section named by the third unnamed parameter.

{{Assistant/extract section|WN:SG|Status}} would produce

{{Assistant/extract section|WN:SG|Status|heading=1}} would produce

{{Assistant/extract section|WN:SG|The first paragraph|Writing tone and structure|heading=1}} would produce

Internals edit

Precisely, extraction starts at the first section heading named by the second unnamed parameter. If the third unnamed parameter is blank or omitted, inclusion stops at the next section heading that is no deeper than the start heading. If the third unnamed parameter is non-blank, inclusion continues until the next section heading that is no deeper than the start heading and is named by either the second or third parameter.