embed-code-file icon indicating copy to clipboard operation
embed-code-file copied to clipboard

Support GitHub Permalink

Open MiracleXYZ opened this issue 3 years ago • 2 comments

Thanks for the awesome plug-in, it works really well.

It would be nice to directly support GitHub permalinks, for example

https://github.com/almariah/embed-code-file/blob/458b689efb769fd0787ac897a25864e48f45ec54/main.ts#L8-L23

Which is rendered in GitHub Issue web page as

https://github.com/almariah/embed-code-file/blob/458b689efb769fd0787ac897a25864e48f45ec54/main.ts#L8-L23

This link contains several key information:

  1. Code path. The real code path should be the corresponding githubusercontent link. You could also embed a file in a certain branch or commit as well.
  2. Code language. .ts means a TypeScript code file, no need to specify.
  3. Line numbers. The trailing #L<start>-L<end> represents the line numbers to be shown.

MiracleXYZ avatar Sep 11 '22 14:09 MiracleXYZ

@MiracleXYZ Thanks for your suggestion, I will work on it.

almariah avatar Sep 13 '22 05:09 almariah

Any progress on this? Would be awesome, especially when using with this new vscode feature https://code.visualstudio.com/updates/v1_77#_copy-github-deep-links-from-editor-gutter

gmkado avatar Apr 14 '23 18:04 gmkado