Commit b4ba4aa1 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Implement --message option.

To allow for simpler way to supply the old version warning message.
parent 12fb5025
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ module JsDuck
          :source => @opts.source,
          :commentsUrl => @opts.comments_url,
          :commentsDomain => @opts.comments_domain,
          :message => @opts.message,
        }
      }) + ";\n"
      File.open(filename, 'w') {|f| f.write(js) }
+11 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ module JsDuck
    attr_accessor :footer
    attr_accessor :head_html
    attr_accessor :body_html
    attr_accessor :message
    attr_accessor :welcome
    attr_accessor :guides
    attr_accessor :videos
@@ -99,6 +100,7 @@ module JsDuck
      @footer = "Generated with <a href='https://github.com/senchalabs/jsduck'>JSDuck</a> #{@version}."
      @head_html = ""
      @body_html = ""
      @message = ""
      @welcome = nil
      @guides = nil
      @videos = nil
@@ -291,6 +293,15 @@ module JsDuck
          @body_html += html
        end

        opts.on('--message=HTML',
          "(Warning) message to show prominently.",
          "",
          "Useful for warning users that they are viewing an old",
          "version of the docs, and prividing a link to the new",
          "version.") do |html|
          @message += html
        end

        opts.on('--welcome=PATH',
          "File with content for welcome page.",
          "",
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ Ext.define('Docs.view.cls.Index', {
            '{categories}'
        );
        this.data = {
            notice: Docs.ContentGrabber.get("notice-text"),
            notice: Docs.data.message || Docs.ContentGrabber.get("notice-text"),
            categories: Docs.ContentGrabber.get("categories-content")
        };