Fix some json examples
This commit is contained in:
@@ -325,7 +325,7 @@ The script creates a table and populates it with placeholder data. To test that
|
|||||||
|
|
||||||
When you run this workflow, you should see the following output in the "Connect to PostgreSQL" step, which confirms that you successfully created the PostgreSQL table and added data:
|
When you run this workflow, you should see the following output in the "Connect to PostgreSQL" step, which confirms that you successfully created the PostgreSQL table and added data:
|
||||||
|
|
||||||
```json
|
```text
|
||||||
null [ { id: 1,
|
null [ { id: 1,
|
||||||
firstname: 'Mona the',
|
firstname: 'Mona the',
|
||||||
lastname: 'Octocat',
|
lastname: 'Octocat',
|
||||||
|
|||||||
@@ -248,13 +248,13 @@ http.createServer(middleware).listen(port, () => {
|
|||||||
|
|
||||||
1. In your `package.json` file, add a top level key `type` with the value `module`. For example:
|
1. In your `package.json` file, add a top level key `type` with the value `module`. For example:
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
{
|
{
|
||||||
...rest of the JSON object,
|
// rest of the JSON object,
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
...rest of the JSON object,
|
// rest of the JSON object,
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -104,11 +104,11 @@ For more information about Dockerfile instructions, see "[Dockerfile reference](
|
|||||||
|
|
||||||
To use a Dockerfile as part of a dev container configuration, reference it in your `devcontainer.json` file by using the `dockerfile` property.
|
To use a Dockerfile as part of a dev container configuration, reference it in your `devcontainer.json` file by using the `dockerfile` property.
|
||||||
|
|
||||||
```json copy
|
```jsonc copy
|
||||||
{
|
{
|
||||||
...
|
// ...
|
||||||
"build": { "dockerfile": "Dockerfile" },
|
"build": { "dockerfile": "Dockerfile" },
|
||||||
...
|
// ...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ The default development container, or "dev container," for {% data variables.pro
|
|||||||
{% data reusables.codespaces.overwrite-devcontainer-config %}
|
{% data reusables.codespaces.overwrite-devcontainer-config %}
|
||||||
{% data reusables.codespaces.details-of-devcontainer-config %}
|
{% data reusables.codespaces.details-of-devcontainer-config %}
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
|
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
|
||||||
{
|
{
|
||||||
@@ -99,7 +99,7 @@ With your dev container configuration added and a basic understanding of what ev
|
|||||||
|
|
||||||
{% data reusables.codespaces.add-comma-after-features %}
|
{% data reusables.codespaces.add-comma-after-features %}
|
||||||
|
|
||||||
```json copy
|
```jsonc copy
|
||||||
"features": {
|
"features": {
|
||||||
"ghcr.io/devcontainers/features/dotnet:1": {}
|
"ghcr.io/devcontainers/features/dotnet:1": {}
|
||||||
},
|
},
|
||||||
@@ -110,21 +110,21 @@ With your dev container configuration added and a basic understanding of what ev
|
|||||||
|
|
||||||
1. Uncomment the `forwardPorts` property and change its value to port `5000` only.
|
1. Uncomment the `forwardPorts` property and change its value to port `5000` only.
|
||||||
|
|
||||||
```json copy
|
```jsonc copy
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
"forwardPorts": [5000],
|
"forwardPorts": [5000],
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Uncomment the `postCreateCommand` property.
|
1. Uncomment the `postCreateCommand` property.
|
||||||
|
|
||||||
```json copy
|
```jsonc copy
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
"postCreateCommand": "dotnet restore",
|
"postCreateCommand": "dotnet restore",
|
||||||
```
|
```
|
||||||
|
|
||||||
{% data reusables.codespaces.add-extension-to-devcontainer %}
|
{% data reusables.codespaces.add-extension-to-devcontainer %}
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
|
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ The default development container, or "dev container," for {% data variables.pro
|
|||||||
{% data reusables.codespaces.overwrite-devcontainer-config %}
|
{% data reusables.codespaces.overwrite-devcontainer-config %}
|
||||||
{% data reusables.codespaces.details-of-devcontainer-config %}
|
{% data reusables.codespaces.details-of-devcontainer-config %}
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/java
|
// README at: https://github.com/devcontainers/templates/tree/main/src/java
|
||||||
{
|
{
|
||||||
@@ -112,14 +112,14 @@ With your dev container configuration added and a basic understanding of what ev
|
|||||||
|
|
||||||
1. Uncomment the `postCreateCommand` property and change its value to `echo \"This file was added by the postCreateCommand.\" > TEMP.md`.
|
1. Uncomment the `postCreateCommand` property and change its value to `echo \"This file was added by the postCreateCommand.\" > TEMP.md`.
|
||||||
|
|
||||||
```json copy
|
```jsonc copy
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
"postCreateCommand": "echo \"This file was added by the postCreateCommand.\" > TEMP.md",
|
"postCreateCommand": "echo \"This file was added by the postCreateCommand.\" > TEMP.md",
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Uncomment the `customizations` property and edit it as follows to install the "Code Spell Checker" extension and the "Extension Pack for Java."
|
1. Uncomment the `customizations` property and edit it as follows to install the "Code Spell Checker" extension and the "Extension Pack for Java."
|
||||||
|
|
||||||
```json copy
|
```jsonc copy
|
||||||
// Configure tool-specific properties.
|
// Configure tool-specific properties.
|
||||||
"customizations": {
|
"customizations": {
|
||||||
// Configure properties specific to VS Code.
|
// Configure properties specific to VS Code.
|
||||||
@@ -135,7 +135,7 @@ With your dev container configuration added and a basic understanding of what ev
|
|||||||
|
|
||||||
The `devcontainer.json` file should now look similar to this, depending on which image you chose:
|
The `devcontainer.json` file should now look similar to this, depending on which image you chose:
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/java
|
// README at: https://github.com/devcontainers/templates/tree/main/src/java
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ The default development container, or "dev container," for {% data variables.pro
|
|||||||
{% data reusables.codespaces.overwrite-devcontainer-config %}
|
{% data reusables.codespaces.overwrite-devcontainer-config %}
|
||||||
{% data reusables.codespaces.details-of-devcontainer-config %}
|
{% data reusables.codespaces.details-of-devcontainer-config %}
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
|
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
|
||||||
{
|
{
|
||||||
@@ -102,14 +102,14 @@ With your dev container configuration added and a basic understanding of what ev
|
|||||||
|
|
||||||
1. Uncomment the `postCreateCommand` property and assign it the command `npm install`.
|
1. Uncomment the `postCreateCommand` property and assign it the command `npm install`.
|
||||||
|
|
||||||
```json copy
|
```jsonc copy
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
"postCreateCommand": "npm install",
|
"postCreateCommand": "npm install",
|
||||||
```
|
```
|
||||||
|
|
||||||
{% data reusables.codespaces.add-extension-to-devcontainer %}
|
{% data reusables.codespaces.add-extension-to-devcontainer %}
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
|
// README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
|
||||||
{
|
{
|
||||||
"name": "Node.js",
|
"name": "Node.js",
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ The default development container, or "dev container," for {% data variables.pro
|
|||||||
{% data reusables.codespaces.overwrite-devcontainer-config %}
|
{% data reusables.codespaces.overwrite-devcontainer-config %}
|
||||||
{% data reusables.codespaces.details-of-devcontainer-config %}
|
{% data reusables.codespaces.details-of-devcontainer-config %}
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/php
|
// README at: https://github.com/devcontainers/templates/tree/main/src/php
|
||||||
{
|
{
|
||||||
@@ -89,14 +89,14 @@ With your dev container configuration added and a basic understanding of what ev
|
|||||||
|
|
||||||
1. In the `devcontainer.json` file, delete the two commented-out lines about features:
|
1. In the `devcontainer.json` file, delete the two commented-out lines about features:
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
// Features to add to the dev container. More info: https://containers.dev/features.
|
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||||
// "features": {},
|
// "features": {},
|
||||||
```
|
```
|
||||||
|
|
||||||
1. Edit the `customizations` property as follows to install the "Composer" extension.
|
1. Edit the `customizations` property as follows to install the "Composer" extension.
|
||||||
|
|
||||||
```json copy
|
```jsonc copy
|
||||||
// Configure tool-specific properties.
|
// Configure tool-specific properties.
|
||||||
"customizations": {
|
"customizations": {
|
||||||
// Configure properties specific to VS Code.
|
// Configure properties specific to VS Code.
|
||||||
@@ -118,14 +118,14 @@ With your dev container configuration added and a basic understanding of what ev
|
|||||||
|
|
||||||
1. Uncomment the `postCreateCommand` property and add some text to the end to run the command `composer install` if a `composer.json` file exists. (The existing commands are just some setup procedures that allow Apache to access the files in the workspace.)
|
1. Uncomment the `postCreateCommand` property and add some text to the end to run the command `composer install` if a `composer.json` file exists. (The existing commands are just some setup procedures that allow Apache to access the files in the workspace.)
|
||||||
|
|
||||||
```json copy
|
```jsonc copy
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
"postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html; if [ -f composer.json ];then composer install;fi"
|
"postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html; if [ -f composer.json ];then composer install;fi"
|
||||||
```
|
```
|
||||||
|
|
||||||
The `devcontainer.json` file should now look similar to this, depending on which image you chose:
|
The `devcontainer.json` file should now look similar to this, depending on which image you chose:
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/php
|
// README at: https://github.com/devcontainers/templates/tree/main/src/php
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ The default development container, or "dev container," for {% data variables.pro
|
|||||||
{% data reusables.codespaces.overwrite-devcontainer-config %}
|
{% data reusables.codespaces.overwrite-devcontainer-config %}
|
||||||
{% data reusables.codespaces.details-of-devcontainer-config %}
|
{% data reusables.codespaces.details-of-devcontainer-config %}
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/python
|
// README at: https://github.com/devcontainers/templates/tree/main/src/python
|
||||||
{
|
{
|
||||||
@@ -103,14 +103,14 @@ With your dev container configuration added and a basic understanding of what ev
|
|||||||
|
|
||||||
1. Uncomment the `postCreateCommand` property.
|
1. Uncomment the `postCreateCommand` property.
|
||||||
|
|
||||||
```json copy
|
```jsonc copy
|
||||||
// Use 'postCreateCommand' to run commands after the container is created.
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
"postCreateCommand": "pip3 install --user -r requirements.txt",
|
"postCreateCommand": "pip3 install --user -r requirements.txt",
|
||||||
```
|
```
|
||||||
|
|
||||||
{% data reusables.codespaces.add-extension-to-devcontainer %}
|
{% data reusables.codespaces.add-extension-to-devcontainer %}
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
// README at: https://github.com/devcontainers/templates/tree/main/src/python
|
// README at: https://github.com/devcontainers/templates/tree/main/src/python
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ To perform bulk operations, you can use aliases to submit multiple node queries
|
|||||||
|
|
||||||
You can also get the new ID for a collection of items. For example, if you wanted to get the new ID for the last 10 repositories in your organization, you could use a query like this:
|
You can also get the new ID for a collection of items. For example, if you wanted to get the new ID for the last 10 repositories in your organization, you could use a query like this:
|
||||||
|
|
||||||
```json
|
```graphql
|
||||||
{
|
{
|
||||||
organization(login: "github") {
|
organization(login: "github") {
|
||||||
repositories(last: 10) {
|
repositories(last: 10) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
1. Uncomment the `customizations` property and edit it as follows to install the "Code Spell Checker" {% data variables.product.prodname_vscode_shortname %} extension.
|
1. Uncomment the `customizations` property and edit it as follows to install the "Code Spell Checker" {% data variables.product.prodname_vscode_shortname %} extension.
|
||||||
|
|
||||||
```json copy
|
```jsonc copy
|
||||||
// Configure tool-specific properties.
|
// Configure tool-specific properties.
|
||||||
"customizations": {
|
"customizations": {
|
||||||
// Configure properties specific to VS Code.
|
// Configure properties specific to VS Code.
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ You can label a port and write the change to a dev container configuration file
|
|||||||
|
|
||||||
The dev container configuration file is updated to include the new label in the `portsAttributes` property. For example:
|
The dev container configuration file is updated to include the new label in the `portsAttributes` property. For example:
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
"forwardPorts": [3333, 4444],
|
"forwardPorts": [3333, 4444],
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
The codespace you connect to must be running an SSH server. The default container image includes an SSH server, which is started automatically. If your codespaces are not created from the default image, you can install and start an SSH server by adding the following to the `features` object in your `devcontainer.json` file.
|
The codespace you connect to must be running an SSH server. The default container image includes an SSH server, which is started automatically. If your codespaces are not created from the default image, you can install and start an SSH server by adding the following to the `features` object in your `devcontainer.json` file.
|
||||||
|
|
||||||
```json
|
```jsonc
|
||||||
"features": {
|
"features": {
|
||||||
...
|
// ...
|
||||||
"ghcr.io/devcontainers/features/sshd:1": {
|
"ghcr.io/devcontainers/features/sshd:1": {
|
||||||
"version": "latest"
|
"version": "latest"
|
||||||
},
|
},
|
||||||
...
|
// ...
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user