diff --git a/components/article/ToolPicker.tsx b/components/article/ToolPicker.tsx index 315a71e3316d..d5dc57d2da74 100644 --- a/components/article/ToolPicker.tsx +++ b/components/article/ToolPicker.tsx @@ -11,7 +11,16 @@ import { useArticleContext } from 'components/context/ArticleContext' // Nota bene: tool === application // Nota bene: picker === switcher -const supportedTools = ['cli', 'desktop', 'webui', 'curl', 'codespaces', 'vscode'] +const supportedTools = [ + 'cli', + 'desktop', + 'webui', + 'curl', + 'codespaces', + 'vscode', + 'importer_cli', + 'graphql', +] const toolTitles = { webui: 'Web browser', cli: 'GitHub CLI', @@ -19,6 +28,8 @@ const toolTitles = { desktop: 'Desktop', codespaces: 'Codespaces', vscode: 'Visual Studio Code', + importer_cli: 'GitHub Enterprise Importer CLI', + graphql: 'GraphQL API', } as Record // Imperatively modify article content to show only the selected tool diff --git a/content/README.md b/content/README.md index 62b07799c037..1f37f95462bb 100644 --- a/content/README.md +++ b/content/README.md @@ -228,7 +228,7 @@ defaultPlatform: linux ### `defaultTool` - Purpose: Override the initial tool selection for a page, where tool refers to the application the reader is using to work with GitHub (such as GitHub.com's web UI, the GitHub CLI, or GitHub Desktop) or the GitHub APIs (such as cURL or the GitHub CLI). For more information about the tool selector, see [Markup reference for GitHub Docs](../contributing/content-markup-reference.md#tool-tags). If this frontmatter is omitted, then the tool-specific content matching the GitHub web UI is shown by default. If a user has indicated a tool preference (by clicking on a tool tab), then the user's preference will be applied instead of the default value. -- Type: `String`, one of: `webui`, `cli`, `desktop`, `curl`, `codespaces`, `vscode`. +- Type: `String`, one of: `webui`, `cli`, `desktop`, `curl`, `codespaces`, `vscode`, `importer_cli`, `graphql`. - Optional. ```yaml diff --git a/contributing/content-markup-reference.md b/contributing/content-markup-reference.md index 0f5e0374ad23..fc414ee0f521 100644 --- a/contributing/content-markup-reference.md +++ b/contributing/content-markup-reference.md @@ -104,7 +104,7 @@ You can define a default platform in the frontmatter. For more information, see ## Tool tags -We occasionally need to write documentation for different tools (GitHub UI, GitHub CLI, GitHub Desktop, cURL, Codespaces, VS Code). Each tool may require a different set of instructions. We use tool tags to demarcate information for each tool. +We occasionally need to write documentation for different tools (GitHub UI, GitHub CLI, GitHub Desktop, cURL, Codespaces, VS Code, GitHub Enterprise Importer CLI, GraphQL API). Each tool may require a different set of instructions. We use tool tags to demarcate information for each tool. ### Usage @@ -156,6 +156,22 @@ These instructions are pertinent to VS Code users. {% endvscode %} ``` +``` +{% importer_cli %} + +These instructions are pertinent to GitHub Enterprise Importer CLI users. + +{% endimporter_cli %} +``` + +``` +{% graphql %} + +These instructions are pertinent to GraphQL API users. + +{% endgraphql %} +``` + You can define a default tool in the frontmatter. For more information, see the [content README](../content/README.md#defaulttool). ## Reusable and variable strings of text diff --git a/lib/frontmatter.js b/lib/frontmatter.js index 9d99dd8c3af8..5f8a673ad6cf 100644 --- a/lib/frontmatter.js +++ b/lib/frontmatter.js @@ -181,7 +181,7 @@ export const schema = { // Tool-specific content preference defaultTool: { type: 'string', - enum: ['webui', 'cli', 'desktop', 'curl', 'codespaces', 'vscode'], + enum: ['webui', 'cli', 'desktop', 'curl', 'codespaces', 'vscode', 'importer_cli', 'graphql'], }, // Documentation contributed by a third party, such as a GitHub Partner contributor: { diff --git a/lib/liquid-tags/extended-markdown.js b/lib/liquid-tags/extended-markdown.js index ef1f8d5685bf..507b8b83c255 100644 --- a/lib/liquid-tags/extended-markdown.js +++ b/lib/liquid-tags/extended-markdown.js @@ -8,6 +8,8 @@ export const tags = { curl: '', codespaces: '', vscode: '', + importer_cli: '', + graphql: '', all: '', tip: 'border rounded-1 mb-4 p-3 color-border-accent-emphasis color-bg-accent f5', note: 'border rounded-1 mb-4 p-3 color-border-accent-emphasis color-bg-accent f5', diff --git a/lib/page.js b/lib/page.js index 7d02c5825140..5554a43f82a4 100644 --- a/lib/page.js +++ b/lib/page.js @@ -251,9 +251,16 @@ class Page { this.includesPlatformSpecificContent = this.detectedPlatforms.length > 0 // set flags for webui, cli, etc switcher element - this.detectedTools = ['cli', 'desktop', 'webui', 'curl', 'codespaces', 'vscode'].filter( - (tool) => html.includes(`extended-markdown ${tool}`) || html.includes(`tool-${tool}`) - ) + this.detectedTools = [ + 'cli', + 'desktop', + 'webui', + 'curl', + 'codespaces', + 'vscode', + `importer_cli`, + `graphql`, + ].filter((tool) => html.includes(`extended-markdown ${tool}`) || html.includes(`tool-${tool}`)) this.includesToolSpecificContent = this.detectedTools.length > 0 return html diff --git a/lib/schema-event.js b/lib/schema-event.js index 62d98c9668e1..4d4e94a624fd 100644 --- a/lib/schema-event.js +++ b/lib/schema-event.js @@ -146,7 +146,7 @@ const context = { }, application_preference: { type: 'string', - enum: ['webui', 'cli', 'desktop', 'curl', 'codespaces', 'vscode'], + enum: ['webui', 'cli', 'desktop', 'curl', 'codespaces', 'vscode', 'importer_cli', 'graphql'], description: 'The application selected by the user.', }, color_mode_preference: { @@ -447,6 +447,8 @@ const preferenceSchema = { 'curl', 'codespaces', 'vscode', + 'importer_cli', + 'graphql', 'dark', 'light', 'auto',