If you have embarked upon the task of building your own theme, you’ll be pleased to know SassDoc comes with some extra tools for theme builders. These filters add some features to SassDoc by post-processing the data.
Extras can be added by requiring
sassdoc-extras, calling the extra function on it, and passing it the context object.
For example, to use the Markdown extra:
To use multiple extras, you can “chain” them like this:
This is some `code`. becomes
This is some <code>code</code>.
Display toggle (
display filter allows you to display items based on their visibility (access level:
private). This filter removes items that should not be displayed.
display filter uses the
display.access key from the context configuration to determine if an item should be displayed or not.
Note: It's always best to define an access level.
Groups aliases (
groupName filter allows you to define aliases for group slugs (see reference). When using
@group annotation in your SassDoc comments, you usually define a slug (a lowercase string without spaces). If you want your theme to display pretty titles, you can map those slugs to human-friendly names by setting a
groups key in your context configuration.
Note: The `groupName` filter overrides the default `group` key for each item.
Example: After using
Shortcut icon (
shortcutIcon filter takes the eponymous key from the configuration and converts it into an object with
Result of using a URL
Result of using a relative path
sort filter sorts the items from a
sort configuration value.
The sort order is determined by the last character:
> (desc) or
This filter introduces the
descriptionPath configuration keys.
description key contains raw description text. The
descriptionPath contains the path to a file containing the description.
Note: Using `descriptionPath` will override the `description` key.
descriptionPath is relative to the configuration file, and has no required format.
Note: If the `markdown` filter is called **after** the `description` filter, it will parse the description value as Markdown.
Resolved variables (
resolveVariables filter attempts to connect aliased variable to their
original value. This might be useful for previewing certain types of values,
e.g. colors. Variable aliases can be used in different contexts: variables,
map properties, mixin and function parameters. While the original value
is left untouched there’s a new
resolvedValue key being added.
Example: default data for a variable item.
Example: result after using the