Open
Description
This probably shouldn't be scoped to just @example, but that's my specific use case.
Basically, I've written examples in my source code comments, but as a result, I can't unit test them, lint them, etc, so they tend to have typos and whatnot.
src/constructable.js
/**
* @example
* <%= examples/constructable.js %>
*/
class Constructable {
}
examples/constructable.js
var constructed = new Constructable()
assert.instanceOf(constructed, Constructable);
which would produce the same output as
/**
* @example
* var constructed = new Constructable()
* assert.instanceOf(constructed, Constructable);
*/
class Constructable {
}
Right now, my plan is to solve this with a mix of documentationjs and grunt templating, but it would be great to see something like this natively in documentationjs (or via a plugin, if #70 gets traction).
Activity
tmcw commentedon Feb 15, 2016
For the time being, it'd certainly be best to do this in a separate step, before documentation.js. I would prefer not to include another interpretation layer on top of JSDoc, especially one that allowed arbitrary paths to be inserted into docs.
anandthakker commentedon Feb 16, 2016
Is this something that could be solved by a custom theme?
On Sun, Feb 14, 2016 at 7:45 PM Tom MacWright notifications@github.com
wrote:
ianwremmel commentedon Feb 20, 2016
Interesting. I've got it working with a grunt task, but I like the idea of using a theme instead. Are there any examples out there of extending the default theme?