Description
This article illustrates how to create a profile in the Markdown macros using a URL.
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.
- 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. The process for adding a profile and using it in macros remains the same for other repositories and external sources.
There are three ways to work with URLs where you can use:
- An absolute URL in a profile
- A partial URL in a profile
- An absolute URL directly instead of via a profile
Using an absolute URL in a profile
You can create a profile by providing the complete URL for the Markdown content.
Navigate to CONFLUENCE ADMINISTRATION > Settings > ATLASSIAN MARKETPLACE > Markdown Configuration > Profiles.
Click Add Profile.
- Enter a unique name for the profile in the Profile name text box. For this example, enter BitURL in the text box.
- Select URL from the options in Profile type.
Enter https://bitbucket.org/bob_swift/gint/raw/9c1b737cf0ff28ddf7cbbd199685e533d310ce9f/README.md in the URL text box.
Click Save profile to create the profile.
To use this profile in a Confluence page:
- Search for the Markdown from a URL macro and edit it.
- Select BitURL from the Profile list and then, click Save.
Using a partial URL in a profile
You can create a profile by providing a partial URL for the Markdown content and entering relative path to the Markdown file in the markdown-url macro.
Navigate to CONFLUENCE ADMINISTRATION > Settings > ATLASSIAN MARKETPLACE > Markdown Configuration > Profiles.
Click Add Profile.
- Enter a unique name for the profile in the Profile name text box. For this example, enter BitURL in the text box.
- Select URL from the options in Profile type.
Enter https://bitbucket.org in the URL text box.
Click Save profile to create the profile.
To use this profile in a Confluence page:
- Search for the markdown-url macro and edit it.
- Select BitURL from the Profile list in the editor.
- Enter the relative path to the /bob_swift/gint/raw/9c1b737cf0ff28ddf7cbbd199685e533d310ce9f/README.md Markdown file in the URL to markdown file parameter.
- Click Save.
This method allows multiple users to access a profile across pages and instances of the markdown-url macro.
Using an absolute URL directly
You can skip creating a profile and enter the absolute URL in the URL to markdown file parameter.
- In a Confluence page, search for the Markdown from a URL macro and edit it.
- Enter https://bitbucket.org/bob_swift/gint/raw/9c1b737cf0ff28ddf7cbbd199685e533d310ce9f/README.md in the the URL to markdown file parameter.
- Click Save.