-
-
Notifications
You must be signed in to change notification settings - Fork 721
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
Support placing all the documentation for each module (entry point) on a single page each. #2006
Comments
There's no built in method for doing this, and I'm not too keen on adding one built in without better infrastructure around testing themes... you can get pretty close with a custom theme like this: // typedoc --plugin ./path/to/module-theme.js --theme module
// @ts-check
const td = require("typedoc");
// @ts-ignore getMapping is marked private, probably shouldn't be
// but I've been putting off making updates to that since I want to change
// how URLs are generated completely...
class ModuleTheme extends td.DefaultTheme {
constructor(renderer) {
super(renderer);
// Unrelated to links, just a small style tweak to push members over so that they look less
// like root exports on pages with classes.
renderer.hooks.on("head.end", () => {
return {
tag: "style",
props: null,
children: [
{
tag: td.JSX.Raw,
props: { html: ".tsd-member .tsd-member { margin-left: 2em; }" },
children: [],
},
],
};
});
}
/**
* @param {td.DeclarationReflection} reflection
*/
getMapping(reflection) {
if (reflection.kindOf(td.ReflectionKind.Module)) {
return {
kind: [td.ReflectionKind.Module],
directory: "modules",
template: this.reflectionTemplate,
};
}
}
}
/** @param {td.Application} app */
exports.load = function load(app) {
app.renderer.defineTheme("module", ModuleTheme);
}; |
Thanks! I'm having trouble figuring out how to run that, though: Can I pass a file to the |
No, themes are given theme names passed to
|
* wip * 🤖 lazy commit * 🤖 lazy commit * revert some changes, remove prettier jsdoc plugin for now * sidebar tweaks * add adapter module docs * remove provider docs * embed all reflections under modules Based on: TypeStrong/typedoc#2006 Related: typedoc2md/typedoc-plugin-markdown#338 * no trailing slash, update theme * updates * update snapshot * update sidebar and overview
Thanks for working on TypeDoc! I tried it a while back and it didn't work for us, but I just tried it again, and I got some very lovely output in a matter of seconds! 😍
I'm filing this issue to see if I can address my main reservation before adopting it for our project.
Search Terms
module documentation together single page
Problem
TypeDoc is great at giving an overview list of the exports of a module, but it doesn't have a way to look at the full documentation details for a single module (entry point) at once.
Suggested Solution
I'd really like to be able to generate all the documentation for a given module on the same page. I'm a big fan of what Go's documentation does, with the list of exports at the top of the page and then all their documentation below. For example: https://pkg.go.dev/net/http
Although I appreciate that TypeDoc includes a search bar, search and various other things become easier if everything for a module is on the same page.
As far as I can tell, it would be sufficiently useful for us if there were an option to inline all the sub-pages of a module into its main page instead.
The text was updated successfully, but these errors were encountered: