From d9167f1449e44885307877307ff7e49db23b14cd Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 18 Jan 2021 07:04:46 -0500 Subject: [PATCH] chore: Add missing code fence languages (#772) * chore: Add missing code fence languages * Update content/actions/creating-actions/dockerfile-support-for-github-actions.md * Add raw & endraw markers around shell content See review comment by @rachmari * Add raw & endraw markers around shell content See review comment by @rachmari * Remove language from code fences to avoid the problem of replaceable text indicates like not showing up in the output page. Co-authored-by: hubwriter --- content/README.md | 2 +- .../dockerfile-support-for-github-actions.md | 9 ++-- .../setting-exit-codes-for-actions.md | 2 + .../guides/building-and-testing-nodejs.md | 2 +- ...hing-dependencies-to-speed-up-workflows.md | 8 +-- .../guides/publishing-nodejs-packages.md | 4 +- .../storing-workflow-data-as-artifacts.md | 2 +- ...a-proxy-server-with-self-hosted-runners.md | 2 +- .../adding-a-workflow-status-badge.md | 8 +-- .../workflow-commands-for-github-actions.md | 4 +- .../evacuating-a-cluster-node.md | 14 +++++- .../initializing-the-cluster.md | 2 +- ...manually-syncing-actions-from-githubcom.md | 2 +- .../creating-a-pre-receive-hook-script.md | 50 +++++++++---------- .../migrating-to-internal-repositories.md | 4 +- .../creating-a-github-app-from-a-manifest.md | 4 +- .../creating-ci-tests-with-the-checks-api.md | 2 +- ...g-and-authorizing-users-for-github-apps.md | 2 +- .../developers/overview/secret-scanning.md | 4 +- ...ngle-issue-template-for-your-repository.md | 2 +- ...a-merge-conflict-using-the-command-line.md | 16 +++--- .../working-with-pre-receive-hooks.md | 2 +- ...-codeql-code-scanning-in-your-ci-system.md | 10 ++-- .../about-github-pages-and-jekyll.md | 4 +- ...yll-build-errors-for-github-pages-sites.md | 4 +- ...-to-your-github-pages-site-using-jekyll.md | 2 +- ...tom-404-page-for-your-github-pages-site.md | 2 +- ...yll-build-errors-for-github-pages-sites.md | 2 +- .../basic-writing-and-formatting-syntax.md | 16 +++--- .../organizing-information-with-tables.md | 10 ++-- .../graphql/guides/introduction-to-graphql.md | 30 +++++------ ...n-github-insights-and-github-enterprise.md | 2 +- ...ache-maven-for-use-with-github-packages.md | 10 ++-- ...guring-npm-for-use-with-github-packages.md | 2 +- ...g-rubygems-for-use-with-github-packages.md | 6 +-- .../manage-packages/deleting-a-package.md | 4 +- 36 files changed, 132 insertions(+), 119 deletions(-) diff --git a/content/README.md b/content/README.md index 35703a215a32..69da2ee8a7b2 100644 --- a/content/README.md +++ b/content/README.md @@ -269,7 +269,7 @@ https://github-images.s3.amazonaws.com/enterprise/2.20/assets/images/help/profil Sometimes you want to link to a Dotcom-only article in Enterprise content and you don't want the link to be Enterprise-ified. To prevent the transformation, write the link using HTML and add a class of `dotcom-only`. For example: -``` +```html GitHub's Terms of Service ``` diff --git a/content/actions/creating-actions/dockerfile-support-for-github-actions.md b/content/actions/creating-actions/dockerfile-support-for-github-actions.md index 68f93976d780..dba9c8dd1ed4 100644 --- a/content/actions/creating-actions/dockerfile-support-for-github-actions.md +++ b/content/actions/creating-actions/dockerfile-support-for-github-actions.md @@ -48,20 +48,21 @@ The Docker `ENTRYPOINT` instruction has a _shell_ form and _exec_ form. The Dock If you configure your container to use the _exec_ form of the `ENTRYPOINT` instruction, the `args` configured in the action's metadata file won't run in a command shell. If the action's `args` contain an environment variable, the variable will not be substituted. For example, using the following _exec_ format will not print the value stored in `$GITHUB_SHA`, but will instead print `"$GITHUB_SHA"`. -``` +```dockerfile ENTRYPOINT ["echo $GITHUB_SHA"] ``` If you want variable substitution, then either use the _shell_ form or execute a shell directly. For example, using the following _exec_ format, you can execute a shell to print the value stored in the `GITHUB_SHA` environment variable. -``` +```dockerfile ENTRYPOINT ["sh", "-c", "echo $GITHUB_SHA"] -```` +``` To supply `args` defined in the action's metadata file to a Docker container that uses the _exec_ form in the `ENTRYPOINT`, we recommend creating a shell script called `entrypoint.sh` that you call from the `ENTRYPOINT` instruction: ##### Example *Dockerfile* -``` + +```dockerfile # Container image that runs your code FROM debian:9.5-slim diff --git a/content/actions/creating-actions/setting-exit-codes-for-actions.md b/content/actions/creating-actions/setting-exit-codes-for-actions.md index 1e550d3bbc06..2a733849d5c0 100644 --- a/content/actions/creating-actions/setting-exit-codes-for-actions.md +++ b/content/actions/creating-actions/setting-exit-codes-for-actions.md @@ -41,11 +41,13 @@ For more information, see "[Creating a JavaScript action](/articles/creating-a-j If you are creating a Docker container action, you can set a failure exit code in your `entrypoint.sh` script. For example: +{% raw %} ``` if ; then echo "Game over!" exit 1 fi ``` +{% endraw %} For more information, see "[Creating a Docker container action](/articles/creating-a-docker-container-action)." diff --git a/content/actions/guides/building-and-testing-nodejs.md b/content/actions/guides/building-and-testing-nodejs.md index 6fa457742b95..480d359be109 100644 --- a/content/actions/guides/building-and-testing-nodejs.md +++ b/content/actions/guides/building-and-testing-nodejs.md @@ -220,7 +220,7 @@ steps: The example above creates an *.npmrc* file with the following contents: -``` +```ini //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} @octocat:registry=https://registry.npmjs.org/ always-auth=true diff --git a/content/actions/guides/caching-dependencies-to-speed-up-workflows.md b/content/actions/guides/caching-dependencies-to-speed-up-workflows.md index d450d7ae52cc..1e43aea47812 100644 --- a/content/actions/guides/caching-dependencies-to-speed-up-workflows.md +++ b/content/actions/guides/caching-dependencies-to-speed-up-workflows.md @@ -124,14 +124,14 @@ A cache key can include any of the contexts, functions, literals, and operators Using expressions to create a `key` allows you to automatically create a new cache when dependencies have changed. For example, you can create a `key` using an expression that calculates the hash of an npm `package-lock.json` file. {% raw %} -``` +```yaml npm-${{ hashFiles('package-lock.json') }} ``` {% endraw %} {% data variables.product.prodname_dotcom %} evaluates the expression `hash "package-lock.json"` to derive the final `key`. -``` +```yaml npm-d5ea0750 ``` @@ -144,7 +144,7 @@ You can provide a list of restore keys to use when there is a cache miss on `key #### Example using multiple restore keys {% raw %} -``` +```yaml restore-keys: | npm-foobar-${{ hashFiles('package-lock.json') }} npm-foobar- @@ -155,7 +155,7 @@ restore-keys: | The runner evaluates the expressions, which resolve to these `restore-keys`: {% raw %} -``` +```yaml restore-keys: | npm-foobar-d5ea0750 npm-foobar- diff --git a/content/actions/guides/publishing-nodejs-packages.md b/content/actions/guides/publishing-nodejs-packages.md index ce467dd52554..8b79ba457cc8 100644 --- a/content/actions/guides/publishing-nodejs-packages.md +++ b/content/actions/guides/publishing-nodejs-packages.md @@ -78,7 +78,7 @@ jobs: In the example above, the `setup-node` action creates an *.npmrc* file on the runner with the following contents: -``` +```ini //registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN} registry=https://registry.npmjs.org/ always-auth=true @@ -140,7 +140,7 @@ jobs: The `setup-node` action creates an *.npmrc* file on the runner. When you use the `scope` input to the `setup-node` action, the *.npmrc* file includes the scope prefix. By default, the `setup-node` action sets the scope in the *.npmrc* file to the account that contains that workflow file. -``` +```ini //npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN} @octocat:registry=https://npm.pkg.github.com always-auth=true diff --git a/content/actions/guides/storing-workflow-data-as-artifacts.md b/content/actions/guides/storing-workflow-data-as-artifacts.md index fe6aac29edf2..763158ff5833 100644 --- a/content/actions/guides/storing-workflow-data-as-artifacts.md +++ b/content/actions/guides/storing-workflow-data-as-artifacts.md @@ -114,7 +114,7 @@ jobs: You can define a custom retention period for individual artifacts created by a workflow. When using a workflow to create a new artifact, you can use `retention-days` with the `upload-artifact` action. This example demonstrates how to set a custom retention period of 5 days for the artifact named `my-artifact`: -``` +```yaml - name: 'Upload Artifact' uses: actions/upload-artifact@v2 with: diff --git a/content/actions/hosting-your-own-runners/using-a-proxy-server-with-self-hosted-runners.md b/content/actions/hosting-your-own-runners/using-a-proxy-server-with-self-hosted-runners.md index 2dc3f1fc9617..c3b60531c350 100644 --- a/content/actions/hosting-your-own-runners/using-a-proxy-server-with-self-hosted-runners.md +++ b/content/actions/hosting-your-own-runners/using-a-proxy-server-with-self-hosted-runners.md @@ -38,7 +38,7 @@ If setting environment variables is not practical, you can set the proxy configu An example _.env_ proxy configuration is shown below: -``` +```ini https_proxy=http://proxy.local:8080 no_proxy=example.com,myserver.local:443 ``` diff --git a/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md b/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md index 162499b98ad3..523e8d551cb9 100644 --- a/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md +++ b/content/actions/managing-workflow-runs/adding-a-workflow-status-badge.md @@ -34,7 +34,7 @@ https://github.com///workflows//badge.svg This Markdown example adds a status badge for a workflow with the name "Greet Everyone." The `OWNER` of the repository is the `actions` organization and the `REPOSITORY` name is `hello-world`. -``` +```markdown ![example workflow name](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg) ``` @@ -42,7 +42,7 @@ This Markdown example adds a status badge for a workflow with the name "Greet Ev This Markdown example adds a status badge for a workflow with the file path `.github/workflows/main.yml`. The `OWNER` of the repository is the `actions` organization and the `REPOSITORY` name is `hello-world`. -``` +```markdown ![example workflow file path](https://github.com/actions/hello-world/workflows/.github/workflows/main.yml/badge.svg) ``` @@ -50,7 +50,7 @@ This Markdown example adds a status badge for a workflow with the file path `.gi This Markdown example adds a status badge for a branch with the name `feature-1`. -``` +```markdown ![example branch parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?branch=feature-1) ``` @@ -58,6 +58,6 @@ This Markdown example adds a status badge for a branch with the name `feature-1` This Markdown example adds a badge that displays the status of workflow runs triggered by the `pull_request` event. -``` +```markdown ![example event parameter](https://github.com/actions/hello-world/workflows/Greet%20Everyone/badge.svg?event=pull_request) ``` diff --git a/content/actions/reference/workflow-commands-for-github-actions.md b/content/actions/reference/workflow-commands-for-github-actions.md index a66233c2af74..75aab6a867d2 100644 --- a/content/actions/reference/workflow-commands-for-github-actions.md +++ b/content/actions/reference/workflow-commands-for-github-actions.md @@ -253,7 +253,7 @@ During the execution of a workflow, the runner generates temporary files that ca **Warning:** Powershell does not use UTF-8 by default. Make sure you write files using the correct encoding. For example, you need to set UTF-8 encoding when you set the path: -``` +```yaml steps: - run: echo "mypath" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append ``` @@ -287,7 +287,7 @@ For multiline strings, you may use a delimiter with the following syntax. ##### Example In this example, we use `EOF` as a delimiter and set the `JSON_RESPONSE` environment variable to the value of the curl response. -``` +```yaml steps: - name: Set the value id: step_one diff --git a/content/admin/enterprise-management/evacuating-a-cluster-node.md b/content/admin/enterprise-management/evacuating-a-cluster-node.md index ce81346f7571..c429e9270723 100644 --- a/content/admin/enterprise-management/evacuating-a-cluster-node.md +++ b/content/admin/enterprise-management/evacuating-a-cluster-node.md @@ -18,36 +18,46 @@ If you're taking a node offline that has any data services (like git, pages, or $ ghe-config cluster._hostname_.uuid ``` -2. You'll need to monitor the status of your node while the data is being copied. Ideally, the node shouldn't be taken offline until the copying is complete. To monitor the status of your node, run any of the following commands: +2. You'll need to monitor the status of your node while the data is being copied. Ideally, the node shouldn't be taken offline until the copying is complete. To monitor the status of your node, run any of the following commands: For Git ``` ghe-spokes evac-status ``` For {% data variables.product.prodname_pages %} + {% raw %} ``` echo "select count(*) from pages_replicas where host = 'pages-server-'" | ghe-dbconsole -y ``` + {% endraw %} For storage ``` ghe-storage evacuation-status ``` -3. After the copying is complete, you can evacuate the storage service. Run any of the following commands: +3. After the copying is complete, you can evacuate the storage service. Run any of the following commands: For Git + {% raw %} ``` ghe-spokes server evacuate git-server- ``` + {% endraw %} For {% data variables.product.prodname_pages %} + {% raw %} ``` ghe-dpages evacuate pages-server- ``` + {% endraw %} For storage, take the node offline + {% raw %} ``` ghe-storage offline storage-server- ``` + {% endraw %} then evacuate + {% raw %} ``` ghe-storage evacuate storage-server- ``` + {% endraw %} diff --git a/content/admin/enterprise-management/initializing-the-cluster.md b/content/admin/enterprise-management/initializing-the-cluster.md index b6ff1105a891..1fc88c484a53 100644 --- a/content/admin/enterprise-management/initializing-the-cluster.md +++ b/content/admin/enterprise-management/initializing-the-cluster.md @@ -46,7 +46,7 @@ The names of the nodes can be any valid hostname you choose. The names are set a Specify the first cluster node you configured as the MySQL primary via `mysql-server` and `mysql-master`. -``` +```ini [cluster] mysql-master = ghe-data-node-1 redis-master = ghe-data-node-1 diff --git a/content/admin/github-actions/manually-syncing-actions-from-githubcom.md b/content/admin/github-actions/manually-syncing-actions-from-githubcom.md index 63aa2f5b9cd9..f36947c4bc9c 100644 --- a/content/admin/github-actions/manually-syncing-actions-from-githubcom.md +++ b/content/admin/github-actions/manually-syncing-actions-from-githubcom.md @@ -63,7 +63,7 @@ This example demonstrates using the `actions-sync` tool to sync an individual ac * You can sync multiple actions by replacing the `--repo-name` parameter with `--repo-name-list` or `--repo-name-list-file`. For more information, see the [`actions-sync` README](https://github.com/actions/actions-sync#actions-sync). 1. After the action repository is created on your enterprise instance, people in your enterprise can use the destination repository to reference the action in their workflows. For the example action shown above: - ``` + ```yaml uses: synced-actions/docker-build-push-action@v1 ``` diff --git a/content/admin/policies/creating-a-pre-receive-hook-script.md b/content/admin/policies/creating-a-pre-receive-hook-script.md index f425ea8e24f9..2022ef49c576 100644 --- a/content/admin/policies/creating-a-pre-receive-hook-script.md +++ b/content/admin/policies/creating-a-pre-receive-hook-script.md @@ -11,7 +11,7 @@ versions: You can see examples of pre-receive hooks for {% data variables.product.prodname_ghe_server %} in the [`github/platform-samples` repository](https://github.com/github/platform-samples/tree/master/pre-receive-hooks). ### Writing a pre-receive hook script -A pre-receive hook script executes in a pre-receive hook environment on the {% data variables.product.prodname_ghe_server %} appliance. When you create a pre-receive hook script, consider the available input, output, exit-status and environment variables. +A pre-receive hook script executes in a pre-receive hook environment on the {% data variables.product.prodname_ghe_server %} appliance. When you create a pre-receive hook script, consider the available input, output, exit-status and environment variables. #### Input (stdin) After a push occurs and before any refs are updated on the remote repository, the `git-receive-pack` process invokes the pre-receive hook script with the standard input of one line per ref to be updated: @@ -94,30 +94,30 @@ You can test a pre-receive hook script locally before you create or update it on 2. Create a file called `Dockerfile.dev` containing: - ``` - FROM gliderlabs/alpine:3.3 - RUN \ - apk add --no-cache git openssh bash && \ - ssh-keygen -A && \ - sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config && \ - adduser git -D -G root -h /home/git -s /bin/bash && \ - passwd -d git && \ - su git -c "mkdir /home/git/.ssh && \ - ssh-keygen -t ed25519 -f /home/git/.ssh/id_ed25519 -P '' && \ - mv /home/git/.ssh/id_ed25519.pub /home/git/.ssh/authorized_keys && \ - mkdir /home/git/test.git && \ - git --bare init /home/git/test.git" - - VOLUME ["/home/git/.ssh", "/home/git/test.git/hooks"] - WORKDIR /home/git - - CMD ["/usr/sbin/sshd", "-D"] - ``` - -3. Create a test pre-receive script called `always_reject.sh`. This example script will reject all pushes, which is useful for locking a repository: - - ``` - #!/usr/bin/env bash + ```dockerfile + FROM gliderlabs/alpine:3.3 + RUN \ + apk add --no-cache git openssh bash && \ + ssh-keygen -A && \ + sed -i "s/#AuthorizedKeysFile/AuthorizedKeysFile/g" /etc/ssh/sshd_config && \ + adduser git -D -G root -h /home/git -s /bin/bash && \ + passwd -d git && \ + su git -c "mkdir /home/git/.ssh && \ + ssh-keygen -t ed25519 -f /home/git/.ssh/id_ed25519 -P '' && \ + mv /home/git/.ssh/id_ed25519.pub /home/git/.ssh/authorized_keys && \ + mkdir /home/git/test.git && \ + git --bare init /home/git/test.git" + + VOLUME ["/home/git/.ssh", "/home/git/test.git/hooks"] + WORKDIR /home/git + + CMD ["/usr/sbin/sshd", "-D"] + ``` + + 3. Create a test pre-receive script called `always_reject.sh`. This example script will reject all pushes, which is useful for locking a repository: + + ```shell + #!/usr/bin/env bash echo "error: rejecting all pushes" exit 1 diff --git a/content/admin/user-management/migrating-to-internal-repositories.md b/content/admin/user-management/migrating-to-internal-repositories.md index fbd80a13f9a9..509a9e1a1197 100644 --- a/content/admin/user-management/migrating-to-internal-repositories.md +++ b/content/admin/user-management/migrating-to-internal-repositories.md @@ -33,11 +33,11 @@ If you don't have private mode enabled, the migration script will have no effect 1. Connect to the administrative shell. For more information, see "[Accessing the administrative shell (SSH)](/enterprise/admin/installation/accessing-the-administrative-shell-ssh)." 2. Navigate to the `/data/github/current` directory. - ``` + ```shell cd /data/github/current ``` 3. Run the migration command. - ``` + ```shell sudo bin/safe-ruby lib/github/transitions/20191210220630_convert_public_ghes_repos_to_internal.rb --verbose -w | tee -a /tmp/convert_public_ghes_repos_to_internal.log ``` diff --git a/content/developers/apps/creating-a-github-app-from-a-manifest.md b/content/developers/apps/creating-a-github-app-from-a-manifest.md index 83cd4644dd3d..7c18a8b460cc 100644 --- a/content/developers/apps/creating-a-github-app-from-a-manifest.md +++ b/content/developers/apps/creating-a-github-app-from-a-manifest.md @@ -80,7 +80,7 @@ Name | Type | Description This example uses a form on a web page with a button that triggers the `POST` request for a user account: -``` +```html
Create a GitHub App Manifest:
@@ -111,7 +111,7 @@ This example uses a form on a web page with a button that triggers the `POST` re ``` This example uses a form on a web page with a button that triggers the `POST` request for an organization account. Replace `ORGANIZATION` with the name of the organization account where you want to create the app. -``` +```html Create a GitHub App Manifest:
diff --git a/content/developers/apps/creating-ci-tests-with-the-checks-api.md b/content/developers/apps/creating-ci-tests-with-the-checks-api.md index be09ec94e049..3c498bff5c75 100644 --- a/content/developers/apps/creating-ci-tests-with-the-checks-api.md +++ b/content/developers/apps/creating-ci-tests-with-the-checks-api.md @@ -724,7 +724,7 @@ To push to a repository, your app must have write permissions for "Repository co In order to commit files, Git must know which [username](/articles/setting-your-username-in-git/) and [email](/articles/setting-your-commit-email-address-in-git/) to associate with the commit. Add two more environment variables in your `.env` file to store the name (`GITHUB_APP_USER_NAME`) and email (`GITHUB_APP_USER_EMAIL`) settings. Your name can be the name of your app and the email can be any email you'd like for this example. For example: -``` +```ini GITHUB_APP_USER_NAME=Octoapp GITHUB_APP_USER_EMAIL=octoapp@octo-org.com ``` diff --git a/content/developers/apps/identifying-and-authorizing-users-for-github-apps.md b/content/developers/apps/identifying-and-authorizing-users-for-github-apps.md index ae02a509fc62..fc0202be0573 100644 --- a/content/developers/apps/identifying-and-authorizing-users-for-github-apps.md +++ b/content/developers/apps/identifying-and-authorizing-users-for-github-apps.md @@ -89,7 +89,7 @@ Name | Type | Description By default, the response takes the following form. The response parameters `expires_in`, `refresh_token`, and `refresh_token_expires_in` are only returned when you enable the beta for expiring user-to-server access tokens. -``` +```json { "access_token": "e72e16c7e42f292c6912e7710c838347ae178b4a", "expires_in": "28800", diff --git a/content/developers/overview/secret-scanning.md b/content/developers/overview/secret-scanning.md index 054637e2a582..232bfa2707c6 100644 --- a/content/developers/overview/secret-scanning.md +++ b/content/developers/overview/secret-scanning.md @@ -61,7 +61,7 @@ Create a public, internet accessible HTTP endpoint at the URL you provided to us ##### Example POST sent to your endpoint -``` +```http POST / HTTP/1.1 Host: HOST Accept: */* @@ -95,7 +95,7 @@ Assuming you receive the following message, the code snippets below demonstrate The code also assumes you've set an environment variable called `GITHUB_PRODUCTION_TOKEN` with a generated PAT (https://github.com/settings/tokens). The token does not need any permissions set. **Sample message sent to verify endpoint** -``` +```http POST / HTTP/1.1 Host: HOST Accept: */* diff --git a/content/github/building-a-strong-community/manually-creating-a-single-issue-template-for-your-repository.md b/content/github/building-a-strong-community/manually-creating-a-single-issue-template-for-your-repository.md index 35a090bdab15..8cb5adf5ce55 100644 --- a/content/github/building-a-strong-community/manually-creating-a-single-issue-template-for-your-repository.md +++ b/content/github/building-a-strong-community/manually-creating-a-single-issue-template-for-your-repository.md @@ -18,7 +18,7 @@ You can add YAML frontmatter to each issue template to pre-fill the issue title, Here is example YAML front matter. -``` +```yaml --- name: Tracking issue about: Use this template for tracking new features. diff --git a/content/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-using-the-command-line.md b/content/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-using-the-command-line.md index c6ce42751821..5dae3a154053 100644 --- a/content/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-using-the-command-line.md +++ b/content/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-using-the-command-line.md @@ -46,14 +46,14 @@ For example, if you and another person both edited the file _styleguide.md_ on t 4. Open your favorite text editor, such as [Atom](https://atom.io/), and navigate to the file that has merge conflicts. 5. To see the beginning of the merge conflict in your file, search the file for the conflict marker `<<<<<<<`. When you open the file in your text editor, you'll see the changes from the HEAD or base branch after the line `<<<<<<< HEAD`. Next, you'll see `=======`, which divides your changes from the changes in the other branch, followed by `>>>>>>> BRANCH-NAME`. In this example, one person wrote "open an issue" in the base or HEAD branch and another person wrote "ask your question in IRC" in the compare branch or `branch-a`. - ``` -If you have questions, please -<<<<<<< HEAD -open an issue -======= -ask your question in IRC. ->>>>>>> branch-a - ```` + ``` + If you have questions, please + <<<<<<< HEAD + open an issue + ======= + ask your question in IRC. + >>>>>>> branch-a + ``` {% data reusables.pull_requests.decide-how-to-resolve-competing-line-change-merge-conflict %} In this example, both changes are incorporated into the final merge: ```shell diff --git a/content/github/collaborating-with-issues-and-pull-requests/working-with-pre-receive-hooks.md b/content/github/collaborating-with-issues-and-pull-requests/working-with-pre-receive-hooks.md index 85001ffa3167..5b78492e2303 100644 --- a/content/github/collaborating-with-issues-and-pull-requests/working-with-pre-receive-hooks.md +++ b/content/github/collaborating-with-issues-and-pull-requests/working-with-pre-receive-hooks.md @@ -11,7 +11,7 @@ Pre-receive hooks run tests on code pushed to a repository to ensure contributio If your push isn't accepted, you'll see an error message corresponding to the failed pre-receive hook. -``` +```shell $ git push Counting objects: 3, done. Delta compression using up to 4 threads. diff --git a/content/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-codeql-code-scanning-in-your-ci-system.md b/content/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-codeql-code-scanning-in-your-ci-system.md index 2e9b9ce6389e..944f9c4a302a 100644 --- a/content/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-codeql-code-scanning-in-your-ci-system.md +++ b/content/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-codeql-code-scanning-in-your-ci-system.md @@ -21,7 +21,7 @@ To integrate {% data variables.product.prodname_code_scanning %} into your CI sy In general, you invoke the {% data variables.product.prodname_codeql_runner %} as follows. -``` +```shell $ /path/to-runner/codeql-runner-OS ``` @@ -40,7 +40,7 @@ The {% data variables.product.prodname_codeql_runner %} automatically detects an To override automatic language detection, run the `init` command with the `--languages` flag, followed by a comma-separated list of language keywords. The keywords for the supported languages are `cpp`, `csharp`, `go`, `java`, `javascript`, and `python`. -``` +```shell $ /path/to-runner/codeql-runner-linux init --languages cpp,java ``` @@ -58,7 +58,7 @@ For more information, see "[Using a custom configuration file](#using-a-custom-c In the following example, the `+` symbol ensures that the {% data variables.product.prodname_codeql_runner %} uses the additional queries together with any queries specified in the referenced configuration file. -``` +```shell $ /path/to-runner/codeql-runner-linux init --config-file .github/codeql/codeql-config.yml --queries +security-and-quality,octo-org/python-qlpack/show_ifs.ql@main ``` @@ -71,7 +71,7 @@ The configuration file is a YAML file. It uses syntax similar to the workflow sy Use the `--config-file` flag of the `init` command to specify the configuration file. The value of `--config-file` is the path to the configuration file that you want to use. This example loads the configuration file _.github/codeql/codeql-config.yml_. -``` +```shell $ /path/to-runner/codeql-runner-linux init --config-file .github/codeql/codeql-config.yml ``` @@ -87,7 +87,7 @@ For many common build systems, the {% data variables.product.prodname_codeql_run The `autobuild` process only ever attempts to build _one_ compiled language for a repository. The language automatically selected for analysis is the language with the most files. If you want to choose a language explicitly, use the `--language` flag of the `autobuild` command. -``` +```shell $ /path/to-runner/codeql-runner-linux autobuild --language csharp ``` diff --git a/content/github/working-with-github-pages/about-github-pages-and-jekyll.md b/content/github/working-with-github-pages/about-github-pages-and-jekyll.md index 07804937c639..f15e93e71a8c 100644 --- a/content/github/working-with-github-pages/about-github-pages-and-jekyll.md +++ b/content/github/working-with-github-pages/about-github-pages-and-jekyll.md @@ -38,7 +38,7 @@ You can configure most Jekyll settings, such as your site's theme and plugins, b Some configuration settings cannot be changed for {% data variables.product.prodname_pages %} sites. -``` +```yaml lsi: false safe: true source: [your repo's top level directory] @@ -111,7 +111,7 @@ By default, code blocks on your site will be highlighted by Jekyll. Jekyll uses If you want to use another highlighter, such as `highlight.js`, you must disable Jekyll's syntax highlighting by updating your project's *_config.yml* file. -``` +```yaml kramdown: syntax_highlighter_opts: disable : true diff --git a/content/github/working-with-github-pages/about-jekyll-build-errors-for-github-pages-sites.md b/content/github/working-with-github-pages/about-jekyll-build-errors-for-github-pages-sites.md index dc0041458736..d1d49acecefa 100644 --- a/content/github/working-with-github-pages/about-jekyll-build-errors-for-github-pages-sites.md +++ b/content/github/working-with-github-pages/about-jekyll-build-errors-for-github-pages-sites.md @@ -44,13 +44,13 @@ You can see build failures (but not build warnings) for your site on {% data var You can configure a third-party service, such as [Travis CI](https://travis-ci.org/), to display error messages after each commit. 1. If you haven't already, add a file called _Gemfile_ in the root of your publishing source, with the following content: - ``` + ```ruby source `https://rubygems.org` gem `github-pages` ``` 2. Configure your site's repository for the testing service of your choice. For example, to use [Travis CI](https://travis-ci.org/), add a file named _.travis.yml_ in the root of your publishing source, with the following content: - ``` + ```yaml language: ruby rvm: - 2.3 diff --git a/content/github/working-with-github-pages/adding-a-theme-to-your-github-pages-site-using-jekyll.md b/content/github/working-with-github-pages/adding-a-theme-to-your-github-pages-site-using-jekyll.md index 203b8088ee74..8d2717705516 100644 --- a/content/github/working-with-github-pages/adding-a-theme-to-your-github-pages-site-using-jekyll.md +++ b/content/github/working-with-github-pages/adding-a-theme-to-your-github-pages-site-using-jekyll.md @@ -42,7 +42,7 @@ People with write permissions for a repository can add a theme to a {% data vari {% data reusables.pages.navigate-publishing-source %} 1. Create a new file called _/assets/css/style.scss_. 2. Add the following content to the top of the file: - ``` + ```scss --- --- diff --git a/content/github/working-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site.md b/content/github/working-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site.md index f5523b51a7d8..e64b467d98c7 100644 --- a/content/github/working-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site.md +++ b/content/github/working-with-github-pages/creating-a-custom-404-page-for-your-github-pages-site.md @@ -17,7 +17,7 @@ versions: 3. In the file name field, type `404.html` or `404.md`. ![File name field](/assets/images/help/pages/404-file-name.png) 4. If you named your file `404.md`, add the following YAML front matter to the beginning of the file: - ``` + ```yaml --- permalink: /404.html --- diff --git a/content/github/working-with-github-pages/troubleshooting-jekyll-build-errors-for-github-pages-sites.md b/content/github/working-with-github-pages/troubleshooting-jekyll-build-errors-for-github-pages-sites.md index 3b2bb2212b1e..22f7e9a64814 100644 --- a/content/github/working-with-github-pages/troubleshooting-jekyll-build-errors-for-github-pages-sites.md +++ b/content/github/working-with-github-pages/troubleshooting-jekyll-build-errors-for-github-pages-sites.md @@ -78,7 +78,7 @@ This error means that your code references a symlinked file that does not exist This error means that you used non-Latin characters, like `日本語`, without telling the computer to expect these symbols. To troubleshoot, force UTF-8 encoding by adding the following line to your *_config.yml* file: -``` +```yaml encoding: UTF-8 ``` diff --git a/content/github/writing-on-github/basic-writing-and-formatting-syntax.md b/content/github/writing-on-github/basic-writing-and-formatting-syntax.md index cc409e010f5d..833bf2592f77 100644 --- a/content/github/writing-on-github/basic-writing-and-formatting-syntax.md +++ b/content/github/writing-on-github/basic-writing-and-formatting-syntax.md @@ -13,7 +13,7 @@ versions: To create a heading, add one to six `#` symbols before your heading text. The number of `#` you use will determine the size of the heading. -``` +```markdown # The largest heading ## The second largest heading ###### The smallest heading @@ -37,7 +37,7 @@ You can indicate emphasis with bold, italic, or strikethrough text. You can quote text with a `>`. -``` +```markdown In the words of Abraham Lincoln: > Pardon my French @@ -55,7 +55,7 @@ In the words of Abraham Lincoln: You can call out code or a command within a sentence with single backticks. The text within the backticks will not be formatted. -``` +```markdown Use `git status` to list all new or modified files that haven't yet been committed. ``` @@ -102,7 +102,7 @@ You can create an inline link by wrapping link text in brackets `[ ]`, and then You can make an unordered list by preceding one or more lines of text with `-` or `*`. -``` +```markdown - George Washington - John Adams - Thomas Jefferson @@ -112,7 +112,7 @@ You can make an unordered list by preceding one or more lines of text with `-` o To order your list, precede each line with a number. -``` +```markdown 1. James Madison 2. James Monroe 3. John Quincy Adams @@ -126,7 +126,7 @@ You can create a nested list by indenting one or more list items below another i To create a nested list using the web editor on {% data variables.product.product_name %} or a text editor that uses a monospaced font, like [Atom](https://atom.io/), you can align your list visually. Type space characters in front of your nested list item, until the list marker character (`-` or `*`) lies directly below the first character of the text in the item above it. -``` +```markdown 1. First list item - First nested list item - Second nested list item @@ -140,7 +140,7 @@ To create a nested list in the comment editor on {% data variables.product.produ In this example, you could add a nested list item under the list item `100. First list item` by indenting the nested list item a minimum of five spaces, since there are five characters (`100. `) before `First list item`. -``` +```markdown 100. First list item - First nested list item ``` @@ -149,7 +149,7 @@ In this example, you could add a nested list item under the list item `100. Firs You can create multiple levels of nested lists using the same method. For example, because the first nested list item has seven spaces (`␣␣␣␣␣-␣`) before the nested list content `First nested list item`, you would need to indent the second nested list item by seven spaces. -``` +```markdown 100. First list item - First nested list item - Second nested list item diff --git a/content/github/writing-on-github/organizing-information-with-tables.md b/content/github/writing-on-github/organizing-information-with-tables.md index 07a84b6ad6b8..aad54f147a8e 100644 --- a/content/github/writing-on-github/organizing-information-with-tables.md +++ b/content/github/writing-on-github/organizing-information-with-tables.md @@ -13,7 +13,7 @@ versions: You can create tables with pipes `|` and hyphens `-`. Hyphens are used to create each column's header, while pipes separate each column. You must include a blank line before your table in order for it to correctly render. -``` +```markdown | First Header | Second Header | | ------------- | ------------- | @@ -27,7 +27,7 @@ The pipes on either end of the table are optional. Cells can vary in width and do not need to be perfectly aligned within columns. There must be at least three hyphens in each column of the header row. -``` +```markdown | Command | Description | | --- | --- | | git status | List all new or modified files | @@ -40,7 +40,7 @@ Cells can vary in width and do not need to be perfectly aligned within columns. You can use [formatting](/articles/basic-writing-and-formatting-syntax) such as links, inline code blocks, and text styling within your table: -``` +```markdown | Command | Description | | --- | --- | | `git status` | List all *new or modified* files | @@ -51,7 +51,7 @@ You can use [formatting](/articles/basic-writing-and-formatting-syntax) such as You can align text to the left, right, or center of a column by including colons `:` to the left, right, or on both sides of the hyphens within the header row. -``` +```markdown | Left-aligned | Center-aligned | Right-aligned | | :--- | :---: | ---: | | git status | git status | git status | @@ -62,7 +62,7 @@ You can align text to the left, right, or center of a column by including colons To include a pipe `|` as content within your cell, use a `\` before the pipe: -``` +```markdown | Name | Character | | --- | --- | | Backtick | ` | diff --git a/content/graphql/guides/introduction-to-graphql.md b/content/graphql/guides/introduction-to-graphql.md index af85a0c39d6d..542305f7cab0 100644 --- a/content/graphql/guides/introduction-to-graphql.md +++ b/content/graphql/guides/introduction-to-graphql.md @@ -81,33 +81,33 @@ GraphQL is [introspective](https://graphql.github.io/learn/introspection/). This * Query `__schema` to list all types defined in the schema and get details about each: ```graphql -query { - __schema { - types { - name - kind - description - fields { + query { + __schema { + types { name + kind + description + fields { + name + } } } } -} ``` * Query `__type` to get details about any type: ```graphql -query { - __type(name: "Repository") { - name - kind - description - fields { + query { + __type(name: "Repository") { name + kind + description + fields { + name + } } } -} ``` * You can also run an _introspection query_ of the schema via a `GET` request: 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 16322a6f8366..1a459b1fe16b 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 @@ -14,7 +14,7 @@ After you enable the link, each user can navigate directly from {% data variable 1. Connect to the administrative shell for {% data variables.product.prodname_ghe_server %}. For more information, see "[Accessing the administrative shell (SSH)](/enterprise/{{ currentVersion }}/admin/guides/installation/accessing-the-administrative-shell-ssh/)." 2. Run the following command. - ``` + ```shell ghe-config 'app.github.insights-available' 'true' && ghe-config-apply ``` 3. Return to {% data variables.product.prodname_ghe_server %}. diff --git a/content/packages/guides/configuring-apache-maven-for-use-with-github-packages.md b/content/packages/guides/configuring-apache-maven-for-use-with-github-packages.md index 62ffeb833cf9..802d3b7db820 100644 --- a/content/packages/guides/configuring-apache-maven-for-use-with-github-packages.md +++ b/content/packages/guides/configuring-apache-maven-for-use-with-github-packages.md @@ -38,7 +38,7 @@ If you want to interact with multiple repositories, you can add each repository If your instance has subdomain isolation enabled: {% endif %} -``` +```xml "ssh://{% if currentVersion == "free-pro-team@latest" %}github.com{% else %}HOSTNAME{% endif %}/OWNER/REPOSITORY" } ``` @@ -119,7 +119,7 @@ You can use gems from {% data variables.product.prodname_registry %} much like y {% data reusables.package_registry.authenticate-step %} 2. For Bundler, add your {% data variables.product.prodname_dotcom %} user or organization as a source in your *Gemfile* to fetch gems from this new source. For example, you can add a new `source` block to your *Gemfile* that uses {% data variables.product.prodname_registry %} only for the packages you specify, replacing *GEM NAME* with the package you want to install from {% data variables.product.prodname_registry %} and *OWNER* with the user or organization that owns the repository containing the gem you want to install.{% if enterpriseServerVersions contains currentVersion %} Replace `REGISTRY-URL` with the URL for your instance's Rubygems registry. If your instance has subdomain isolation enabled, use `rubygems.HOSTNAME`. If your instance has subdomain isolation disabled, use `HOSTNAME/_registry/rubygems`. In either case, replace *HOSTNAME* with the host name of your {% data variables.product.prodname_ghe_server %} instance.{% endif %} - ``` + ```ruby source "https://rubygems.org" gem "rails" @@ -131,7 +131,7 @@ You can use gems from {% data variables.product.prodname_registry %} much like y 3. For Bundler versions earlier than 1.7.0, you need to add a new global `source`. For more information on using Bundler, see the [bundler.io documentation](http://bundler.io/v1.5/gemfile.html). - ``` + ```ruby source "https://{% if currentVersion == "free-pro-team@latest" %}rubygems.pkg.github.com{% else %}REGISTRY-URL{% endif %}/OWNER" source "https://rubygems.org" diff --git a/content/packages/manage-packages/deleting-a-package.md b/content/packages/manage-packages/deleting-a-package.md index b820d5f65afb..b5aef1144ac6 100644 --- a/content/packages/manage-packages/deleting-a-package.md +++ b/content/packages/manage-packages/deleting-a-package.md @@ -58,7 +58,7 @@ Use the `deletePackageVersion` mutation in the GraphQL API. You must use a token Here is an example cURL command to delete a package version with the package version ID of `MDIyOlJlZ2lzdHJ5UGFja2FnZVZlcnNpb243MTExNg`, using a personal access token. {% if currentVersion == "free-pro-team@latest" %} -``` +```shell curl -X POST \ -H "Accept: application/vnd.github.package-deletes-preview+json" \ -H "Authorization: bearer TOKEN" \ @@ -68,7 +68,7 @@ https://api.github.com/graphql {% else %} -``` +```shell curl -X POST \ -H "Accept: application/vnd.github.package-deletes-preview+json" \ -H "Authorization: bearer TOKEN" \