Defined in: lib/config.js
| String | assetRoot |
| String | outputDir |
| String | title |
| Boolean | emitFiles |
| Boolean | showExtensionInURLs |
| String | motto |
| String | favicon |
| String | assets |
| String | stylesheet |
| String | styleOverrides |
| Boolean | gitStats |
| String | footer |
| Object | hotness |
| Number | hotness.count |
| days|weeks|months|years | hotness.interval |
| Object | disqus |
| Boolean | launchExternalLinksInNewTabs |
| Boolean | resizableSidebar |
| Boolean | collapsibleSidebar |
| Boolean | scrollSpying |
| Object | layoutOptions |
| Object | rewrite |
| Boolean | singlePageMode |
| Array.<BannerLink> | bannerLinks |
| Object | syntaxHighlighting |
| Array.<String> | syntaxHighlighting.languages |
| Object | syntaxHighlighting.aliases |
| Array.<Config~Template> | customLayouts |
StringAbsolute 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.
StringPath 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"
StringStarting window title.
Defaults to: "megadoc"
BooleanWhether we should generate .html files for every document.
Defaults to: true
BooleanSet 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
StringA brief sentence describing what this is about. It will be displayed right next to the title in a small type.
StringPath to where a favicon can be found. Clear this if you don't want any.
StringAn 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.pngDefaults to: []
StringAbsolute 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";StringAbsolute 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";BooleanTurn 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
StringA 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)."
ObjectThe "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"
}
NumberThe number of [interval] (like days or weeks) that we should consider an item to be hot.
Defaults to: 1
days|weeks|months|yearsThe actual interval. Works with @count defined above.
Defaults to: "weeks"
Objectdisqus 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"
}
BooleanWhether links to external sites should be opened in new tabs.
Defaults to: true
BooleanWhether the side-bar should be resizable. Affects all layouts that show a sidebar.
Defaults to: true
BooleanWhether to show a button for collapsing the sidebar.
Defaults to: false
BooleanTurn 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
ObjectDefaults to: {
"rewrite": {},
"singlePageMode": false,
"bannerLinks": []
}
ObjectOverride the default URL for certain documents. You must use UIDs to specify the documents you want to rewrite.
Defaults to: {}
BooleanLaunch 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
Array.<BannerLink>Defaults to: []
ObjectConfiguration for the syntax highlighter, which uses Prism.js.
Defaults to: {
"defaultLanguage": "javascript",
"languages": [
"bash",
"clike",
"c",
"javascript",
"markdown",
"ruby"
],
"aliases": {}
}
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"
]
ObjectA 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: {}
Array.<Config~Template>Made with ♥ using megadoc.