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
Azure DevOpshttps://dev.azure.com/org/project/_git/repo?path=/docs/arch.md&version=GBmain

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.

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. App passwords also work: enter them as username:app_password.
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.

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

Confluence's PDF export renders SourceDocs macros the way the page shows them: diagrams, Markdown and code appear in the PDF. For very long OpenAPI references the export shows the first part of the reference; link to the Confluence page for the full document.

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 access without a token allows 60 requests per hour per Atlassian region. Add a token to raise it; the 10-minute cache keeps normal traffic far below the limit.
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 support@sourcedocs.dev to add the host.
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 support@sourcedocs.dev and we will help plan the switch.

Release notes

VersionDateChanges
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.