class MediaWiktory::Wikipedia::Actions::Visualeditor
Returns HTML5 for a page from the Parsoid service.
Usage:
“`ruby 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 {MediaWiktory::Wikipedia::Response} for working with action responses.
All action's parameters are documented as its public methods, see below.
Public Instance Methods
@private
# File lib/mediawiktory/wikipedia/actions/visualeditor.rb, line 39 def _format(value) defined?(super) && super || ["json", "jsonfm"].include?(value.to_s) && merge(format: value.to_s) end
@private
# File lib/mediawiktory/wikipedia/actions/visualeditor.rb, line 52 def _paction(value) defined?(super) && super || ["parse", "metadata", "wikitext", "parsefragment", "getlanglinks"].include?(value.to_s) && merge(paction: value.to_s) end
Edit
intro to add to notices.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/visualeditor.rb, line 84 def editintro(value) merge(editintro: value.to_s) end
@param value [String] One of “json”, “jsonfm”. @return [self]
# File lib/mediawiktory/wikipedia/actions/visualeditor.rb, line 34 def format(value) _format(value) or fail ArgumentError, "Unknown value for format: #{value}" end
The revision number to use (defaults to latest revision).
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/visualeditor.rb, line 76 def oldid(value) merge(oldid: value.to_s) end
Action to perform.
@param value [String] One of “parse”, “metadata”, “wikitext”, “parsefragment”, “getlanglinks”. @return [self]
# File lib/mediawiktory/wikipedia/actions/visualeditor.rb, line 47 def paction(value) _paction(value) or fail ArgumentError, "Unknown value for paction: #{value}" end
The page to perform actions on.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/visualeditor.rb, line 26 def page(value) merge(page: value.to_s) end
Pre-save transform wikitext before sending it to Parsoid (paction=parsefragment).
@return [self]
# File lib/mediawiktory/wikipedia/actions/visualeditor.rb, line 91 def pst() merge(pst: 'true') end
The section on which to act.
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/visualeditor.rb, line 68 def section(value) merge(section: value.to_s) end
Wikitext to send to Parsoid to convert to HTML (paction=parsefragment).
@param value [String] @return [self]
# File lib/mediawiktory/wikipedia/actions/visualeditor.rb, line 60 def wikitext(value) merge(wikitext: value.to_s) end