-
Notifications
You must be signed in to change notification settings - Fork 282
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
Allow files to be collapsable #92
Comments
I am up for any contributions regarding this. |
@adamjimenez it looks good. Maybe we could have an HTML version without the file summary and where all the files are collapsed. |
Yes, that would be good. And if there is only one file then default it to expanded. |
For starters, it could be possible to collapse the body of the diffs by clicking on its headers. This should be easy and can be achieved with jQuery. I currently do this with the following code: function makePanesCollapsible() {
const fileWrappers = $('.d2h-file-wrapper');
$.each(fileWrappers, (idx, element) => {
const header = $(element).children('.d2h-file-header');
const body = $(element).children('.d2h-files-diff');
header.click(() => {
body.slideToggle();
})
});
} If this seems reasonable I can work on it. |
@samiraguiar actually it should not be hard. It is even possible with CSS. I guess the hardest part is making it look good and usable. If you have some time, maybe doing something like GitHub has would be easy. I am always open for new PRs 😄 |
If we do this, then files that are |
@alamothe can you extend a bit on what you mean? Sorry, I am not familiar with |
This article explains it https://help.github.com/en/github/administering-a-repository/customizing-how-changed-files-appear-on-github Basically, if you have |
@alamothe I think I see what you meant. It could probably be done in https://github.com/rtfpessoa/diff2html-cli since it can have access to the filesystem, but for diff2html it would have to be manually passed. |
Allow files to be collapsible.
Ideally this could be just CSS to avoid Javascript usage.
We could then allow an option to choose if the files start open or collapsed.
If enabled then the diffs will start as collapsed when there is more than one file.
You would then be able to click the header to toggle the collapse state of the different files.
The text was updated successfully, but these errors were encountered: