GitLab:- Snippet Sharing

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.

  1. HTML Script Block

Options

HTML Script Block

Outline
  1. Get Embed Code
  2. Use Embed Code
  3. 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

  1. PlugIns
    • Luis A. Ochoa
      • Links

 

References

  1. GitLab
    • Docs

 

Summary

As with all things in life, there is a lot of give and take in IT.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s