Config Object

Defined in: lib/config.js

Static Property Documentation

  • assetRoot: String

    Absolute path to the root directory from which all files should be located. This is automatically set to the directory containing megadoc.conf.js when you run the compiler.

  • outputDir: String

    Path to where the built assets (index.html and friends) will be saved to.

    Note that most scanner plugins will implicitly use this path to save their own assets so that they're accessible relative from the index.html entry file.

    Defaults to: "doc/compiled"

  • title: String

    Starting window title.

    Defaults to: "megadoc"

  • emitFiles: Boolean

    Whether we should generate .html files for every document.

    Defaults to: true

  • showExtensionInURLs: Boolean

    Set this to false if you do not want .html to appear in the links or the URL bar. If you do this, you must configure your webserver so that it does either of the following:

    a) serve the right file even when the .html extension is omitted b) redirect to /index.html and set the original request as a query parameter named uid

    Defaults to: true

  • motto: String

    A brief sentence describing what this is about. It will be displayed right next to the title in a small type.

  • favicon: String

    Path to where a favicon can be found. Clear this if you don't want any.

  • assets: String

    An array of paths to files you want to copy to the output directory. They will be found under assets/ with their full source path.

    For example:

    exports.assets = [ 'app/images/box.png' ];

    Will be found at:

    /assets/app/images/box.png

    Defaults to: []

  • stylesheet: String

    Absolute path to a .css or .less file to include in the CSS bundle. If you provide a .less file, you can (re)use the variables that the UI's stock stylesheets use.

    If you want to override the variables, say for custom branding, look at the @styleOverrides parameter.

    Example:

    exports.stylesheet = "doc/mega.less";
  • styleOverrides: String

    Absolute path to a .less stylesheet file that re-defines variables used in the stock UI's stylesheets. This allows for complete theming without messing with the source files, or having to use !important directives, etc.

    Example:

    exports.styleOverrides = "doc/mega/overrides.less";
  • gitStats: Boolean

    Turn this on if you want to parse git stats for the README file, like last commit date and the file's authors.

    Defaults to: false

  • footer: String

    A small message (can be Markdown) to display at the bottom of the app.

    Set this to an empty string, or null, if you don't want the footer to be shown.

    Defaults to: "Made with ♥ using [megadoc](https://github.com/megadoc)."

  • hotness: Object

    The "Hot Item" feature configuration.

    An item could be marked as "hot" if its last commit timestamp falls within a certain interval you specify below. This is useful for readers to easily tell which items have changed recently so that they should check them out.

    Defaults to: { "count": 1, "interval": "weeks" }

  • hotness.count: Number

    The number of [interval] (like days or weeks) that we should consider an item to be hot.

    Defaults to: 1

  • hotness.interval: days|weeks|months|years

    The actual interval. Works with @count defined above.

    Defaults to: "weeks"

  • disqus: Object

    disqus configuration if you want the ability for users to comment. Get this stuff from https://disqus.com/.

    Defaults to: { "enabled": false, "shortname": "", "baseUrl": "http://localhost" }

  • launchExternalLinksInNewTabs: Boolean

    Whether links to external sites should be opened in new tabs.

    Defaults to: true

  • resizableSidebar: Boolean

    Whether the side-bar should be resizable. Affects all layouts that show a sidebar.

    Defaults to: true

  • collapsibleSidebar: Boolean

    Whether to show a button for collapsing the sidebar.

    Defaults to: false

  • scrollSpying: Boolean

    Turn this on if you want the side-bar links to become active as the user is scrolling the page.

    Only works when using the single page layout.

    Defaults to: false

  • layoutOptions: Object

    Defaults to: { "rewrite": {}, "singlePageMode": false, "bannerLinks": [] }

  • rewrite: Object

    Override the default URL for certain documents. You must use UIDs to specify the documents you want to rewrite.

    Defaults to: {}

  • singlePageMode: Boolean

    Launch megadoc into "single-page" mode where you want to present all the contents in a single page. This flag MUST be turned in order for links to work online and offline.

    See the Single Page Mode guide for more information.

    Defaults to: false

  • bannerLinks: Array.<BannerLink>

    Defaults to: []

  • syntaxHighlighting: Object

    Configuration for the syntax highlighter, which uses Prism.js.

    Defaults to: { "defaultLanguage": "javascript", "languages": [ "bash", "clike", "c", "javascript", "markdown", "ruby" ], "aliases": {} }

  • syntaxHighlighting.languages: Array.<String>

    A list of language definitions to enable highlighting for. This has to map to Prism's available grammars, which you can find at http://prismjs.com/#languages-list.

    Defaults to: [ "bash", "clike", "c", "javascript", "markdown", "ruby" ]

  • syntaxHighlighting.aliases: Object

    A map of language names to alias. For example, if you're used to using "shell" as a language but Prism only has "bash", this map allows you to alias "bash" as "shell".

    Defaults to: {}

  • customLayouts: Array.<Config~Template>