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 in 3.8.2 (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 profile using a URL in the Markdown app using from a URLmacro.

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 used. Use 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



You can work with URLs in three two ways where you can:

  • Use

...

Anchor
md_URLProfile_absURL
md_URLProfile_absURL
Use an absolute URL

You can create a profile by providing the complete absolute URL for to access the Markdown content from a remote location.

  1. Navigate to CONFLUENCE ADMINISTRATION > General Configuration > BOB SWIFT CONFIGURATION > Markdown > Profiles.

  2. Click Add Profile.

  3. Enter BitURL a unique name for the profile in the Profile name text box.
  4. Select URL Select URL from the options in Profile type
  5. Enter  https://bitbucket.org/bob_swift/gint/raw/9c1b737cf0ff28ddf7cbbd199685e533d310ce9f/README.mdthe relevant absolute URL of the location to be accessed in the URL text box. 

  6. Click Save profile to create a Profileprofile.

Image Removed

...

Image Added


To use this profile in a Confluence page:

  1. Add the Markdown from a URL macro,

...

  1. or edit an existing macro on a page.
  2. Select the newly created profile from the Profile

...

  1.  drop-down, and click Save.

        

Anchor
md_URLProfile_partialURL
md_URLProfile_partialURL
Use a

...

partial URL

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

  1. Navigate to CONFLUENCE ADMINISTRATION > General Configuration > BOB SWIFT CONFIGURATION > Markdown > Profiles.

  2. Click Add Profile.

  3. Enter BitURL in the a unique name for the profile in Profile name text box.
  4. Select URL Select URL from the options in Profile type
  5. Enter https://bitbucket.orgthe base URL in the URL text boxA base URL is a part of the path that specifies the location that the macro must access.

  6. Click Save profile to create a Profileprofile.

Image RemovedImage Added        7. Select BitURL from the Profile list in the markdown-url

To use the profile in a Confluence page:

  1. Add the Markdown from a URL macro, or edit an existing macro on a page.
  2. Select the newly created profile in Profile in the macro editor. 

...

  1. Enter the relative path

...

  1. of the Markdown

...

  1. file in the URL to markdown file parameter.

...

  1. The relative URL is appended to the base URL specified in the profile to create an absolute path to the file to be rendered.
  2. Click Save.

        

...

Info
titlePoints to remember!
  • Only raw URLs must be given in either, the URL field in profiles or the URL to markdown file field in the macro.
  • It is recommended to specify absolute URLs to access files from public locations and to use profiles to access files from private sources. For example, a raw URL that can access a Markdown file in a public Bitbucket repository is valid. But to render a Markdown file located in a private repository, we recommend using a profile.
  • Profiles are a means to access and retrieve contents from external applications such as Bitbucket, GitLab or GitHub. A profile already contains the base URL and the required credentials (user credentials or an access token) to access the relevant application.
  • This method allows multiple users to access a profile across pages and instances of the
markdown-url macro. 

Skip creating a profile

You can skip creating a profile and provide the complete URL in the URL to markdown file parameter in the macro editor. 

  1. Enter https://bitbucket.org/bob_swift/gint/raw/9c1b737cf0ff28ddf7cbbd199685e533d310ce9f/README.md in the URL to markdown file.
  2. Click Save.

     Image Removed

  • macros.

Addition links