Skip to main content

2 posts tagged with "xml"

View All Tags

How to Display JSON, XML, YAML & Code in Confluence (With Syntax Highlighting)

· 10 min read
Who should read this
  • Developer teams documenting APIs, configs, and schemas in Confluence
  • Tech writers who need formatted code samples alongside prose
  • Anyone pasting JSON, XML, YAML, or SQL into Confluence and getting an unreadable wall of text
What you'll learn
  1. Why Confluence's built-in code block struggles with JSON, XML, and config files
  2. How to embed syntax-highlighted code in 85+ languages using a Monaco-powered editor
  3. Theme configuration, diff views, and screenshot-ready window chrome
  4. When to use a code block vs. a visual JSON structure diagram

The scenario every engineering team hits: you're documenting an API in Confluence, and the page needs to show a JSON response, an XML config, a YAML deployment manifest, and a SQL query — all on the same page. You paste each one into Confluence's built-in code block macro, publish, and the result is a wall of monochrome text. No syntax colors. No line numbers that work. JSON braces, XML tags, and YAML indentation all blur together. The reader has to copy-paste your snippet into VS Code just to understand it.

The root problem is that Confluence's native code block uses a basic highlighter that wasn't built for the structured data formats modern teams actually work with. JSON, XML, YAML, and SQL each have specific visual conventions — matched braces, nested tags, indentation scopes — that a generic highlighter doesn't handle well.

Modern Code Blocks for Confluence solves this by bringing the Monaco Editor — the same engine that powers VS Code — into Confluence. It accurately highlights 85+ languages including JSON, XML, YAML, SQL, GraphQL, Terraform, Dockerfile, and every mainstream programming language. This guide walks through embedding formatted code and data formats in your Confluence pages.

How to Edit the Confluence Storage Format (And When You'd Need To)

· 7 min read
Who should read this
  • Confluence admins fixing broken pages, macros, or corrupted formatting
  • Developers migrating or bulk-editing page content via the storage format
  • Power users who need find-and-replace across a page's underlying XML
What you'll learn
  1. What the Confluence storage format is and why you'd edit it directly
  2. How to open the raw XML of a page and make safe changes
  3. Formatting, find-and-replace, and diffing changes before saving
  4. When editing storage format is the right tool (and when it isn't)

Most Confluence users never see it, but every page is stored as an XML document in Confluence's storage format — a specific XHTML dialect with custom tags for macros, layouts, and embeddings. The visual editor hides this. But sometimes the only way to fix a problem is to edit that XML directly: a macro is corrupted and won't render, a copy-paste introduced broken formatting, or you need to find-and-replace a URL across a long page that the visual editor can't reach.

Confluence exposes the storage format through its REST API, but there's no built-in visual editor for it. Raw Storage Source Editor for Confluence adds one — a Monaco-powered editor that opens the raw storage XML of any page, with format, find-and-replace, and (in the Pro edition) a diff view. This guide covers when and how to use it safely.