Class: MediaWiktory::Wikipedia::Actions::Expandtemplates
- Defined in:
- lib/mediawiktory/wikipedia/actions/expandtemplates.rb
Overview
Expands all templates within wikitext.
Usage:
api..title(value).perform # returns string with raw output
# or
api..title(value).response # returns output parsed and wrapped into Response object
See Base for generic explanation of working with MediaWiki actions and Response for working with action responses.
All action's parameters are documented as its public methods, see below.
Instance Method Summary collapse
-
#generatexml ⇒ self
Generate XML parse tree (replaced by prop=parsetree).
-
#includecomments ⇒ self
Whether to include HTML comments in the output.
-
#prop(*values) ⇒ self
Which pieces of information to get.
-
#revid(value) ⇒ self
Revision ID, for {REVISIONID} and similar variables.
-
#templatesandboxcontentformat(value) ⇒ self
Content format of templatesandboxtext.
-
#templatesandboxcontentmodel(value) ⇒ self
Content model of templatesandboxtext.
-
#templatesandboxprefix(*values) ⇒ self
Template sandbox prefix, as with Special:TemplateSandbox.
-
#templatesandboxtext(value) ⇒ self
Parse the page using this page content in place of the page named by templatesandboxtitle.
-
#templatesandboxtitle(value) ⇒ self
Parse the page using templatesandboxtext in place of the contents of the page named here.
-
#text(value) ⇒ self
Wikitext to convert.
-
#title(value) ⇒ self
Title of page.
Methods inherited from Get
Methods inherited from Base
#inspect, #merge, #name, #perform, #response, #to_h, #to_param, #to_url
Methods included from GlobalParams
#assert, #assertuser, #centralauthtoken, #curtimestamp, #errorformat, #errorlang, #errorsuselocal, #format, #maxage, #maxlag, #origin, #requestid, #responselanginfo, #servedby, #smaxage, #uselang
Instance Method Details
#generatexml ⇒ self
Generate XML parse tree (replaced by prop=parsetree).
69 70 71 |
# File 'lib/mediawiktory/wikipedia/actions/expandtemplates.rb', line 69 def generatexml() merge(generatexml: 'true') end |
#includecomments ⇒ self
Whether to include HTML comments in the output.
62 63 64 |
# File 'lib/mediawiktory/wikipedia/actions/expandtemplates.rb', line 62 def includecomments() merge(includecomments: 'true') end |
#prop(*values) ⇒ self
Which pieces of information to get.
50 51 52 |
# File 'lib/mediawiktory/wikipedia/actions/expandtemplates.rb', line 50 def prop(*values) values.inject(self) { |res, val| res._prop(val) or fail ArgumentError, "Unknown value for prop: #{val}" } end |
#revid(value) ⇒ self
Revision ID, for {REVISIONID} and similar variables.
42 43 44 |
# File 'lib/mediawiktory/wikipedia/actions/expandtemplates.rb', line 42 def revid(value) merge(revid: value.to_s) end |
#templatesandboxcontentformat(value) ⇒ self
Content format of templatesandboxtext.
119 120 121 |
# File 'lib/mediawiktory/wikipedia/actions/expandtemplates.rb', line 119 def templatesandboxcontentformat(value) _templatesandboxcontentformat(value) or fail ArgumentError, "Unknown value for templatesandboxcontentformat: #{value}" end |
#templatesandboxcontentmodel(value) ⇒ self
Content model of templatesandboxtext.
106 107 108 |
# File 'lib/mediawiktory/wikipedia/actions/expandtemplates.rb', line 106 def templatesandboxcontentmodel(value) _templatesandboxcontentmodel(value) or fail ArgumentError, "Unknown value for templatesandboxcontentmodel: #{value}" end |
#templatesandboxprefix(*values) ⇒ self
Template sandbox prefix, as with Special:TemplateSandbox.
77 78 79 |
# File 'lib/mediawiktory/wikipedia/actions/expandtemplates.rb', line 77 def templatesandboxprefix(*values) values.inject(self) { |res, val| res._templatesandboxprefix(val) } end |
#templatesandboxtext(value) ⇒ self
Parse the page using this page content in place of the page named by templatesandboxtitle.
98 99 100 |
# File 'lib/mediawiktory/wikipedia/actions/expandtemplates.rb', line 98 def templatesandboxtext(value) merge(templatesandboxtext: value.to_s) end |
#templatesandboxtitle(value) ⇒ self
Parse the page using templatesandboxtext in place of the contents of the page named here.
90 91 92 |
# File 'lib/mediawiktory/wikipedia/actions/expandtemplates.rb', line 90 def templatesandboxtitle(value) merge(templatesandboxtitle: value.to_s) end |
#text(value) ⇒ self
Wikitext to convert.
34 35 36 |
# File 'lib/mediawiktory/wikipedia/actions/expandtemplates.rb', line 34 def text(value) merge(text: value.to_s) end |
#title(value) ⇒ self
Title of page.
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/expandtemplates.rb', line 26 def title(value) merge(title: value.to_s) end |