Add shortcodes to mark UI text

The Docs flag UI text by using bold, which is ambiguous: the same markup is also used for emphasis and for UI text from other products. Translation tooling looks up UI text in locale/gitlab.pot to reuse the translated product string, and can't tell which bold text is a real GitLab label.

What this adds

  • Two shortcodes that marks GitLab UI text: {{< ui text=" " >}} and {{< external-ui text=" " >}}. They render as <strong>, so the output is identical to the **Bold** markup it replaces.
  • Test cases in content/shortcode-tests.md covering various cases, including scoped UI text.

Usage:

1. On the left sidebar, select {{< ui text="Search or go to" >}} and find your project.
1. Select {{< ui text="Settings" >}} > {{< ui text="CI/CD" >}}.

A missing value fails the build with an actionable message, through the existing validate-shortcode.html partial:

ERROR Missing required parameter 'text' for ui shortcode. (File: content/example.md, Line: 5)

Paired merge request

The content that exercises the shortcode, plus the gitlab.pot check that ensures docs and UI text stay in sync, is in Mark UI text with shortcodes and validate it ag... (gitlab-org/gitlab!253587 - merged)

Edited by Marcel Amirault

Merge request reports

Loading
Loading