jenkins-bot has submitted this change and it was merged. Change subject: docs: Remove JSDuck 4 support ......................................................................
docs: Remove JSDuck 4 support And migrate deprecated "-no_doc" option. Change-Id: I2e1e89408328c614a89f6c4e408df90d1e346d76 --- M .docs/CustomTags.rb D .docs/MetaTags.rb M .docs/config.json M bin/generateDocs.sh 4 files changed, 5 insertions(+), 134 deletions(-) Approvals: Jforrester: Looks good to me, approved jenkins-bot: Verified diff --git a/.docs/CustomTags.rb b/.docs/CustomTags.rb index 768c33c..5e32a89 100644 --- a/.docs/CustomTags.rb +++ b/.docs/CustomTags.rb @@ -1,4 +1,4 @@ -# Custom tags for JSDuck 4.x +# Custom tags for JSDuck 5.x # See also: # - https://github.com/senchalabs/jsduck/wiki/Tags # - https://github.com/senchalabs/jsduck/wiki/Custom-tags diff --git a/.docs/MetaTags.rb b/.docs/MetaTags.rb deleted file mode 100644 index 9366886..0000000 --- a/.docs/MetaTags.rb +++ /dev/null @@ -1,120 +0,0 @@ -# Extra meta tags for JSDuck 5+ -# 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 UntilTag < JsDuck::MetaTag - def initialize - @name = 'until' - end - - # @param tags All matches of this tag on one class. - def to_html(tags) - return [ - '<h3>Until</h3>', - '<div class="signature-box"><p>', - 'This method provides <strong>browser compatibility</strong> for:', - tags.map {|tag| format(tag) }.join("\n"), - '</p></div>' - ] - 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 - -class ContextTag < JsDuck::MetaTag - def initialize - @name = 'this' - 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 - -# 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/.docs/config.json b/.docs/config.json index 38f396f..ff9292a 100644 --- a/.docs/config.json +++ b/.docs/config.json @@ -2,8 +2,10 @@ "--title": "VisualEditor Code Documentation", "--categories": "../.docs/categories.json", "--eg-iframe": "../.docs/eg-iframe.html", - "--warnings": ["-no_doc"], + "--tags": "./CustomTags.rb", + "--warnings": ["-nodoc(class,public)"], "--builtin-classes": true, + "--warnings-exit-nonzero": true, "--external": "HTMLDocument,Window,Node", "--output": "../docs", "--": [ diff --git a/bin/generateDocs.sh b/bin/generateDocs.sh index 7f901bf..f2ebf6e 100755 --- a/bin/generateDocs.sh +++ b/bin/generateDocs.sh @@ -1,19 +1,8 @@ #!/usr/bin/env bash cd $(cd $(dirname $0)/..; pwd) -# allow custom path to jsduck, or custom version (eg JSDUCK=jsduck _4.10.4_) -JSDUCK=${JSDUCK:-jsduck} - -# Support jsduck 4.x and 5.x -jsduckver="$($JSDUCK --version | sed -e 's/[.].*//')" -if [ "$jsduckver" = "JSDuck 4" ]; then - jsduckopt="--meta-tags .docs/MetaTags.rb" -else - jsduckopt="--tags .docs/CustomTags.rb" -fi - # Disable parallel processing which seems to be causing problems under Ruby 1.8 -$JSDUCK --config .docs/config.json $jsduckopt --processes 0 --color --warnings-exit-nonzero +jsduck --config .docs/config.json --processes 0 ec=$? test ! -L docs/lib && ln -s ../lib docs/lib || echo 'Symlink already exists' -- To view, visit https://gerrit.wikimedia.org/r/130406 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2e1e89408328c614a89f6c4e408df90d1e346d76 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> Gerrit-Reviewer: Jforrester <jforres...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits