Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article walks you through the following topics:

Table of Contents

Creating snippets

To embed content directly from your repositories, perform the following steps:

  1. Create a snippet in your repository. The following are the repositories supported:

    1. Bitbucket Server (requires

...

    1. add-on Snippets for Bitbucket

...

    1. 3.1.0 or later)

...

    1. Image Added
    2. Bitbucket Cloud

      Image Modified


      To know more about snippets in Bitbucket, click here.

    3. GitHub Gist: To know more about how to create snippets in the GitHub Gist, click here.

      Image Modified
  1. Create a snippet using snippet macro.

Parameters

Parameter

Mandatory

Description

Snippet URL

Yes

Copy and paste the URL of the snippet you want to embed into confluence.

File

No

Specify the name of the file that you want to embed from the snippet. Leave the parameter blank to embed all the files of the snippet.

Snippet macro

Once you have created a snippet in the Bitbucket server, Bitbucket cloud, or GitHub gist, you can now add the snippet to your documentation.

To create a Snippet macro, Perform the following steps:

  1. Create a new page or go to Edit the page where you want to add the snippet.

  2. Type / or click the + icon.

  3. Select Snippet and Click Insert. The Insert 'Snippet' Macro window is displayed.

    Image Modified
  4. Enter the following details and click Insert.

    1. Snippet URL

    2. (Optional) File

Info

For more information, see Parameters.