SourceDocs

Documentation

Everything you need to go from "the docs are in the repo" to "the docs are on the page". Ten minutes, no server, no OAuth.

Getting started · File from Git · Private repositories · Diagram macro · Markdown macro · What Markdown is supported · OpenAPI · PDF export · Troubleshooting · Limits · Migrating from other apps · Release notes

Getting started

  1. Install SourceDocs from the Atlassian Marketplace (a Confluence admin does this once).
  2. Open a page, type /sourcedocs and pick one of the three macros: File from Git, Diagram, Markdown.
  3. For public repositories you are done. For private ones, an admin adds a read-only token under Settings → Apps → SourceDocs (see private repositories).

File from Git

Open the file in your Git provider's web UI and copy the address from the browser bar. Paste it into the macro. SourceDocs recognises these shapes:

ProviderLink
GitHubhttps://github.com/org/repo/blob/main/docs/arch.md
https://raw.githubusercontent.com/org/repo/main/docs/arch.md
https://github.com/org/repo (shows the README on the default branch)
GitLab.comhttps://gitlab.com/group/subgroup/repo/-/blob/main/docs/arch.md
Bitbucket Cloudhttps://bitbucket.org/workspace/repo/src/main/docs/arch.md
https://bitbucket.org/workspace/repo (README on the main branch)
Azure DevOpshttps://dev.azure.com/org/project/_git/repo?path=/docs/arch.md&version=GBmain
Without version the repository's default branch is used; GT (tag) and GC (commit) versions work too. https://dev.azure.com/org/project/_git/repo shows the README.
Your own serverGitLab self-managed or Dedicated: https://git.example.com/group/repo/-/blob/main/docs/arch.md
GitHub Enterprise Server or ghe.com: https://github.example.com/org/repo/blob/main/docs/arch.md
The server must first be added on the admin page; see Your own Git server.

The branch, tag or commit in the link is what gets shown. Point at main for "always current", at a tag for a frozen version. Branch names containing a slash (release/2.0, feature/login) work as well.

The file type decides the rendering:

Use Preview in the dialog to check the file before saving. On the page, the bar above the content shows the provider, path, branch and the time of the last fetch; Refresh fetches the latest version immediately (otherwise SourceDocs re-fetches at most every 10 minutes).

Private repositories

A Confluence administrator stores one read-only token per provider on the admin page: Confluence Settings → Apps → SourceDocs. Every macro on the site then uses it; page authors and readers do not need their own Git access. Readers see whatever the author embedded, so embed with the same care as pasting.

ProviderToken to create
GitHubFine-grained personal access token: Resource owner = your organisation, Repository access = only the repositories you embed, Permissions → Contents: Read-only. Classic tokens with the repo scope also work. Organisations with SSO must authorise the token for the organisation.
GitLab.comPersonal access token, or a group/project access token, with scope read_repository and role Guest or higher. A project access token is the tightest option.
Bitbucket CloudRepository access token (Repository settings → Access tokens) or workspace access token with Repositories: Read. An Atlassian API token with the read:repository:bitbucket scope also works: enter it as email:api_token. (Bitbucket app passwords no longer work.)
Azure DevOpsPersonal access token (User settings → Personal access tokens) with Code: Read, scoped to the organisation.

After saving, click Test. Without a file link the test asks the provider who the token belongs to; with a file link from a private repository it fetches that file. Tokens are never shown again and never leave Atlassian; see the security page.

Tokens expire. Put the expiry date in the token's label on the admin page; when macros start showing "Access denied", replace the token there.

Your own Git server

SourceDocs also reads files from GitLab and GitHub Enterprise running on your company's own server: GitLab self-managed and GitLab Dedicated, GitHub Enterprise Server and GitHub Enterprise Cloud with data residency (ghe.com). Bitbucket Data Center and Azure DevOps Server are not supported yet; write to [email protected] if you need them.

  1. On the admin page (Confluence Settings → Apps → SourceDocs), under Your own Git servers, choose the type and enter the server's address, for example https://git.example.com.
  2. Click Add server. Atlassian shows its own dialog naming the server; an Atlassian administrator approves it. Forge then lets SourceDocs reach that server and nothing else new. The approval can be reviewed or withdrawn in Atlassian administration under the app's data management, or by removing the server on the admin page.
  3. If the repositories are private, add a token for the server under Add or replace a credential (the same token types as GitLab.com and GitHub), then click Test with a file link from the server.

