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 using either the --body-html or --head-html option. Because we need to inject several lines of JavaScript, it's better to place such a long command line option to a Config file:

    {
        "--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>"
        ]
    }

Then pass it to JSDuck:

$ jsduck --config=config.json ...other.options...