Background
In this post, we will cover how to embed GitLab’s code snippets on a web page.
GitLab
Snippet – Sharing – Embedding Code
Outline
Here are some of the options for sharing GitLab code snippets.
- HTML Script Block
Options
HTML Script Block
Outline
- Get Embed Code
- Use Embed Code
- Render HTML Page
Step – Get Embed Code
Please access the snippet. Capture the embed script.
In your HTML page, paste the embed code.
Step – Paste Embed Code
In your HTML page, paste the embed code.
Using the HTML Script tag, please reference the javascript file using the src attribute.
Syntax
Sample
Step – Render HTML Page
Using a web browser, please view the code.
Images
Image – Get Embed Code
Image – Paste Embed Code
Image – Review
WordPress
Unfortunately, WordPress does not directly support GitLab.
One needs plugins.
And, to use plugins in WordPress, one at least needs the Pro Version of WordPress.
WordPress Plugins
- PlugIns
- Luis A. Ochoa
- Links
- Get Snippets
Link
- Get Snippets
- Links
- Luis A. Ochoa
References
- GitLab
- Docs
- Snippets
Link
- Snippets
- Docs
Summary
As with all things in life, there is a lot of give and take in IT.