From 10c7ba7855445a6379053348425b7ca46a4ec776 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Mon, 23 Nov 2020 12:51:15 -0500 Subject: [PATCH 1/4] include full content including frontmatter, and tweak some regexes --- tests/content/lint-files.js | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/content/lint-files.js b/tests/content/lint-files.js index 10e188a24a..fd5905c547 100644 --- a/tests/content/lint-files.js +++ b/tests/content/lint-files.js @@ -2,7 +2,6 @@ const path = require('path') const slash = require('slash') const fs = require('fs') const walk = require('walk-sync') -const matter = require('@github-docs/frontmatter') const { zip } = require('lodash') const yaml = require('js-yaml') const languages = require('../../lib/languages') @@ -81,19 +80,19 @@ const versionLinkRegEx = /(?=^|[^\]]\s*)\[[^\]]+\](?::\n?[ \t]+|\s*\()(?:(?:http const domainLinkRegex = /(?=^|[^\]]\s*)\[[^\]]+\](?::\n?[ \t]+|\s*\()(?:https?:)?\/\/(?:help|docs|developer)\.github\.com(?!\/changes\/)[^)\s]*(?:\)|\s+|$)/gm // {{ site.data.example.pizza }} -const oldVariableRegex = /{{\s?site\.data\..*}}/g +const oldVariableRegex = /{{\s*?site\.data\..*?}}/g // - {{ octicon-plus }} // - {{ octicon-plus An example label }} // -const oldOcticonRegex = /{{\s?octicon-([a-z-]+)(\s[\w\s\d-]+)?\s?}}/g +const oldOcticonRegex = /{{\s*?octicon-([a-z-]+)(\s[\w\s\d-]+)?\s*?}}/g // - {{#note}} // - {{/note}} // - {{ #warning }} // - {{ /pizza }} // -const oldExtendedMarkdownRegex = /{{\s?[#/][a-z-]+\s?}}/g +const oldExtendedMarkdownRegex = /{{\s*?[#/][a-z-]+\s*}}/g const relativeArticleLinkErrorText = 'Found unexpected relative article links:' const languageLinkErrorText = 'Found article links with hard-coded language codes:' @@ -125,10 +124,7 @@ describe('lint-files', () => { let content beforeAll(async () => { - const fileContents = await fs.promises.readFile(markdownAbsPath, 'utf8') - const { content: bodyContent } = matter(fileContents) - - content = bodyContent + const content = await fs.promises.readFile(markdownAbsPath, 'utf8') }) test('relative URLs must start with "/"', async () => { @@ -214,7 +210,7 @@ describe('lint-files', () => { const matches = (content.match(oldVariableRegex) || []) const matchesWithExample = matches.map(match => { const example = match - .replace(/{{\s?site\.data\.([a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]+)+)\s*}}/g, '{% data $1 %}') + .replace(/{{\s*?site\.data\.([a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]+)+)\s*?}}/g, '{% data $1 %}') return `${match} => ${example}` }) const errorMessage = formatLinkError(oldVariableErrorText, matchesWithExample) @@ -229,7 +225,7 @@ describe('lint-files', () => { test('does not use old extended markdown syntax', async () => { Object.keys(tags).forEach(tag => { - const reg = new RegExp(`{{\\s?[#|/]${tag}`, 'g') + const reg = new RegExp(`{{\\s*?[#|/]${tag}`, 'g') if (reg.test(content)) { const matches = (content.match(oldExtendedMarkdownRegex)) || [] const tagMessage = oldExtendedMarkdownErrorText @@ -334,7 +330,7 @@ describe('lint-files', () => { if (valMatches.length > 0) { matches.push(...valMatches.map((match) => { const example = match - .replace(/{{\s?site\.data\.([a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]+)+)\s*}}/g, '{% data $1 %}') + .replace(/{{\s*?site\.data\.([a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]+)+)\s*?}}/g, '{% data $1 %}') return `Key "${key}": ${match} => ${example}` })) } From 7e859baec215c5c70711cfeb77fd1c470a1de013 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Mon, 23 Nov 2020 12:51:50 -0500 Subject: [PATCH 2/4] update syntax of a few data refs --- .../reviewing-the-audit-log-for-your-organization.md | 6 +++--- .../integrating-jira-with-your-personal-projects.md | 2 +- ...-a-link-between-github-insights-and-github-enterprise.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/content/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization.md b/content/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization.md index e46cc639d1..1c3a69af50 100644 --- a/content/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization.md +++ b/content/github/setting-up-and-managing-organizations-and-teams/reviewing-the-audit-log-for-your-organization.md @@ -428,9 +428,9 @@ For more information, see "[Restricting publication of {% data variables.product | Action | Description |------------------|------------------- | `close` | Triggered when someone closes a security advisory. For more information, see "[About {% data variables.product.prodname_dotcom %} Security Advisories](/github/managing-security-vulnerabilities/about-github-security-advisories)." -| `cve_request` | Triggered when someone requests a CVE (Common Vulnerabilities and Exposures) number from {% data.variables.product.prodname_dotcom %} for a draft security advisory. -| `github_broadcast` | Triggered when {% data.variables.product.prodname_dotcom %} makes a security advisory public in the {% data variables.product.prodname_advisory_database %}. -| `github_withdraw` | Triggered when {% data.variables.product.prodname_dotcom %} withdraws a security advisory that was published in error. +| `cve_request` | Triggered when someone requests a CVE (Common Vulnerabilities and Exposures) number from {% data variables.product.prodname_dotcom %} for a draft security advisory. +| `github_broadcast` | Triggered when {% data variables.product.prodname_dotcom %} makes a security advisory public in the {% data variables.product.prodname_advisory_database %}. +| `github_withdraw` | Triggered when {% data variables.product.prodname_dotcom %} withdraws a security advisory that was published in error. | `open` | Triggered when someone opens a draft security advisory. | `publish` | Triggered when someone publishes a security advisory. | `reopen` | Triggered when someone reopens as draft security advisory. diff --git a/content/github/setting-up-and-managing-your-github-user-account/integrating-jira-with-your-personal-projects.md b/content/github/setting-up-and-managing-your-github-user-account/integrating-jira-with-your-personal-projects.md index c49dbcfc19..4733e979e6 100644 --- a/content/github/setting-up-and-managing-your-github-user-account/integrating-jira-with-your-personal-projects.md +++ b/content/github/setting-up-and-managing-your-github-user-account/integrating-jira-with-your-personal-projects.md @@ -11,7 +11,7 @@ versions: {% data reusables.user_settings.access_settings %} {% data reusables.user_settings.developer_settings %} 3. In the left sidebar, click **{% data variables.product.prodname_oauth_app %}s**. -![{ site.data.variables.product.prodname_oauth_app }}s tab in the left sidebar](/assets/images/help/settings/developer-settings-oauth-apps.png) +![{% data variables.product.prodname_oauth_app %}s tab in the left sidebar](/assets/images/help/settings/developer-settings-oauth-apps.png) 3. Click **Register a new application**. 4. Under **Application name**, type "Jira". 5. Under **Homepage URL**, type the full URL to your Jira instance. diff --git a/content/insights/installing-and-configuring-github-insights/enabling-a-link-between-github-insights-and-github-enterprise.md b/content/insights/installing-and-configuring-github-insights/enabling-a-link-between-github-insights-and-github-enterprise.md index c69bf53c60..16322a6f83 100644 --- a/content/insights/installing-and-configuring-github-insights/enabling-a-link-between-github-insights-and-github-enterprise.md +++ b/content/insights/installing-and-configuring-github-insights/enabling-a-link-between-github-insights-and-github-enterprise.md @@ -1,6 +1,6 @@ --- title: Enabling a link between GitHub Insights and GitHub Enterprise -intro: 'You can enable a link that will allow users to navigate from {% data variables.product.prodname_ghe_server %} to {{ site.data.variables.product.prodname_insights }}.' +intro: 'You can enable a link that will allow users to navigate from {% data variables.product.prodname_ghe_server %} to {% data variables.product.prodname_insights %}.' product: '{% data reusables.gated-features.github-insights %}' permissions: 'Site administrators for {% data variables.product.prodname_ghe_server %} can enable a link between {% data variables.product.prodname_ghe_server %} and {% data variables.product.prodname_insights %}.' redirect_from: From 6662e027b0b0b08da2d1eada0259c49a8ca1c5a4 Mon Sep 17 00:00:00 2001 From: Sarah Schneider Date: Mon, 23 Nov 2020 13:04:11 -0500 Subject: [PATCH 3/4] let, not const and one more regex tweak --- tests/content/lint-files.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/content/lint-files.js b/tests/content/lint-files.js index fd5905c547..4755ad72cf 100644 --- a/tests/content/lint-files.js +++ b/tests/content/lint-files.js @@ -92,7 +92,7 @@ const oldOcticonRegex = /{{\s*?octicon-([a-z-]+)(\s[\w\s\d-]+)?\s*?}}/g // - {{ #warning }} // - {{ /pizza }} // -const oldExtendedMarkdownRegex = /{{\s*?[#/][a-z-]+\s*}}/g +const oldExtendedMarkdownRegex = /{{\s*?[#/][a-z-]+\s*?}}/g const relativeArticleLinkErrorText = 'Found unexpected relative article links:' const languageLinkErrorText = 'Found article links with hard-coded language codes:' @@ -124,7 +124,7 @@ describe('lint-files', () => { let content beforeAll(async () => { - const content = await fs.promises.readFile(markdownAbsPath, 'utf8') + content = await fs.promises.readFile(markdownAbsPath, 'utf8') }) test('relative URLs must start with "/"', async () => { From 980081149db1aef04cd25d8ac2fca58954924bc6 Mon Sep 17 00:00:00 2001 From: Jesus Date: Tue, 24 Nov 2020 15:47:44 +0100 Subject: [PATCH 4/4] Markdown grammar fixes --- ...ng-up-your-development-environment-to-create-a-github-app.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/developers/apps/setting-up-your-development-environment-to-create-a-github-app.md b/content/developers/apps/setting-up-your-development-environment-to-create-a-github-app.md index 56485e1550..47439460e9 100644 --- a/content/developers/apps/setting-up-your-development-environment-to-create-a-github-app.md +++ b/content/developers/apps/setting-up-your-development-environment-to-create-a-github-app.md @@ -220,7 +220,7 @@ end #### Define a route handler -An empty route is included in the template code. This code handles all `POST` requests to the `/event_handler` route. You'll won't write this event handler in this quickstart, but see the other [quickstart guides](/apps/quickstart-guides/) for examples of how to extend this template app. +An empty route is included in the template code. This code handles all `POST` requests to the `/event_handler` route. You won't write this event handler in this quickstart, but see the other [quickstart guides](/apps/quickstart-guides/) for examples of how to extend this template app. ``` ruby post '/event_handler' do