Versions Compared

Key

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


Warning
titleRemoval notice (applicable for Markdown from a URL macro):

Please note that the URL user and URL user password parameters were removed (see Deprecation notice: URL user and URL user password parameters). We recommend using profiles to access external data.

Description

This article illustrates how to create a profile in the Markdown macros from a URL macro using a URL. 

Info

Before you begin:

  • Before you enter the URL for a repository, ensure that it

    complies with the REST standards published by GitHub or GitLab.
  • Click here for more information on REST Pattern for GitLab.
  • Click here for more information on REST Pattern for GitHub

    is a raw URL.
    A raw URL is defined as the part of the URL following the domain information and includes the query string, if present. For example, in the URL string http://www.contoso.com/articles/recent.aspx, the raw URL is /articles/recent.aspx

    Tip
    titleHow to identify if a file is valid for the macro?

    Paste the file link into your browser's address bar. If the actual code is displayed in the browser, it is considered to be invalid or in an incorrect format. If the file downloads to your system, the macro can process the file and its contents.


  • Know what is a complete URL.
    • A typical path for the raw file on GitLab looks like:
    • /projects/:id/repository/files/:file_path/raw
    • Since the host address begins with:
    • https://gitlab.com/api/v4
    • The complete URL, in this example, looks like: 

    • https://gitlab.com/api/v4/projects/:id/repository/files/:file_path/raw?ref=master

  • For illustrative purposes,

    we have used

    a public Bitbucket public repository is usedUse URLs to add to profiles and in macros as per your requirement and your instance. The process for adding a profile and using it in macros remains the same for other repositories and external sources. 

    Note
    titleFor private Bitbucket repositories (from third party applications):

    Use the following URL path to connect to a private Bitbucket repository if logging in from third party applications such as Google:

    https://api.bitbucket.org/2.0/repositories/$workspace/$repo/src/$commit/$filepath

    The path to be specified in the URL parameter of a profile looks like the following example:

    https://api.bitbucket.org/2.0/repositories/appfire/ac-app-dist/src/17f199444d1386c543ac642e9155b396aaeca403/README.md


There are three ways to work with URLs where you can use:

Anchor
MD_Cld_HowTo_CompleteURL
MD_Cld_HowTo_CompleteURL
Using

...

an absolute URL in a profile

You can create a profile by providing the complete URL for the Markdown content.

  1. Navigate to CONFLUENCE ADMINISTRATION > Settings > ATLASSIAN MARKETPLACE > Markdown Configuration > Profiles.

  2. Click Add Profile.

  3. Enter a unique name for the profile in the Profile name text box. For this example, enter BitURL in the text box.Select URL
  4. Select URL from the options in Profile type
  5. Enter the complete path of the required Markdown file (for example: https://bitbucket.org/bob_swift/gint/raw/9c1b737cf0ff28ddf7cbbd199685e533d310ce9f/README.md) in the URL text box. 

  6. Click Save profile to create the profile.

To use this profile in a Confluence page:

  1. Search for Select the required Markdown from a URL macro and edit it.
  2. Select BitURL from  the profile with the absolute path of the Markdown file from the Profile list and then, click Save.

        

Anchor
MD_Cld_HowTo_FixedURL
MD_Cld_HowTo_FixedURL
Using a

...

partial URL in a profile

You can create a profile by providing a fixed partial URL for the Markdown content and enter the entering relative path to the Markdown file in the markdown-url macro Markdown from a URL macro.

  1. Navigate to CONFLUENCE ADMINISTRATION > Settings > ATLASSIAN MARKETPLACE > Markdown Configuration > Profiles.

  2. Click Add Profile.

  3. Enter a unique name for the profile in the Profile name text box. For this example, enter BitURL in the text box.
  4. Select URL Select URL from the options in Profile type
  5. Enter the base URL (for example: https://bitbucket.org) in the URL text box.

  6. Click Save profile to create the profile.

...

To use this profile in a Confluence page:

  1. Search for the markdown-url macro Select the required Markdown from a URL macro and edit it.
  2. Select BitURL from Select the profile with the base URL of the required Markdown file from the Profile list in the editor.
  3. Enter the relative path to the Markdown file (for example: /bob_swift/gint/raw/9c1b737cf0ff28ddf7cbbd199685e533d310ce9f/README.md Markdown file in ) in the URL to markdown file parameter.
  4. Click Save.

...

  1. In a Confluence page, search for the Markdown from a URL macro and edit it.
  2. Enter the complete path of the required Markdown file (for example: https://bitbucket.org/bob_swift/gint/raw/9c1b737cf0ff28ddf7cbbd199685e533d310ce9f/README.md) in the the URL to markdown file parameter.
  3. Click Save.

...