yusanshi / emgithub

Embed a file from GitHub repository just like GitHub Gist.
https://emgithub.com
MIT License
404 stars 77 forks source link

[FEATURE REQUEST] Embed Github commit diff #24

Open vighnesh153 opened 1 year ago

vighnesh153 commented 1 year ago

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

For example, if you check this link: https://github.com/yusanshi/emgithub/commit/6ffceea50ef2ea89916dc066f365c211a5ea367f

It displays as displayed in the following image.

Screenshot 2023-01-03 at 10 11 54 PM
yusanshi commented 1 year ago

Sounds a interesting feature.

I believe the usage of the feature could be:

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:


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