Skip to content

Keep code inside tabs as Markdown in agent-facing pages - #4196

Merged
matthewhelmke merged 1 commit into
mainfrom
docs-258-tab-notation
Oct 13, 2026
Merged

matthewhelmke merged 1 commit into
mainfrom
docs-258-tab-notation

Conversation

@matthewhelmke

Copy link
Copy Markdown
Collaborator

Summary

Code inside tabs reached the agent-facing .md copy of each page as HTML-escaped <pre> blocks instead of fenced code, so agents got &#34; and &lt; where commands have " and <. #4193 fixed this for every other shortcode. Tabs need a notation change, which the docs team approved in DOCS-258.

Why the notation changes

Hugo renders the body of a {{% %}} shortcode to HTML whenever it's nested inside another shortcode, before the inner template runs. Every {{% tab %}} sits inside {{< tabs >}}, so no tab.md template could ever receive Markdown.

Changes

  • All 79 tab calls on six pages switch from {{% tab %}} to {{< tab >}}. That's five Libraries pages and containers/building-and-modifying/adding-packages.md.
  • layouts/shortcodes/tab.html renders the panel's Markdown itself with .Page.RenderString.
  • layouts/shortcodes/tab.md drops the comment describing the old limitation.

Testing

Compared a full local build of main with a build of this branch:

  • HTML: the only differences on the six pages are each page's updated date and blank lines between elements. The rendered content is identical. Three tag-listing pages differ too, as they do between two builds of main.
  • .md copies of the six pages: 112 HTML <pre> blocks become fenced code blocks, and 182 escaped entities are gone. On libraries/java/migration, 29 <pre> blocks and 139 entities become clean fenced code.
  • llms-full.txt is unchanged, because it renders shortcodes with their HTML templates.

After merge

The wiki's Shortcodes page still tells writers to use {{% tab %}}. A wiki edit is ready that switches its example and rules to {{< tab >}}. It also adds a step to "How to add a new shortcode": create a .md template beside the .html one. It goes live after this merges, since the new notation only renders correctly once tab.html changes.


🤖 Generated with Claude Code

Hugo renders the body of a {{% %}} shortcode to HTML whenever it's
nested inside another shortcode, before the inner template runs.
Every {{% tab %}} sits inside {{< tabs >}}, so the .md copy of each
tabbed page got HTML-escaped <pre> blocks instead of fenced code.

Call tab with {{< >}} instead, so its body reaches the template as
Markdown, and have tab.html render that Markdown with RenderString.
The rendered HTML is unchanged apart from whitespace between
elements and the pages' updated dates. In the .md copies of the six
tabbed pages, 112 HTML <pre> blocks become fenced code and 182
escaped entities go away.

Refs DOCS-258

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@matthewhelmke
matthewhelmke requested a review from a team as a code owner October 13, 2026 14:42
@vercel

vercel Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
chainguard-docs-preview Ready Ready Preview Oct 13, 2026 2:43pm UTC

Request Review

@netlify

netlify Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for ornate-narwhal-088216 ready!

Name Link
🔨 Latest commit a901364
🔍 Latest deploy log https://app.netlify.com/projects/ornate-narwhal-088216/deploys/6ace436837ce8cfbe9c07352
😎 Deploy Preview https://deploy-preview-4196--ornate-narwhal-088216.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@matthewhelmke
matthewhelmke merged commit b8a48c0 into main Oct 13, 2026
15 checks passed
@matthewhelmke
matthewhelmke deleted the docs-258-tab-notation branch October 13, 2026 14:55

This branch was successfully deployed

1 active deployment
Preview — a901364c Deployed Oct 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants