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

[FEATURE REQUEST] Embed Github commit diff #24

Open
vighnesh153 opened this issue Jan 3, 2023 · 1 comment
Open

[FEATURE REQUEST] Embed Github commit diff #24

vighnesh153 opened this issue Jan 3, 2023 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@vighnesh153
Copy link

Thanks a ton for this amazing tool. 1 feature I feel would be a cherry on top, would be to have support for embedding commit diffs.

Feature requests

  • Support for embedding commit diffs
  • Support for embedding specific files from a commit with diff

For example, if you check this link: 6ffceea

It displays as displayed in the following image.
Screenshot 2023-01-03 at 10 11 54 PM

@yusanshi
Copy link
Owner

yusanshi commented Jan 4, 2023

Sounds a interesting feature.

I believe the usage of the feature could be:

  • embedding the whole commit diff: https://github.com/yusanshi/emgithub/commit/86f230a6bc37805b6186b355a41b075c123d97d9
  • embedding a specific file in that commit diff (by clicking the filename shown in the following image): https://github.com/yusanshi/emgithub/commit/86f230a6bc37805b6186b355a41b075c123d97d9#diff-36cec0a19fd4229769211afcfd94c3aad3e3a98882aa0f68cdf9e836b0cbc4f8

image

Also the PR can be included as they are quite the same logic. For exampe: https://github.com/yusanshi/emgithub/pull/22/files.

And surely the github.com=>emgithub.com for quickly jumping should still work for this feature.


However the implementation may not be easy. Currently all the three existing modes are implemented by fetching the contents from GitHub and rendering them ourselves. We need write our rendering code but this give us more freedom for customization (e.g., code hightlighting style).

image

But rendering the commit diff seems somewhat complicated. After some searching, I think we can:

  • use the third-party libraries, like diff2html.
  • or, embedd the official contents by iframe. But it seems to have lots of limitations and I'm not sure whether it works well.

But currently I may not have the time to implement this (Maybe after serveral months). Anyway I'll mark this as help-wanted.

@yusanshi yusanshi added the help wanted Extra attention is needed label Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants