Skip to content
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

To show "directory-based hierarchy" module indexes #379

Closed
ShiMeiWo opened this issue Jan 13, 2017 · 12 comments
Closed

To show "directory-based hierarchy" module indexes #379

ShiMeiWo opened this issue Jan 13, 2017 · 12 comments

Comments

@ShiMeiWo
Copy link

When I made class files:

(under scripts directory)
* _lib
  * common
    * Foo.ts (class Foo)
    * Bar.ts (class Bar)
* docparts
  * Head.ts (class Head)
  * Body.ts (class Body)
  * Foot.ts (class Foot)

typedoc shows module indexes as:

Bar
Body
Foo
Foot
Head

or

"_lib/common/Bar"
"_lib/common/Foo"
"docparts/Body"
"docparts/Foot"
"docparts/Head"

But I want to look them as:

_lib
  common
    Bar
    Foo
docparts
  Body
  Foot
  Head

In theory, the hierarchy must be decided by namespace(or package), but it seems that TS's "namespace" is not for. I'm grad if you all consider about this.
Thanks.

@aciccarello
Copy link
Collaborator

This is related to #68 and #242. I'd personally love to see the "files" module structure improved.

@ShiMeiWo
Copy link
Author

Oh, I've got what you and them said. It seems so difficult to have few meaning hierarchies in TS project…
Thanks for your reply.

@jasonburrows
Copy link

@aciccarello it isn't just the "files" mode - even when generating in "modules" mode it just prefixes the name of every single thing with the containing folder and presents it as a flat list. It seems like it would be trivial to simply create a hierarchy from the folder names (or at least have that as an option) since it is using them anyway to generate the names in the globals list.

For large projects I can't find any combination of options that doesn't just spit out a gigantic single top page with no hierarchical order of any kind. Its literally easier for me to read the documentation by browsing the source code because without the folders giving it some order, its just information overload.

@ghost
Copy link

ghost commented May 18, 2018

Just encountered the very same issue which I reported in #774. I'd appreciate if there was a way to categorize by folders in order to keep things both clean and prevent unexpected merges and overwrites.

@dskvr
Copy link

dskvr commented Jul 29, 2018

+1

@r4tz52
Copy link

r4tz52 commented Aug 20, 2019

Any news on this?

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Aug 25, 2019

As far as I know nobody's taken a theme and made it happen. It should be relatively easy to modify the default theme if you'd rather have this behavior.

@leilapearson
Copy link

leilapearson commented Mar 22, 2020

Good news for anyone looking for a solution!

Someone at google did create a theme that provides a directory-based hierarchy for navigation!

The theme is called typedoc-neo-theme.

It provides a nice navigation structure - auto-generated and apparently also customizable.

If you're using npm, you can install it with npm install -D tyepdoc-neo-theme

Then you can update your tsdoc options to use it -- or specify the theme via a command line argument.

I'm specifying my typedoc options in tsconfig.json like this:

	"typedocOptions": {
		"inputFiles": [
			"./src"
		],
		"theme": "node_modules/typedoc-neo-theme/bin/default",
		"mode": "modules",
		"out": "docs",
		"exclude": [
			"**/src/test/*",
			"**/*.test.ts",
			"**/__tests__/*",
			"**/__mocks__/*"
		],
		"excludeNotExported": true
	},

@ShiMeiWo
Copy link
Author

ShiMeiWo commented Jun 4, 2020

@leilapearson
I suppose, that is the solution. I'll try it.
I close this issue now.

Thank you all.

@DiFuks
Copy link

DiFuks commented Jun 17, 2021

Hello, do you have any news?

@ramiroaisen
Copy link

ramiroaisen commented Nov 21, 2021

I have make a patch to use directory based hierarchy
to try it you can npm i github:ramiroaisen/typedoc
Feel free to fork it from there too
Hope someone finds it helpfull

Captura de pantalla de 2021-11-20 21-22-16

@DiFuks
Copy link

DiFuks commented Dec 30, 2021

Hey! I suggest trying my solution:

https://www.npmjs.com/package/typedoc-theme-hierarchy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants