Skip to main content
Confluence Solution

Show code, JSON, and API docs in Confluence

Confluence’s basic code macro is not enough for technical content. Learn how to present code, JSON, and OpenAPI specs so readers actually get it.

Browse all apps
Why it matters

Why this matters in Confluence

Confluence is where engineering teams share code snippets, API contracts, payload examples, and runbooks. The built-in code macro is plain and error-prone, raw JSON pasted into a page is unreadable at any real scale, and an OpenAPI spec dropped in as text is a wall of YAML that nobody navigates. The result is that technical content either gets under-documented or pushed out to a separate tool, fragmenting the knowledge base so that the wiki and the code drift apart within weeks.

Code deserves real syntax highlighting

A wall of uncoloured code hides typos, missed brackets, and wrong keywords, and it slows every reader who has to parse it. Proper highlighting, a choice of themes, line numbers, and a one-click copy button turn a snippet into something the team can actually paste into a terminal or review the way they would in their editor. The difference is not cosmetic — it is the difference between a snippet that gets used and one that gets ignored.

JSON is structure, not prose

Nested JSON inside a code block forces readers to scroll and count braces to find the field they care about. A collapsible tree view turns a payload into something a reader can expand, collapse, and search in seconds — drilling into the one nested object that matters without losing their place. For request and response examples, this is what makes the difference between a payload that explains itself and one that intimidates.

API docs are content, not a separate site

OpenAPI and Swagger specs describe exactly how systems talk, but most teams host them on a standalone portal that drifts from the wiki. Embedding the spec as interactive documentation — expandable endpoints, parameters, schemas, and examples — keeps the internal API docs next to the code that consumes them, so a change to either is visible in the same place at the same time.

Language coverage has to be real

The built-in code macro supports a limited set of languages and lags far behind what engineers actually write — Terraform, modern TypeScript, Rust, and newer config formats are often missing or mis-highlighted. A code block built on a real editor engine like Monaco (the same one VS Code uses) covers 80+ languages and keeps up with new ones, so a snippet always renders correctly instead of falling back to plain text.

Specs go stale when they are screenshots

A pasted image of an API endpoint or a copied YAML blob goes stale the moment the service ships a new version. A spec rendered live from its source — or re-pasted and re-rendered on each release — stays honest, and the reader can trust that what they are reading reflects the current state of the system rather than a snapshot from last quarter.

How to solve it

The approach that works

The pattern for technical content in Confluence is to render it natively rather than paste it as text or images: use a real syntax-highlighting code block, visualise structured data with a tree viewer, and embed API specs as live, navigable documentation. Each step below covers a content type, when to use it, and how to keep it from drifting away from the source it describes.

  1. 1

    Use a real code block, not the built-in macro

    Replace the built-in code macro with a syntax-highlighting code block that supports your languages, offers light and dark themes, follows the reader's colour scheme, and has a copy button. Use it for every snippet longer than a couple of lines — shell commands, configuration, SQL, Terraform, and inline examples in runbooks — because the copy button alone saves readers a select-and-copy dance on every block.

  2. 2

    Visualise JSON and nested data as a tree

    For nested JSON, XML, or YAML, paste the payload into a structure viewer so readers can expand and collapse nodes instead of scanning formatted text. Use this whenever the structure is more than two levels deep or whenever a reader will need to find one specific field — request and response bodies, config dumps, and webhook payloads all qualify.

  3. 3

    Embed OpenAPI and Swagger specs interactively

    Paste your OpenAPI or Swagger spec into an interactive viewer so endpoints, parameters, request bodies, response schemas, and examples render as navigable docs. Use this for any internal API page that engineers will reference repeatedly; it turns a static spec file into a documentation surface that supports lookups, not just reading.

  4. 4

    Pick the right view for the audience

    Engineers often want the raw source so they can copy it; product and support readers want the rendered, expanded view so they can understand it. Good tooling offers both — a collapsible tree with a toggle back to raw text, or a rendered API page with a link to the underlying YAML — so one piece of content serves both audiences without maintaining two copies.

  5. 5

    Link the page to its source of truth

    Keep the snippet, payload, or spec versioned somewhere it can be regenerated — a repo, a CI artifact, or an API gateway export — and link the Confluence page to it so docs never silently diverge. The page is for explanation and context; the source is for authority. When they disagree, the link tells the reader which one wins.

  6. 6

    Refresh on a cadence, not on memory

    Specs and example payloads rot if nobody owns them. Tie the refresh to the release cycle — re-paste the spec when a new version ships, or re-export the example payload after a schema migration — and note the version or date inline so a reader can tell at a glance whether the page is current. A small dating convention is what separates living docs from an archive of the past.

Who this is for

This solution is for you if…

  • Engineering teams sharing code snippets, configs, and request payloads
  • API and platform teams documenting endpoints, schemas, and integration contracts
  • QA and DevOps teams writing runbooks, postmortems, and incident guides
  • Developer relations and partner teams publishing internal API documentation
  • Backend and data teams documenting event payloads, schemas, and migration scripts
What we have

Our apps that solve this

Every app is free for up to 10 users on the Atlassian Marketplace. Pick the one that fits your workflow, or combine them.

Confluence

Modern Code Blocks for Confluence

Syntax-highlighted code blocks with 85+ languages, auto theme sync, and a live preview editor for Confluence pages

Confluence

Modern OpenAPI (Swagger) Integration for Confluence

Render OpenAPI and Swagger specifications directly on Confluence pages with an interactive, theme-aware viewer

FAQ

Frequently asked questions

Confluence's built-in code macro is basic and does not handle deeply nested data well. Use a code-block app powered by the Monaco editor (the same engine as VS Code) to render JSON, XML, YAML, SQL, and 80+ more languages with proper highlighting, themes, line numbers, and a copy button. For deeply nested payloads, a structure viewer turns the same JSON into a collapsible tree that readers can navigate instead of scroll.

Why NGPILOT

Why teams choose NGPILOT

Free for up to 10 users

Every app is free for small teams, with the full trial Atlassian provides for larger ones.

Native Forge apps

Built on Atlassian Forge, running entirely on Atlassian Cloud infrastructure.

Your data stays in your instance

No content is sent to our servers — processing happens inside your Confluence or Jira.

Verified Marketplace vendor

NGPILOT apps are listed, reviewed, and maintained on the Atlassian Marketplace.

Ready to try it?

Every app is free for up to 10 users. Install in a couple of clicks.