From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 4 Jun 2015 07:31:04 +0200 Subject: Update to MediaWiki 1.25.1 --- maintenance/jsduck/CustomTags.rb | 116 ----------------------------------- maintenance/jsduck/categories.json | 11 ++-- maintenance/jsduck/custom_tags.rb | 120 +++++++++++++++++++++++++++++++++++++ maintenance/jsduck/eg-iframe.html | 71 +++++++++++++--------- 4 files changed, 170 insertions(+), 148 deletions(-) delete mode 100644 maintenance/jsduck/CustomTags.rb create mode 100644 maintenance/jsduck/custom_tags.rb (limited to 'maintenance/jsduck') diff --git a/maintenance/jsduck/CustomTags.rb b/maintenance/jsduck/CustomTags.rb deleted file mode 100644 index 2aff9881..00000000 --- a/maintenance/jsduck/CustomTags.rb +++ /dev/null @@ -1,116 +0,0 @@ -# Custom tags for JSDuck 5.x -# See also: -# - https://github.com/senchalabs/jsduck/wiki/Tags -# - https://github.com/senchalabs/jsduck/wiki/Custom-tags -# - https://github.com/senchalabs/jsduck/wiki/Custom-tags/7f5c32e568eab9edc8e3365e935bcb836cb11f1d -require 'jsduck/tag/tag' - -class CommonTag < JsDuck::Tag::Tag - def initialize - @html_position = POS_DOC + 0.1 - @repeatable = true - end - - def parse_doc(scanner, position) - if @multiline - return { :tagname => @tagname, :doc => :multiline } - else - text = scanner.match(/.*$/) - return { :tagname => @tagname, :doc => text } - end - end - - def process_doc(context, tags, position) - context[@tagname] = tags - end - - def format(context, formatter) - context[@tagname].each do |tag| - tag[:doc] = formatter.format(tag[:doc]) - end - end -end - -class SourceTag < CommonTag - def initialize - @tagname = :source - @pattern = "source" - super - end - - def to_html(context) - context[@tagname].map do |source| - <<-EOHTML -

Source

- #{source[:doc]} - EOHTML - end.join - end -end - -class SeeTag < CommonTag - def initialize - @tagname = :see - @pattern = "see" - super - end - - def format(context, formatter) - position = context[:files][0] - context[@tagname].each do |tag| - tag[:doc] = '
  • ' + render_long_see(tag[:doc], formatter, position) + '
  • ' - end - end - - def to_html(context) - <<-EOHTML -

    Related

    - - EOHTML - end - - def render_long_see(tag, formatter, position) - if tag =~ /\A([^\s]+)( .*)?\Z/m - name = $1 - doc = $2 ? ': ' + $2 : '' - return formatter.format("{@link #{name}} #{doc}") - else - JsDuck::Logger.warn(nil, 'Unexpected @see argument: "'+tag+'"', position) - return tag - end - end -end - -class ContextTag < CommonTag - def initialize - @tagname = :context - @pattern = 'context' - super - end - - def format(context, formatter) - position = context[:files][0] - context[@tagname].each do |tag| - tag[:doc] = render_long_context(tag[:doc], formatter, position) - end - end - - def to_html(context) - <<-EOHTML -

    Context

    - #{ context[@tagname].last[:doc] } - EOHTML - end - - def render_long_context(tag, formatter, position) - if tag =~ /\A([^\s]+)/m - name = $1 - return formatter.format("`context` : {@link #{name}}") - else - JsDuck::Logger.warn(nil, 'Unexpected @context argument: "'+tag+'"', position) - return tag - end - end -end diff --git a/maintenance/jsduck/categories.json b/maintenance/jsduck/categories.json index d6163bde..eab2b632 100644 --- a/maintenance/jsduck/categories.json +++ b/maintenance/jsduck/categories.json @@ -13,7 +13,9 @@ "mw.html", "mw.html.Cdata", "mw.html.Raw", - "mw.hook" + "mw.hook", + "mw.template", + "mw.errorLogger" ] }, { @@ -21,6 +23,7 @@ "classes": [ "mw.Title", "mw.Uri", + "mw.messagePoster.*", "mw.notification", "mw.Notification_", "mw.user", @@ -54,7 +57,8 @@ { "name": "Interfaces", "classes": [ - "mw.Feedback" + "mw.Feedback", + "mw.Feedback.Dialog" ] }, { @@ -69,8 +73,7 @@ "mw.log", "mw.inspect", "mw.inspect.reports", - "mw.Debug", - "mw.Debug.profile" + "mw.Debug" ] } ] diff --git a/maintenance/jsduck/custom_tags.rb b/maintenance/jsduck/custom_tags.rb new file mode 100644 index 00000000..39589a06 --- /dev/null +++ b/maintenance/jsduck/custom_tags.rb @@ -0,0 +1,120 @@ +# Custom tags for JSDuck 5.x +# See also: +# - https://github.com/senchalabs/jsduck/wiki/Tags +# - https://github.com/senchalabs/jsduck/wiki/Custom-tags +# - https://github.com/senchalabs/jsduck/wiki/Custom-tags/7f5c32e568eab9edc8e3365e935bcb836cb11f1d +require 'jsduck/tag/tag' + +class CommonTag < JsDuck::Tag::Tag + def initialize + @html_position = POS_DOC + 0.1 + @repeatable = true + end + + def parse_doc(scanner, _position) + if @multiline + return { tagname: @tagname, doc: :multiline } + else + text = scanner.match(/.*$/) + return { tagname: @tagname, doc: text } + end + end + + def process_doc(context, tags, _position) + context[@tagname] = tags + end + + def format(context, formatter) + context[@tagname].each do |tag| + tag[:doc] = formatter.format(tag[:doc]) + end + end +end + +class SourceTag < CommonTag + def initialize + @tagname = :source + @pattern = 'source' + super + end + + def to_html(context) + context[@tagname].map do |source| + <<-EOHTML +

    Source

    + #{source[:doc]} + EOHTML + end.join + end +end + +class SeeTag < CommonTag + def initialize + @tagname = :see + @pattern = 'see' + super + end + + def format(context, formatter) + position = context[:files][0] + context[@tagname].each do |tag| + tag[:doc] = '
  • ' + render_long_see(tag[:doc], formatter, position) + '
  • ' + end + end + + def to_html(context) + <<-EOHTML +

    Related

    + + EOHTML + end + + def render_long_see(tag, formatter, position) + match = /\A([^\s]+)( .*)?\Z/m.match(tag) + + if match + name = match[1] + doc = match[2] ? ': ' + match[2] : '' + return formatter.format("{@link #{name}} #{doc}") + else + JsDuck::Logger.warn(nil, 'Unexpected @see argument: "' + tag + '"', position) + return tag + end + end +end + +class ContextTag < CommonTag + def initialize + @tagname = :context + @pattern = 'context' + super + end + + def format(context, formatter) + position = context[:files][0] + context[@tagname].each do |tag| + tag[:doc] = render_long_context(tag[:doc], formatter, position) + end + end + + def to_html(context) + <<-EOHTML +

    Context

    + #{ context[@tagname].last[:doc] } + EOHTML + end + + def render_long_context(tag, formatter, position) + match = /\A([^\s]+)/m.match(tag) + + if match + name = match[1] + return formatter.format("`context` : {@link #{name}}") + else + JsDuck::Logger.warn(nil, 'Unexpected @context argument: "' + tag + '"', position) + return tag + end + end +end diff --git a/maintenance/jsduck/eg-iframe.html b/maintenance/jsduck/eg-iframe.html index 7dc4afa8..fca839d9 100644 --- a/maintenance/jsduck/eg-iframe.html +++ b/maintenance/jsduck/eg-iframe.html @@ -3,14 +3,46 @@ MediaWiki Code Example - + + - - + + + +