Aside from regular configuration from SassDoc itself, it is likely that the theme you use provides some kind of default configuration that you can overload.
This is done exactly like the regular configuration, within the same configuration file. Please refer to the configuration documentation to learn how to specify a configuration file.
SassDoc’s default theme has a couple of options to give you some extra power over the view.
display.access option lists access levels that are being displayed, default is all (both
private). If you don’t want to display
private items, you can remove it from the array, like so:
display.alias option defines whether or not aliases should be displayed. Default value is
false, meaning that aliases items are not displayed in the docs. They are documented and exist in the raw data, but are simply not displayed.
If you want to display aliases as well, change the value to
The default theme from SassDoc displays a discret © Made with love by SassDoc team. in the footer, in order to promote the tool and share the love. You can turn off this watermak if you like, but we would really appreciate you to leave it if you use this theme.
Along the same lines, if you build your own theme, adding a little mention to SassDoc somewhere on the page would be very nice of you!
basePath option is used to provide a View source link to each item in case the code is hosted on a public repository. By setting the option to the base path of your repository, and thanks to SassDoc’s parser keeping track of the file name, the path and the lines number, we are able to build links such as:
Caution! as you can see from the previous example, GitHub adds
/blob/<branch_name> between the base path and the file path. To prevent your links from being broken, set your base path to:
shortcutIcon option can be used to provide a favicon to your documentation. It accepts a path, either relative or absolute.
If you are using Google Analytics to track users behaviour on your site, you can set your Google Analytics tracking key as a value for the
In case you don’t use Google Analytics, or use a custom tracking code snippet, you can set it as a value to the
trackingCode option. It will be directly injected in the DOM as HTML, so be sure to include
</script> tags if you need them.
Note: in YAML, you can leave a single pipe on the first line to indicate that the everything until the next key is a literal string.
You can customize the order of your items with this option.
Supported criteria are:
sort context key is an array of strings, representing a sort
criteria plus an optional sort order. The sort order is determined if
the last character is either
< (respectively desc and asc).
This will sort the data by access (public first, then private,
access> would have inverted the order), then by descending line (last items in the file first), then by alphetical group (case insensitive), then by file.
You can define a complete description of your project (unlike
package.description which is a short overview). It is parsed as Markdown.
If you prefer to externalize the description in a file, you can use the
descriptionPath option, which will populate (or overwrite) the
description option. It is relative to the configuration file, and parsed as Markdown.
Here’s a JSON example:
And the same configuration in YAML:
It is common practice to prefix so called private items by an underscore (
_) in languages that do not provide a way to have actual private members in order to indicate they are internal tools not meant to be used as part of the public API.
Adding to this, Sass treats hyphens and underscores exactly the same in identifiers, so
-foo are equivalent when it comes to a functions, mixins and variables name (not for placeholders though, which behave more like CSS classes where
- are not the same).
When applied to SassDoc, it means that SassDoc will automatically assume that an item is private (i.e.
@access private) if it starts with an hyphen or an underscore. You can configure this with the
When set to
false, it intimates SassDoc not to assume anything. On the other hand, if a regular expression is given (default is
^[_-]), SassDoc will assume the item is private if its name matches.