-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow custom theming #69
Comments
For the end-user, I would see something like this: npm install sassdoc-theme-foo
sassdoc -t foo ... SassDoc would comme with A theme could override the Swig views (so we need a pre-defined and documented base structure for Swig views), and would have its own A theme could have its own variables defined in |
Moving this to 2.0. |
Concerning my previous comment, this is how I think we can implement it: // `args` from docopt
var themeName = args['--theme'];
var theme;
try {
theme = require('sassdoc-theme-' + themeName);
} catch (e) {
// Display error in `stderr` and return exit code 1
}
theme.path; // Path to theme directory (from the Node module) So a theme would contain only a exports.path = __dirname; (Or maybe there's a better solution to get a Node module directory?) The package directory would then contain sassdoc-theme-foo/
assets/
css/
main.css
js/
main.js
views/
includes/
header.html.swig # Will override the original version
index.js
package.json SassDoc would copy For the views, I don't know if we can define a custom file resolver with Swig, but otherwise we can generate a temporary directory, copy all SassDoc's distribution views, then merge them with |
Since the abstraction of the template engine allows to write custom themes, this issue is a duplicate of #47. |
I am well aware the current design of SassDoc won't suit everybody. Actually, no design can convince everybody.
I thing an important feature would be to all the user to use a custom theme. Still, I'm not quite sure what's the best way to handle this.
I'm willing to hear opinions.
The text was updated successfully, but these errors were encountered: