-
Notifications
You must be signed in to change notification settings - Fork 486
Theme API 2.0 #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Theme API 2.0 #275
Conversation
This is great. Couple questions:
|
}), 'utf8') | ||
}))); | ||
})); | ||
require(options.theme || 'documentation-theme-default')(comments, options, callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you tested that this will work with relative paths with the CLI? I'm worried that specifying, for instance -t ./my-theme
will look for that theme within lib/output/
, rather than the CWD
Code looks solid, made one note about confirming that relative paths still work. I see how the Markdown used to be templatable, like HTML, before the mdast switch. I think Markdown output is less... dying for customization relatively, but it's true that eventually we'll want to make it swappable. But for now, especially with upcoming CLI switches for the Markdown output, I'd like to keep it in core. I'd prefer keeping options limited to formatterOptions - these could include a larger subset of the |
Okay, sold on both points. Re: keeping @tmcw Also agree re: formatterOptions and API stability. Separate but slightly related: it might be nice if there were a way to pass cli options through to a theme. I happen to like browserify's subarg approach, e.g. |
This feature seems awesome. Is it documented yet? Any example of how to use this API? |
@jfirebaugh Nice. So, how does the module get registered with documentation.js? Is it a command line option, where the option matches the name of the module (just making a complete guess)? |
Custom themes are modules that export:
Implements #248.