Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/130409
Change subject: Remove JSDuck 4 support ...................................................................... Remove JSDuck 4 support Also fold more of the options back into jsduck/config.json which makes it easier to run without the maintenance script. The maintenance script only serves as convenience for publication via Jenkins where we want a branch-specific footnote and disablle parallel processing since that doesn't work in the Ruby version used in wmf-production. Change-Id: I2e1e89408328c614a89f6c4e408df90d1e346d76 --- D maintenance/jsduck/MetaTags.rb M maintenance/jsduck/config.json M maintenance/mwjsduck-gen 3 files changed, 6 insertions(+), 115 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/09/130409/1 diff --git a/maintenance/jsduck/MetaTags.rb b/maintenance/jsduck/MetaTags.rb deleted file mode 100644 index cde7d3b..0000000 --- a/maintenance/jsduck/MetaTags.rb +++ /dev/null @@ -1,103 +0,0 @@ -# Custom tags for JSDuck 4.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/meta_tag' - -class SourceTag < JsDuck::MetaTag - def initialize - # This defines the name of the @tag - @name = 'source' - end - - # Generate HTML output for this tag. - # One can make use of the #format method to easily support - # Markdown and {@link} tags inside the contents of the tag. - # - # @param tags All matches of this tag on one class. - def to_html(tags) - '<h3 class="pa">Source</h3>' + tags.map {|tag| format(tag) }.join("\n") - end -end - -class ContextTag < JsDuck::MetaTag - def initialize - @name = 'context' - end - - # @param tags All matches of this tag on one class. - def to_html(tags) - return '<h3 class="pa">Context</h3>' + render_long_context(tags.last) - end - - def render_long_context(tag) - if tag =~ /\A([^\s]+)/m - name = $1 - return format("`this` : {@link #{name}}") - end - end -end - -class SeeTag < JsDuck::MetaTag - def initialize - @name = 'see' - @multiline = true - end - - # @param tags All matches of this tag on one class. - def to_html(tags) - doc = [] - doc << '<h3 class="pa">Related</h3>' - doc << [ - '<ul>', - tags.map {|tag| render_long_see(tag) }, - '</ul>', - ] - doc - end - - def render_long_see(tag) - if tag =~ /\A([^\s]+)( .*)?\Z/m - name = $1 - doc = $2 ? ': ' + $2 : '' - return [ - '<li>', - format("{@link #{name}} #{doc}"), - '</li>' - ] - end - end -end - -# As of JSDuck 5 this is in core -class FiresTag < JsDuck::MetaTag - def initialize - @name = 'fires' - @multiline = true - end - - # @param tags All matches of this tag on one class. - def to_html(tags) - doc = [] - doc << '<h3 class="pa">Fires</h3>' - doc << [ - '<ul>', - tags.map {|tag| render_long_event(tag) }, - '</ul>', - ] - doc - end - - def render_long_event(tag) - if tag =~ /\A(\w+)( .*)?\Z/m - name = $1 - doc = $2 ? ': ' + $2 : '' - return [ - '<li>', - format("{@link #event-#{name}} #{doc}"), - '</li>' - ] - end - end -end diff --git a/maintenance/jsduck/config.json b/maintenance/jsduck/config.json index 33f7652..65ead02 100644 --- a/maintenance/jsduck/config.json +++ b/maintenance/jsduck/config.json @@ -1,11 +1,14 @@ { "--title": "MediaWiki core - Documentation", - "--footer": "Documentation for MediaWiki core. Generated on {DATE} by {JSDUCK} {VERSION}.", "--categories": "./categories.json", "--eg-iframe": "./eg-iframe.html", + "--tags": "./CustomTags.rb", + "--warnings": ["-nodoc(class,public)"], "--builtin-classes": true, - "--output": "../../docs/js", + "--warnings-exit-nonzero": true, "--external": "HTMLElement,HTMLDocument,Window", + "--footer": "Documentation for MediaWiki core. Generated on {DATE} by {JSDUCK} {VERSION}.", + "--output": "../../docs/js", "--": [ "./external.js", "../../resources/src/mediawiki", diff --git a/maintenance/mwjsduck-gen b/maintenance/mwjsduck-gen index 442163e..cc42307 100755 --- a/maintenance/mwjsduck-gen +++ b/maintenance/mwjsduck-gen @@ -14,18 +14,9 @@ MWCORE_DIR=$(cd $(dirname $0)/..; pwd) -# Support jsduck 4.x and 5.x -JSDUCK_VERSION="$(jsduck --version | sed -e 's/[.].*//')" -if [ "$JSDUCK_VERSION" = "JSDuck 4" ]; then - JSDUCK_VERSION_OPT="--meta-tags $MWCORE_DIR/maintenance/jsduck/MetaTags.rb --warnings=-no_doc" -else - JSDUCK_VERSION_OPT="--tags $MWCORE_DIR/maintenance/jsduck/CustomTags.rb --warnings=-nodoc(class,public)" -fi - jsduck \ --config=$MWCORE_DIR/maintenance/jsduck/config.json \ -$JSDUCK_VERSION_OPT \ --footer="Documentation for branch ($JSDUCK_MWVERSION) on {DATE} by {JSDUCK} {VERSION}." \ ---processes 0 --warnings-exit-nonzero \ +--processes 0 \ && echo 'JSDuck execution finished.' \ && ln -s ../../resources $MWCORE_DIR/docs/js/modules -- To view, visit https://gerrit.wikimedia.org/r/130409 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e1e89408328c614a89f6c4e408df90d1e346d76 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits