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

[enhancement wish] common nav for all html pages #75

Closed
dcaillibaud opened this issue Jan 13, 2020 · 4 comments · Fixed by #95
Closed

[enhancement wish] common nav for all html pages #75

dcaillibaud opened this issue Jan 13, 2020 · 4 comments · Fixed by #95

Comments

@dcaillibaud
Copy link
Contributor

dcaillibaud commented Jan 13, 2020

Hi,

On a quite big js project, generated documentation is 1224 files of 2Mo each (2,3Go). It's because the

part has a weight of 1.9Mo.

Having only one <nav> content for all files could reduce a lot the total weight, here around 200 times less (1224×2000 vs 1900 + 1224×100, in my case from 2.3Go to ~125Mo).

It could be done with a frameset, or an ajax call to populate the nav bar in each html page (the nav.html will be in the browser cache after the first call).

Is such an enhancement can be put on the roadmap ?

BTW, thanks a lot for this great template.

@dcaillibaud
Copy link
Contributor Author

With some clues about how to achieve this I can try to make a PR.

@ar2rsawseen
Copy link
Collaborator

I guess the way to go about this would be

  1. Based on the config option, hide the nav side with search from layout file (https://github.com/clenemt/docdash/blob/master/tmpl/layout.tmpl) and adjust all other needed CSS tweaks if any
  2. create a new template with navigation and iframe and based on the same config, export it as main index file: https://github.com/clenemt/docdash/blob/master/publish.js#L706-L710
  3. based on the same config modify navigation building to call some js function that will change the source of iframe instead of going to another HTML page (https://github.com/clenemt/docdash/blob/master/publish.js#L428), you will probably have to wrap linkto function for that

I think that is bout it :)

@dcaillibaud
Copy link
Contributor Author

Thanks for these detailed clues.

I'll try to add a new config option "iframeNav" and handle it in templates. If it works as I want I'll make a PR.

@dcaillibaud
Copy link
Contributor Author

After a big delay I made it : #95

It's not an iframe, really easier fetching html code and add it directly in the page (included html should be in browser cache after the first page display)

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

Successfully merging a pull request may close this issue.

2 participants