The server must be reachable from Atlassian's cloud over HTTPS with a publicly trusted certificate. If it is behind a firewall, allow Atlassian's outgoing IP addresses (the Forge platform uses them). Servers installed under a path (https://example.com/gitlab) are not supported yet. Up to 10 servers per site.

Diagram macro

Choose Mermaid or PlantUML, type on the left, watch the preview on the right. Insert example gives you a starting point for each diagram type. Ctrl+Enter saves.

On the page, hover a diagram for the toolbar: zoom out/in, reset, full screen, download SVG or PNG, copy source. "Fit diagrams to page width" shrinks wide diagrams to fit without clipping and never blows small ones up; turn it off to keep natural size with scrolling.

Markdown macro

Markdown written in the page with the same split editor. Useful for release notes, tables and checklists written by engineers who prefer text, and for pasting Markdown produced by AI assistants or CI without reformatting.

What Markdown is supported

OpenAPI and Swagger

Point the File from Git macro at an OpenAPI 3.0 or 3.1 document (YAML or JSON) or a Swagger 2.0 document. SourceDocs shows a three-column API reference: navigation by tag and operation, descriptions and parameters, request and response samples with schema details. Search is built in. There is deliberately no "Try it out": nothing is sent anywhere from the page.

PDF export

SourceDocs exports as real Confluence content, so PDF and Word files paginate like the rest of the page instead of printing a screenshot of the macro:

Badges and images hosted outside GitHub and GitLab appear in exports as links with their alt text.

Troubleshooting

MessageMeaning and fix
That link is not recognisedCopy the address of the file (not a folder or a search page) from the browser bar. Supported shapes are listed above.
File not foundWrong path or branch, or the repository is private and no token is stored. Check the link in the provider's UI; ask an admin to add a token.
Access deniedThe stored token is missing, expired, revoked, lacks read access to this repository, or (GitHub organisations with SSO) is not authorised for the organisation. Replace it on the admin page and click Test.
Rate limitingPublic GitHub files are read from GitHub's raw file host, which has no hourly limit for normal use. Public Bitbucket Cloud access without a token allows 60 requests per hour; add a token to raise it. The 10-minute cache keeps normal traffic far below these limits.
Diagram shows a syntax errorThe error text comes from Mermaid or PlantUML and names the line. Fix it in the editor; the preview updates as you type.
Image shown as a link with a picture iconThe image is hosted on a site outside the app's image allow-list. Move it into the repository (a relative path always works) or ask us at [email protected] to add the host.
PlantUML "cannot include"The included file could not be fetched: check the path, or add a credential if it is in a private repository. Includes from hosts other than GitHub, GitLab, Bitbucket, Azure DevOps and the servers added on the admin page are not supported.
"SourceDocs could not reach" a serverThe server is not reachable from Atlassian's cloud (firewall, private network, certificate not publicly trusted), or its approval was withdrawn. Check that it answers from the internet or allow Atlassian's outgoing IP addresses, then remove the server on the admin page and add it again.
Image missing (dashed box)The image path does not exist in the repository at that branch, or it is larger than 1 MB.

Limits

Migrating from other apps

Pages using other Markdown, Mermaid or PlantUML macros keep working; add SourceDocs macros alongside and remove the old ones when ready. Diagram sources are plain text in both: copy from the old macro's editor into the SourceDocs editor. If you have many pages, write to [email protected] and we will help plan the switch.

Release notes

VersionDateChanges
1.2October 2026Your own Git servers: GitLab self-managed and Dedicated, GitHub Enterprise Server and ghe.com, each added on the admin page and approved by an Atlassian administrator in Atlassian's own dialog.
1.1October 2026PlantUML diagrams written without @startuml. Cached files and export pictures are deleted automatically when they expire. PDF and Word export as native Confluence content (Markdown, OpenAPI, code) with embedded diagram pictures. PlantUML !include and C4-PlantUML; class, component, use case, state and C4 diagrams use PlantUML's built-in layout inside Confluence. GitHub alerts and YAML front matter in Markdown. Repository-root links for Bitbucket and Azure DevOps, Azure default branch, tags and commits, branch names with "/". Mermaid class diagrams with <<interface>> stereotypes. README banner images linked to GitHub file pages. Better contrast for API references in dark mode.
1.0October 2026Initial release. Mermaid 12.1 with ELK layout, PlantUML 1.2026.8, markdown-it 15, Redoc 2.5 (OpenAPI 3.0/3.1, Swagger 2.0), highlight.js 11.