Comments (5)
Ok I think I got it.
I do not think removing any files by default it a good idea since some people might want to see them.
Still I can see two solutions for your problem. The quickest is excluding the files you want in the diff like this git diff -- . ':(exclude)package-lock.json' | diff2html -i stdin
. The other would be like you described collapsing files with a lot of lines changed and that would be a nice feature.
If you think you would be willing to implement the second here are some ideas:
- First you could tag the huge files with some class in here https://github.com/rtfpessoa/diff2html/blob/master/src/templates/line-by-line-file-diff.mustache and here https://github.com/rtfpessoa/diff2html/blob/master/src/templates/side-by-side-file-diff.mustache
- Then you could do some JS like this https://github.com/rtfpessoa/diff2html/blob/master/src/ui/js/diff2html-ui.js#L52 to hide them.
- To finish add a button to open the file close to the initial class.
from diff2html-cli.
It would be great to collapse huge files, and only load them on user click
diff2html
can hang for minutes for files which are over 10k lines
from diff2html-cli.
Any PRs are welcome.
from diff2html-cli.
This project uses yarn so instead of npm install
you should do yarn
.
Still if you want to ignore that file feel free to send a PR.
from diff2html-cli.
Thank you for the quick response. Sorry if I've described the scenario poorly.
When using diff2thtml-cli on (for example) an Angular project where package.json was recently updated and npm install
was run, diff2html-cli correctly shows the diff between the old and the updated package-lock.json files.
The problem arises that it's a large file with changes that are useless to (I assume pretty much) any developer. If it was collapsed by default in the HTML view that would be great (but that would require extra functionality to be added to the diff2html-cli & it would still slow down the experience - having to write and possibly render all the contents). The other option is that diff2html-cli simply ignores the file when creating the html diff view.
I am open to creating a PR to implement this feature (provided I find enough time and figure out how to do it). I certainly would want to confirm with you before working on this (fore me) time-consuming task that it would be a welcome improvement to the diff2html-cli rather than an unacceptable change.
Cheers!
from diff2html-cli.
Related Issues (20)
- ignore.map is not a function HOT 2
- -M flag exists? HOT 1
- Dependency update? HOT 3
- Unescaped broken HTML in the output HOT 6
- Selecting an output file is not overriding the preview open HOT 1
- ENOBUFS error when comparing large commits HOT 3
- Cannot make to work API from imported library HOT 9
- "--ig" argument leads to git diff error HOT 7
- diff2html is missing file content toggle HOT 1
- --title option not working HOT 2
- miss-align when show some diff file HOT 4
- Still running out of heap memory while allowing node 60GB HOT 4
- '--renderNothingWhenEmpty' didn't work when using 'stdin' as input HOT 1
- Impossible to create a diff from file – 5.2.6
- Can't run diff2html-cli on linux docker container HOT 1
- Cannot see diff on specials characters (eg ^M) HOT 1
- Not able to run diff2html-cli on both windows and wsl HOT 4
- feature: add colorScheme arg
- Feature request: line anchor
- The stack overflow exception is displayed when the file exceeds 14M
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from diff2html-cli.