GitHub links

Writing informative technical Confluence documentation with GitHub data

Embedding live GitHub data in your technical documentation keeps content accurate, reduces duplication, and lets readers see code, context, and status without leaving Confluence.

Source files and README embedding

Include source code, configuration files, or README files directly in your documentation. Content refreshes live from GitHub on each page load. Paste any file URL:

https://github.com/{owner}/{repo}/blob/{branch}/{path/to/file}

Toggle Show extended information in the macro config to display the file expanded by default.

image-20260622-235037.png

Embedding a specific line range

To highlight a particular function or configuration block, append a line range to the URL:

https://github.com/{owner}/{repo}/blob/{branch}/{path/to/file}#L12-L28

The macro displays only those lines with a label showing the range. See Linking Source File Segments for full details.

image-20260622-235118.png

Gists

For short, self-contained code snippets that do not belong in a full repository, use a GitHub Gist:

https://gist.github.com/{user}/{gist-id}

Gists also support line ranges (#L5-L12). Toggle Show extended information to display expanded by default.

image-20260623-000056.png

Commits

Reference a specific commit to document a precise change or fix:

https://github.com/{owner}/{repo}/commit/{sha}
image-20260622-235832.png

To embed a full commit history for a branch:

https://github.com/{owner}/{repo}/commits/{branch}
image-20260622-235859.png

Compare view

Embed a branch or tag comparison to show what changed between two points in a codebase. Useful in release notes, ADRs, or migration guides:

https://github.com/{owner}/{repo}/compare/{base}...{head}
image-20260622-235758.png

Discussions

Link to a GitHub Discussion to embed Q&A threads, RFCs, or decision logs directly in your documentation:

https://github.com/{owner}/{repo}/discussions/{number}
image-20260623-001530.png

Embed a list of discussions in a specific category (e.g. RFC or Design):

https://github.com/{owner}/{repo}/discussions?discussions_q=category:{category}
image-20260623-001946.png

Discussions require the Discussions (read) GitHub App permission. See Working with Discussions.


Updated: