Skip to content

docs: inline Pro badge on Pro-only section headings#192

Open
kilbot wants to merge 2 commits into
mainfrom
docs/pro-badge-headings
Open

docs: inline Pro badge on Pro-only section headings#192
kilbot wants to merge 2 commits into
mainfrom
docs/pro-badge-headings

Conversation

@kilbot
Copy link
Copy Markdown
Contributor

@kilbot kilbot commented May 18, 2026

Summary

  • Adds <span class="badge badge--primary">Pro</span> to Pro-only sub-section headings across versioned_docs/version-1.x/ (per the audit in Adopt inline 'Pro' badge on Pro-only section headings across the docs #189), so readers get a fast visual cue without scanning for a Pro Feature admonition.
  • Where a heading already carried a "(Pro)" parenthetical suffix, the suffix is dropped — the badge replaces it, matching the v1.9 refresh pattern (e.g. ## Coupon Codes <span class="badge badge--primary">Pro</span>).
  • Page titles on whole-page Pro features (customers/, orders/, reports/, stores/, coupons/, extensions/) are intentionally untouched — they keep their existing :::info Pro Feature admonition, no double-marking.
  • Applies the same edits across the i18n translated copies (ar, de, es, fr, hi-IN, it, ja, ko, pt-BR, zh-CN) where the heading exists — Docusaurus anchor IDs ({#anchor}) make the headings easy to identify regardless of translated heading text. Translations stale enough to be missing the section entirely are skipped (notably templates/index.mdx#pro-features and products/index.mdx#cost-of-goods-sold, neither of which has propagated to translations yet).

Files touched

English source (8 headings across 7 files):

  • versioned_docs/version-1.x/products/index.mdx### Cost of Goods Sold
  • versioned_docs/version-1.x/payment/index.mdx## Additional Payment Gateways
  • versioned_docs/version-1.x/pos/checkout/index.mdx### Additional Gateways, ## Coupon Codes
  • versioned_docs/version-1.x/settings/wp-admin/store-tax-ids.mdx## Per-store tax IDs
  • versioned_docs/version-1.x/getting-started/index.mdx## Pro Features
  • versioned_docs/version-1.x/templates/index.mdx## Pro Features
  • versioned_docs/version-1.x/extensions/polylang.mdx## Per-Store Language

Plus 33 translated files where the same anchors exist.

Test plan

  • pnpm build — succeeds across all 10 locales + default. Only warnings are the pre-existing vscode-languageserver-types critical-dependency warning and pre-existing broken anchors on /fr/templates/printer-setup + /de/templates/printer-setup (unrelated).
  • Spot-checked generated HTML — the badge renders as <span class="badge badge--primary">Pro</span> inside the <h2>/<h3> and also in the TOC sidebar entry (Infima badge--primary is the built-in Docusaurus class — no custom CSS needed).
  • Visual check in dev — could not open a browser from this environment. Worth confirming with pnpm start:
    • Badge sits on the same line as the heading text (not wrapped to a new line)
    • Mobile width: heading wraps cleanly when the line gets long
    • RTL (/ar/) rendering of the badge alongside Arabic heading text looks reasonable

Closes #189

Summary by CodeRabbit

  • Documentation
    • Updated docs to render visible “Pro” badges inline in headings (replacing plain “(Pro)” markers) for Pro-only sections (payments, checkout, products, reports, extensions, etc.).
    • Added/adjusted frontmatter to hide autogenerated page titles on several pages so custom Pro-badged headings display consistently.

Review Change Stack

Rolls out the `<span class="badge badge--primary">Pro</span>` marker
introduced in the v1.9 refresh to every Pro-only sub-section heading
across v1.x docs and i18n translated copies. Where headings carried a
" (Pro)" suffix, the suffix is dropped in favor of the badge.

Closes #189
@vercel
Copy link
Copy Markdown

vercel Bot commented May 18, 2026

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment May 18, 2026 6:06pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: wcpos/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: ae4259c0-ec98-4617-840d-450917c5e84c

📥 Commits

Reviewing files that changed from the base of the PR and between 0eeafce and 3b8954b.

📒 Files selected for processing (47)
  • i18n/ar/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/ar/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/ar/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/ar/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/de/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/de/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/de/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/de/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/fr/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/fr/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/fr/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/fr/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/hi-IN/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/hi-IN/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/hi-IN/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/hi-IN/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/it/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/it/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/it/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/it/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/ja/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/ja/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/ja/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/ja/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/ko/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/ko/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/ko/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/ko/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/pt-BR/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/pt-BR/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/pt-BR/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/pt-BR/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/zh-CN/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/zh-CN/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/zh-CN/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/zh-CN/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • versioned_docs/version-1.x/coupons/index.mdx
  • versioned_docs/version-1.x/customers/index.mdx
  • versioned_docs/version-1.x/extensions/index.mdx
  • versioned_docs/version-1.x/orders/index.mdx
  • versioned_docs/version-1.x/products/index.mdx
  • versioned_docs/version-1.x/reports/index.mdx
  • versioned_docs/version-1.x/stores/index.mdx
✅ Files skipped from review due to trivial changes (27)
  • versioned_docs/version-1.x/orders/index.mdx
  • i18n/de/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • versioned_docs/version-1.x/coupons/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/ja/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/hi-IN/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • versioned_docs/version-1.x/stores/index.mdx
  • i18n/de/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/ja/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/ko/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/zh-CN/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/zh-CN/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/version-1.x/orders/index.mdx
  • i18n/hi-IN/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/it/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/ja/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/ja/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • versioned_docs/version-1.x/extensions/index.mdx
  • i18n/zh-CN/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/hi-IN/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/ko/docusaurus-plugin-content-docs/version-1.x/customers/index.mdx
  • i18n/zh-CN/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/es/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/it/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx
  • i18n/ko/docusaurus-plugin-content-docs/version-1.x/products/index.mdx
  • i18n/ko/docusaurus-plugin-content-docs/version-1.x/reports/index.mdx

📝 Walkthrough

Walkthrough

Adds inline Pro badges to Pro-only section headings and sets/hides page titles (frontmatter hide_title: true) across localized and versioned MDX docs; all edits are documentation-only.

Changes

Documentation Pro Badge Standardization

Layer / File(s) Summary
All Pro badge and frontmatter edits
i18n/**/docusaurus-plugin-content-docs/version-1.x/**/*.mdx, versioned_docs/version-1.x/**/*.mdx
Add inline <span class="badge badge--primary">Pro</span> to Pro-only section headings and add hide_title: true where page titles are suppressed; localized and versioned copies updated consistently.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • wcpos/docs#145: Related edits to POS coupons documentation and Pro gating that overlap with checkout/coupon headings.
  • wcpos/docs#188: Prior work that introduced the inline Pro badge pattern on coupons and similar pages.

Poem

📘 Tiny Pro badges bloom on headings,
Blue pills guiding reader eyes,
"(Pro)" turned tidy, inline and neat,
Locales and versions harmonize,
Docs now wear their Pro surprise.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Out of Scope Changes check ⚠️ Warning The PR includes changes to whole-page Pro feature titles (customers, orders, reports, stores, coupons, extensions, products) with hide_title frontmatter and inline badges, which diverges from issue #189's explicit instruction to 'Leave the title alone' on whole-page Pro pages and keep only the admonition. Clarify whether adding hide_title and badges to whole-page Pro feature page titles aligns with the PR intent, or revert those changes to keep only the sub-section heading badges as specified in #189.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding inline Pro badges to Pro-only section headings throughout the documentation.
Linked Issues check ✅ Passed The PR implements the key requirements from #189: adds inline Pro badges to Pro-only sub-section headings, removes existing '(Pro)' suffixes, applies changes across versioned docs and i18n translations, and avoids badging whole-page Pro feature titles.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/pro-badge-headings

Comment @coderabbitai help to get the list of available commands and usage tips.

Applies the inline `<span class="badge badge--primary">Pro</span>` marker
to the page-level H1 of pages that are entirely Pro-only (customers,
orders, reports, stores, coupons, extensions, products). Uses the
`hide_title: true` frontmatter + explicit markdown H1 pattern so JSX can
be embedded in the title while preserving the frontmatter title for SEO,
sidebar, breadcrumbs, and `<title>` tag. Existing `:::info Pro Feature`
admonitions are kept — they still carry the Pro-license link.

Propagates the same change to all i18n translations of these pages where
they exist (uses the pro-license link as a translation-stable anchor to
locate the existing Pro admonition).

Refs #189
@kilbot
Copy link
Copy Markdown
Contributor Author

kilbot commented May 18, 2026

Follow-up commit 3b8954b adds the Pro badge to the page-level H1 on the seven whole-page Pro features (customers, orders, reports, stores, coupons, extensions, products) and their i18n translations.

Mechanism: hide_title: true in frontmatter + an explicit markdown H1 with the badge as the first content. Frontmatter title: is preserved (so SEO, sidebar, breadcrumbs, <title> tag, search index are unaffected) and the existing :::info Pro Feature admonitions stay (they still carry the Pro-license link).

Verified the rendered H1 in all 11 locales — example: <h1>Kunden <span class="badge badge--primary">Pro</span></h1>, <h1>顧客 <span class="badge badge--primary">Pro</span></h1>, <h1>العملاء <span class="badge badge--primary">Pro</span></h1>.

If the double-marking (badge on title + admonition right below) ends up looking heavy, easiest revert is to drop the admonition on those pages and rely on the badge alone — happy to do that as a follow-up if the visual is too loud.

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.

Adopt inline 'Pro' badge on Pro-only section headings across the docs

1 participant