Class: MediaWiktory::Wikipedia::Actions::Visualeditor
- Defined in:
- lib/mediawiktory/wikipedia/actions/visualeditor.rb
Overview
Returns HTML5 for a page from the Parsoid service.
Usage:
api.visualeditor.page(value).perform # returns string with raw output
# or
api.visualeditor.page(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
-
#editintro(value) ⇒ self
Edit intro to add to notices.
- #format(value) ⇒ self
-
#oldid(value) ⇒ self
The revision number to use (defaults to latest revision).
-
#paction(value) ⇒ self
Action to perform.
-
#page(value) ⇒ self
The page to perform actions on.
-
#pst ⇒ self
Pre-save transform wikitext before sending it to Parsoid (paction=parsefragment).
-
#section(value) ⇒ self
The section on which to act.
-
#wikitext(value) ⇒ self
Wikitext to send to Parsoid to convert to HTML (paction=parsefragment).
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, #maxage, #maxlag, #origin, #requestid, #responselanginfo, #servedby, #smaxage, #uselang
Instance Method Details
#editintro(value) ⇒ self
Edit intro to add to notices.
84 85 86 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditor.rb', line 84 def editintro(value) merge(editintro: value.to_s) end |
#format(value) ⇒ self
34 35 36 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditor.rb', line 34 def format(value) _format(value) or fail ArgumentError, "Unknown value for format: #{value}" end |
#oldid(value) ⇒ self
The revision number to use (defaults to latest revision).
76 77 78 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditor.rb', line 76 def oldid(value) merge(oldid: value.to_s) end |
#paction(value) ⇒ self
Action to perform.
47 48 49 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditor.rb', line 47 def paction(value) _paction(value) or fail ArgumentError, "Unknown value for paction: #{value}" end |
#page(value) ⇒ self
The page to perform actions on.
26 27 28 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditor.rb', line 26 def page(value) merge(page: value.to_s) end |
#pst ⇒ self
Pre-save transform wikitext before sending it to Parsoid (paction=parsefragment).
91 92 93 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditor.rb', line 91 def pst() merge(pst: 'true') end |
#section(value) ⇒ self
The section on which to act.
68 69 70 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditor.rb', line 68 def section(value) merge(section: value.to_s) end |
#wikitext(value) ⇒ self
Wikitext to send to Parsoid to convert to HTML (paction=parsefragment).
60 61 62 |
# File 'lib/mediawiktory/wikipedia/actions/visualeditor.rb', line 60 def wikitext(value) merge(wikitext: value.to_s) end |