Commit 40d02e54 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Add configurable footer.

Useful for showing some about-information for the docs.

Added code to Rakefile to display the current JSDuck revision there.
parent e5267f26
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -72,9 +72,11 @@ end
desc "Run JSDuck on ExtJS SDK for export"
task :export do
  load_sdk_vars
  rev = `git rev-parse HEAD`.slice(0, 7)

  run_jsduck([
    "--title", "Ext JS 4.0.3 API Documentation",
    "--footer", "ExtJS 4.0.3 Documentation from Sencha. Generated with <a href='https://github.com/nene/jsduck'>JSDuck</a> revison #{rev}",
    "--extjs-path", "extjs/ext-all.js",
    "#{SDK_DIR}/extjs/src",
    "#{SDK_DIR}/platform/src",
@@ -92,6 +94,7 @@ end
desc "Run JSDuck on ExtJS SDK for export"
task :live_docs do
  load_sdk_vars
  rev = `git rev-parse HEAD`.slice(0, 7)

  analytics = <<-EOHTML
    <script type="text/javascript">
@@ -128,6 +131,7 @@ task :live_docs do

  run_jsduck([
    "--title", "Ext JS 4.0.3 API Documentation",
    "--footer", "ExtJS 4.0.3 Documentation from Sencha. Generated with <a href='https://github.com/nene/jsduck'>JSDuck</a> revison #{rev}",
    "--extjs-path", "extjs/ext-all.js",
    "--append-html", analytics,
    "#{SDK_DIR}/extjs/src",
+4 −0
Original line number Diff line number Diff line
@@ -44,6 +44,10 @@ opts = OptionParser.new do | opts |
    app.extjs_path = path
  end

  opts.on('--footer=TEXT', "Custom footer text for the documentation app.", " ") do |text|
    app.footer = text
  end

  opts.on('--guides=PATH', "Path to guides directory.",
    "Each subdirectory of that is treated as a guide",
    "and is expectd to contain a REAME.md file,",
+3 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ module JsDuck
    attr_accessor :external_classes
    attr_accessor :show_private_classes
    attr_accessor :title
    attr_accessor :footer
    attr_accessor :extjs_path
    attr_accessor :append_html

@@ -50,6 +51,7 @@ module JsDuck
      @external_classes = []
      @show_private_classes = false
      @title = "Ext JS API Documentation"
      @footer = 'Generated with <a href="https://github.com/nene/jsduck">JSDuck</a>.'
      @extjs_path = "extjs/ext-all-debug.js"
      @append_html = ""
      @timer = Timer.new
@@ -321,6 +323,7 @@ module JsDuck
      Logger.instance.log("Creating #{dir}/index.html...")
      html = IO.read(template_dir+"/index.html")
      html.gsub!("{title}", @title)
      html.gsub!("{footer}", @footer)
      html.gsub!("{extjs_path}", @extjs_path)
      html.gsub!("{append_html}", @append_html)
      FileUtils.rm(dir+"/index.html")
+6 −0
Original line number Diff line number Diff line
@@ -103,6 +103,12 @@ Ext.define('Docs.view.Viewport', {
                        }
                    ]
                }
            },
            {
                region: 'south',
                id: 'footer',
                contentEl: 'footer-content',
                height: 15
            }
        ];

+2 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
        <input type="hidden" id="x-history-field" />
        <iframe id="x-history-frame"></iframe>
    </form>
    <div id="footer-content" style="display: none">{footer}</div>
    {append_html}
</body>
</html>
Loading