P
P
Pavel Mukhataev2022-01-12 14:51:24
Habr
Pavel Mukhataev, 2022-01-12 14:51:24

How to embed a file from github into an article on habré?

I want to write an article for habr. The source material (the project itself) is on github. I would not like to do copy-paste. I would like to insert a file or part of a file from github into an article. Does anyone know if there is such a possibility?
There is a similar question on stackoverflow - Can I embed source files from GitH... .
There are several services that provide similar functionality. A couple of services offer to embed a javascript object - for example https://gist-it.appspot.com/ .

It doesn't work here either - embedding a file from github via the script tag:



But I'm not sure that this will work on habr - there is no html support in the habr editor.

Another standard for embedding is oEmbed . But when embedding a file in the text via the media element https://www.onlinetool.io/gitoembed/ in the text, I see only the file name and the name of the provider in the editor, I don’t see the content of the file.
How does embedding a file look like here via onlinetool.io/gitoembed and the oembed tag:

https://www.onlinetool.io/gitoembed/widget?url=htt...


Does anyone know the correct way to embed the contents of a github file into an article on habr?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question