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

Reducing html size #205

Closed
d7919 opened this issue Apr 12, 2017 · 6 comments
Closed

Reducing html size #205

d7919 opened this issue Apr 12, 2017 · 6 comments

Comments

@d7919
Copy link
Contributor

d7919 commented Apr 12, 2017

Firstly this isn't really a bug but more of an enhance request (or discussion).

I noticed that even when generating very plain documentation (no search or graphs) the generated documentation was still using quite a lot of disk space (A couple of orders of magnitude larger than the source files on their own). In my case (and most cases I would guess) usage is dominated by the per procedure files (html/proc). Looking at these files I noticed that there was a large chunk of common code in each file -- the biggest section corresponding to the "all procedures" collapsible list (<div id="allprocs-0"....>). In fact when comparing a couple of randomly selected files it seems that only a few percent of the html actually differs.

As jQuery is currently included in all files it should be possible to use something like http://stackoverflow.com/a/9003363 (and the related, more flexible http://stackoverflow.com/a/31837264) to move a large portion of the generic repeated code into a single file which is then "included" within each relevant file. (Side note : The allprocs list actually appears twice in the html code, once for wide screens and once for narrow -- using the "load" approach would allow this repetition to be avoided.)

This has the potential to drastically reduce the amount of disk space required (which might also bring a benefit in terms of time taken to write out the html in the document generation phase). As described it probably won't change the amount of data being transferred when viewing the generated page in a browser (it may be possible to change this if we could get the load to trigger only when the list is expanded for the first time).

The main downside with this approach, as far as I can see, is that this doesn't work when opening the files locally in certain browsers (at least chrome). This is related to this question with suggested workarounds including open in firefox or use Python's SimpleHTTPServer module to create a small server that can be used to browse the docs.

If this sounds like something useful then I would imagine it might be helpful to introduce a flag to choose either the current behaviour or the "load" behaviour, in order to allow people to still view the documentation locally without any extra steps if they want.

@zerothi
Copy link
Contributor

zerothi commented Jun 9, 2017

I agree, I cannot use Ford because of the large diskspace usage due to limitations on remote hosting portals.

@szaghi
Copy link
Member

szaghi commented Jun 10, 2017

Dear @d7919,

I agree to have this light-mode as a user option, but I would not like to break the possibility to easy view the documentation locally: we rely on local documentation a lot.

I think that the trend is that disk space will be not the bottleneck in the future (cloud storage will be more and more gorgeous). Also the speed connection is increasing: the light-mode could help in situation where remote hosting has limited space like the case of @zerothi , but the breaking of easy local view could impact on more cases.

My best regards.

@zerothi
Copy link
Contributor

zerothi commented Jun 10, 2017

@szaghi oh I agree, having the possibility of creating local documentation is far too important.

@cmacmackin
Copy link
Contributor

I'm considering simply getting rid of the "all procedures"/"all modules"/"all files"/etc. lists. I can't imagine anyone would use them much when the (more informative) list pages are one click a way with the navbar and they are unnecessarily huge.

@zbeekman
Copy link
Member

An option to enable/disable the "all files" etc. lists could be a good compromise.

@cmacmackin
Copy link
Contributor

I decided to just get rid of the "all procedures", "all modules", etc. list. I don't think they're actually very useful and it was easier to do that than to add a switch to the project file. That will be in the next release and should help reduce the size of the the output.

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

No branches or pull requests

5 participants