DiFuks / typedoc-theme-hierarchy

Hierarchy theme for typedoc
MIT License
18 stars 5 forks source link

keep navigation state #3

Closed gitawego closed 2 years ago

gitawego commented 2 years ago

thanks for your great theme, I've a little request, I'd like to know show can I keep the navigation state.

Currently when I click on a sub module, the navigation (sidenav) is reset to first level

DiFuks commented 2 years ago

You can record a gif. What do you have in mind?

dcallus commented 2 years ago

I'd have to agree here. Clicking on any of the modules makes the hierarchy collapse back to default state and if you're way down the page you need to scroll back up to get to it again. Having it stay open when you click a link would be very useful.

Also, having the option to have the tree open by default would be nice.

DiFuks commented 2 years ago

Ok! I will definitely do it soon

DiFuks commented 2 years ago

@dcallus

Also, having the option to have the tree open by default would be nice.

What do you mean?

dcallus commented 2 years ago

Ok! I will definitely do it soon

thanks :) That would be great.

@dcallus

Also, having the option to have the tree open by default would be nice.

What do you mean?

I just mean so that the folders start open instead of closed. It's a minor issue really :)

Also worth noting that you have an open folder image which is currently not in use. Line 47 of custom.js should read icon === null || icon === void 0 ? void 0 : icon.classList.toggle('category__folder--open'); At the moment it's something like 'fa-folder-open' at the end, which doesn't seem to work for me at least, but the above line does :) unless I messed something up from experimenting

Love the the plugin though :) Thanks for your efforts so far

DiFuks commented 2 years ago

@gitawego @dcallus

Hey!

I've released a new version (1.2.0) where the open folder state is saved when switching between pages.

I also added buttons to open and close all folders. And I also added a button to go to the current open file

gitawego commented 2 years ago

thanks a lot

dcallus commented 2 years ago

Thanks a lot. Will check this out :)

kr1p70n1c commented 2 years ago

@dcallus @gitawego Is this working for you? I definitely still see some odd behaviour here where the hierarchy does not stay open as expected, seems like it does what it wants.

/cc @DiFuks

DiFuks commented 2 years ago

Hello! I don't see any problems. An example is here: https://docs.new.fuks.ru/

kr1p70n1c commented 2 years ago

@DiFuks

Hello! I don't see any problems. An example is here: https://docs.new.fuks.ru/

At that site it works great though! Just not my side when I use the theme. I am testing it via the file:/// protocol in the browser, but surely it doesn't have to be hosted for it to work?

I can provide further details of what is going on when clicking on generated types.

Also, I generate the docs as follows:

typedoc --entryPoints src --entryPointStrategy expand --out docs/api --plugin ./node_modules/typedoc-theme-hierarchy/dist/index.js --theme hierarchy

Thanks!

DiFuks commented 2 years ago

@kr1p70n1c You're right! I opened the issue https://github.com/DiFuks/typedoc-theme-hierarchy/issues/11

DiFuks commented 2 years ago

@kr1p70n1c fixed in 2.0.0

kr1p70n1c commented 2 years ago

@DiFuks thanks!