Can I share an entire Git project through Gist?

I am writing a tutorial for users of our API and want, for example, to include code snippets and complete files. I can expose the whole directory structure like git to load people; no problem. But I would like to embed the specific code on the corresponding pages as I can, using the entity.

I do this by copying each file to gist, pressing "embed" and copying the resulting link to my training page.

However, it seems wasteful to have a git repository configured with full files, and then duplicate it for each file. Is there a better way to do this?

(Alternatively, if there is a way to insert a link to a specific file from git, I could do it too), it will say here: β€œHere is a complete sample of the file,” so I would pull it that way well.)

Thanks.

+6
source share
2 answers

There is http://gist-it.appspot.com/

GitHub has this on its β€œlist”, but we do not know when this will happen.

+3
source

It seems that embedding any file, not just from gists, is what GitHub plans, but not yet completed:

However, you can do something similar by downloading files dynamically from the "raw" links on GitHub and using SyntaxHighlighter to make them beautiful.

+2
source

Source: https://habr.com/ru/post/888153/


All Articles