Closed trusktr closed 3 years ago
It marks all the actual content from my project as "external":
Well that's certainly unexpected. It looks like it also picked up the readme from your dependency. I think the cause of the bug is here: https://github.com/TypeStrong/typedoc/blob/master/src/lib/converter/plugins/PackagePlugin.ts#L85
TypeDoc shouldn't assume the first SourceFile
it documents is in the project that is being documented. I'm not entirely sure how this should be fixed right now... maybe we should be resolving the readme.md & package.json files relative to the current working directory, but that will cause problems if you try to run TypeDoc when not in the root directory of a project.
I've now also been hit with this. My solution was to move the 1st dependency to another line, but I find this super confusing. This is not really a solution if you're using tslint
which will tell you your imports are not alphabetized.
At the very least, developers should be able to specify a package.json
, README.md
and directory to start walking the project (usually src/
).
Two solutions I came up with for those coming from a search engine:
--name <project-name> --readme <readme-file> <src-directory>
--excludeExternals "node_modules/*"
but this will not include the externals in your resulting documentation. For me, this was unacceptable, so I went with the 1st solution.As far as I can tell, this should be fixed in 0.20. In that version, instead of looking through source files, we find the package + readme starting from the root directory of all TS files in the project.
Expected Behavior
My project is called
infamous
. Thepackage.json
file contains:I expect the name of the project to show up as "infamous" in the generated HTML site.
Actual Behavior
However, the name appears as "lowclass",
where "lowclass" is a dependency of my project.
Steps to reproduce the bug
Clone github.com/infamous/infamous, run typedoc.
Environment