Skip to content
nene edited this page Feb 21, 2013 · 4 revisions

Official Sencha docs have a menu for jumping between the docs of different products and versions:

Screenshot of popup menu in ExtJS docs

This is currently a hidden hackish feature of JSDuck. But as it's there, you might as well use it if you want to. To make the menu appear you need to inject a bit of JavaScript into the JSDuck output:

$ jsduck --body-html="<script type='text/javascript'>
      Docs.otherProducts = [
          {text: 'MyDocs 3.0', href: 'http://example.com/docs/3.0'},
          {text: 'MyDocs 2.0', href: 'http://example.com/docs/2.0'},
          {text: 'MyDocs 1.0', href: 'http://example.com/docs/1.0'}
      ];
      </script>"

It's better to place such a long command line option to a Config file instead:

    {
        "--body-html": [
            "<script type='text/javascript'>",
            "Docs.otherProducts = [",
                "{text: 'MyDocs 3.0', href: 'http://example.com/docs/3.0'},",
                "{text: 'MyDocs 2.0', href: 'http://example.com/docs/2.0'},",
                "{text: 'MyDocs 1.0', href: 'http://example.com/docs/1.0'}",
            "];",
            "</script>"
        ]
    }
Clone this wiki locally