020.10 c
Description: Describes git gists that can handle small snippets of code. They're also easy to share..
#000#IT_Knowledge#020#Operation_Knowledge#020.10#Git#020.10 c#git_gist
Centralized management of code snippets through gist
Audience
Who want to requires centralized management of code or images.
Overview
In my case, the shared code changes for projects #1 to #5 articles, it must be manually updated for each, which is inconvenient. Therefore, a change to a centralized management system is necessary.
The main content addresses troubleshooting implemented through Markdown
Content
Troubleshooting:
- Implementation is in the md (markdown) file.
- First attempt: Created a gist and copied the link -> Failed because the usage was different. Looked up how others used it.
- Second attempt: Used a script tag -> Failed because it didn't display at all. Tried different elements.
- Third attempt: Used iframe -> Failed due to CORS and related server-side security policies.
- Fourth attempt: Changed the extension to pibb in the existing format -> Success. This method seems to work with a specific extension, though detailed explanations are hard to find. Mentioned in a user-created GitHub cheatsheet.
Additionally, modifying the ?file=filename attribute can display only specific files from the gist.
Conclusion
Using the Pibb extension, a gist can be implemented in a Markdown script and an iframe element.
<iframe src="https://gist.github.com/murphybread/a0a351e489cde4b2064fcd3a7855d885.pibb?file=automation.py" width="100%" height="300"></iframe>