diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 95ba16c0ae0a053..cc0505bf71aee5e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -201,13 +201,13 @@ This will make it easier to submit a pull request for your changes. 3. Check for errors by clicking `Show flaws` on each previewed page. You may be able to fix flaws by running: - ```sh + ```bash yarn content flaws ``` 4. Commit your changes to the branch (our example is using the `fix-typo` branch) and push the changes to your fork's remote: - ```sh + ```bash # Adding all files to the commit git add . # Making a commit with a message describing the changes @@ -241,7 +241,7 @@ There are a few things to keep in mind: Moving one or more documents (or an entire tree of documents) is made easier with the `yarn content move` command. This command moves the file and fixes up redirects automatically. You can use this command as shown below: -```sh +```bash yarn content move [locale] ``` @@ -257,7 +257,7 @@ Let's say you want to move the entire `/en-US/Learn/Accessibility` tree to `/en- 1. Starting from a fresh branch: - ```sh + ```bash cd ~/repos/content # Fetch the latest changes from the main branch on mdn/content git fetch upstream @@ -270,13 +270,13 @@ Let's say you want to move the entire `/en-US/Learn/Accessibility` tree to `/en- 2. Move files with `yarn content move`. This will delete and modify existing files, as well as create new files. - ```sh + ```bash yarn content move Learn/Accessibility Learn/A11y ``` 3. Commit all of the changes and push your branch to the remote: - ```sh + ```bash git add . git commit -m "Move Learn/Accessibility to Learn/A11y" git push @@ -292,14 +292,14 @@ Similar to moving files, you can delete documents or a tree of documents easily You can use this command as shown below: -```sh +```bash yarn content delete [locale] --redirect ``` To use `yarn content delete`, provide the slug of the document you'd like to delete (e.g., `Learn/Accessibility`), and the locale as an optional second argument (this defaults to `en-US`). If the slug of the page you wish to delete contains special characters, include it in quotes. For example: -```sh +```bash yarn content delete "Glossary/Round_Trip_Time_(RTT)" --redirect Glossary/Latency ``` @@ -308,7 +308,7 @@ Say you want to delete the entire `/en-US/Learn/Accessibility` tree and redirect 1. Start from a fresh branch. - ```sh + ```bash cd ~/repos/content # Fetch the latest changes from the main branch on mdn/content git fetch upstream @@ -320,7 +320,7 @@ Say you want to delete the entire `/en-US/Learn/Accessibility` tree and redirect 2. Run the `yarn content delete` command and redirect all deleted documents. - ```sh + ```bash yarn content delete Learn/Accessibility --recursive --redirect Web/Accessibility ``` @@ -330,7 +330,7 @@ Say you want to delete the entire `/en-US/Learn/Accessibility` tree and redirect 3. Commit all of the changes and push your branch to the remote. - ```sh + ```bash git add . git commit -m "Delete Learn/Accessibility pages" git push @@ -346,7 +346,7 @@ You may do this by using the `yarn content add-redirect` command. 1. Start a fresh branch to work in: - ```sh + ```bash cd ~/repos/content # Fetch the latest changes from the main branch on mdn/content git fetch upstream @@ -358,13 +358,13 @@ You may do this by using the `yarn content add-redirect` command. 2. Add a redirect with `yarn content add-redirect`. The target page can be a page on MDN or an external URL: - ```sh + ```bash yarn content add-redirect /en-US/path/of/deleted/page /en-US/path/of/target/page ``` 3. Commit all of the changed files and pushing your branch to your fork: - ```sh + ```bash git add . git commit -m "Adding redirect after deleting Learn/Accessibility pages" git push diff --git a/files/en-us/glossary/round_trip_time/index.md b/files/en-us/glossary/round_trip_time/index.md index 2820fdfcc47695f..519fafc6a021850 100644 --- a/files/en-us/glossary/round_trip_time/index.md +++ b/files/en-us/glossary/round_trip_time/index.md @@ -9,7 +9,12 @@ page-type: glossary-definition **Round Trip Time (RTT)** is the length time it takes for a data packet to be sent to a destination plus the time it takes for an acknowledgment of that packet to be received back at the origin. The RTT between a network and server can be determined by using the `ping` command. ```bash -$ ping example.com +ping example.com +``` + +This will output something like: + +```plain PING example.com (216.58.194.174): 56 data bytes 64 bytes from 216.58.194.174: icmp_seq=0 ttl=55 time=25.050 ms 64 bytes from 216.58.194.174: icmp_seq=1 ttl=55 time=23.781 ms diff --git a/files/en-us/learn/common_questions/web_mechanics/what_is_a_domain_name/index.md b/files/en-us/learn/common_questions/web_mechanics/what_is_a_domain_name/index.md index 6534850279519dc..3ac1a6dc743066f 100644 --- a/files/en-us/learn/common_questions/web_mechanics/what_is_a_domain_name/index.md +++ b/files/en-us/learn/common_questions/web_mechanics/what_is_a_domain_name/index.md @@ -90,7 +90,12 @@ To find out whether a given domain name is available, - Alternatively, if you use a system with a built-in shell, type a `whois` command into it, as shown here for `mozilla.org`: ```bash - $ whois mozilla.org + whois mozilla.org + ``` + + This will output the following: + + ```plain Domain Name:MOZILLA.ORG Domain ID: D1409563-LROR Creation Date: 1998-01-24T05:00:00Z @@ -119,11 +124,16 @@ As you can see, I can't register `mozilla.org` because the Mozilla Foundation ha On the other hand, let's see if I could register `afunkydomainname.org`: ```bash -$ whois afunkydomainname.org +whois afunkydomainname.org +``` + +This will output the following (at the time of writing): + +```plain NOT FOUND ``` -As you can see, the domain does not exist in the `whois` database (at the time of writing), so we could ask to register it. Good to know! +As you can see, the domain does not exist in the `whois` database, so we could ask to register it. Good to know! #### Getting a domain name diff --git a/files/en-us/learn/server-side/django/development_environment/index.md b/files/en-us/learn/server-side/django/development_environment/index.md index cf4881d6a4f4003..df4978ecf503c03 100644 --- a/files/en-us/learn/server-side/django/development_environment/index.md +++ b/files/en-us/learn/server-side/django/development_environment/index.md @@ -110,7 +110,7 @@ You can confirm this by running the following command in the bash terminal: ```bash python3 -V - Python 3.8.10 +# Output: Python 3.8.10 ``` However, the Python Package Index tool (_pip3_) you'll need to install packages for Python 3 (including Django) is **not** available by default. @@ -127,13 +127,14 @@ sudo apt install python3-pip ### macOS macOS does not include Python 3 by default (Python 2 is included on older versions). -You can confirm this by running the following commands in the zsh or bash terminal: +You can confirm this by running the following command in the terminal: ```bash -$ python3 -V - python3: command not found +python3 -V ``` +This will either display the Python version number, which indicates that Python 3 is installed, or `python3: command not found`, which indicates Python 3 was not found. + You can easily install Python 3 (along with the _pip3_ tool) from [python.org](https://www.python.org/): 1. Download the required installer: @@ -144,12 +145,7 @@ You can easily install Python 3 (along with the _pip3_ tool) from [python.org](h 2. Locate the file using _Finder_, and double-click the package file. Following the installation prompts. -You can now confirm successful installation by checking for the _Python 3_ version as shown below: - -```bash -python3 -V - Python 3.10.2 -``` +You can now confirm successful installation by running `python3 -V` again and checking for the Python version number. You can similarly check that _pip3_ is installed by listing the available packages: @@ -174,7 +170,6 @@ You can then verify that Python 3 was installed by entering the following text i ```bash py -3 -V - Python 3.10.2 ``` The Windows installer incorporates _pip3_ (the Python package manager) by default. @@ -195,29 +190,21 @@ You will note that in the previous sections we use different commands to call Py If you only have Python 3 installed (and not Python 2), the bare commands `python` and `pip` can generally be used to run Python and pip on any operating system. If this is allowed on your system you will get a version "3" string when you run `-V` with the bare commands, as shown: -``` -> python -V - Python 3.10.2 - -> pip -V -pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) +```bash +python -V +pip -V ``` If Python 2 is installed then to use version 3 you should prefix commands with `python3` and `pip3` on Linux/macOS, and `py -3` and `py -3 -m pip` on Windows: ```bash +# Linux/macOS +python3 -V +pip3 -V + # Windows py -3 -V - Python 3.10.2 - py -3 -m pip list - -# Linux/macOS -$ python3 -V - Python 3.10.2 - -$ pip3 -V - pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10) ``` The instructions below show the platform specific commands as they work on more systems. @@ -341,8 +328,12 @@ Once you've installed _virtualenvwrapper_ or _virtualenvwrapper-win_ then workin Now you can create a new virtual environment with the `mkvirtualenv` command. As this command runs you'll see the environment being set up (what you see is slightly platform-specific). When the command completes the new virtual environment will be active — you can see this because the start of the prompt will be the name of the environment in brackets (below we show this for Ubuntu, but the final line is similar for Windows/macOS). ```bash -$ mkvirtualenv my_django_environment +mkvirtualenv my_django_environment +``` + +You should see output similar to the following: +```plain Running virtualenv with interpreter /usr/bin/python3 # … virtualenvwrapper.user_scripts creating /home/ubuntu/.virtualenvs/t_env7/bin/get_env_details @@ -379,11 +370,9 @@ You can test that Django is installed by running the following command (this jus ```bash # Linux/macOS python3 -m django --version - 4.0.10 # Windows py -3 -m django --version - 4.0.10 ``` > **Note:** If the above Windows command does not show a django module present, try: @@ -424,22 +413,14 @@ cd mytestsite We can run the _development web server_ from within this folder using **manage.py** and the `runserver` command, as shown. ```bash -$ python3 manage.py runserver -Watching for file changes with StatReloader -Performing system checks… - -System check identified no issues (0 silenced). - -You have 18 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): admin, auth, contenttypes, sessions. -Run 'python manage.py migrate' to apply them. -March 01, 2022 - 01:19:16 -Django version 4.0.10, using settings 'mytestsite.settings' -Starting development server at http://127.0.0.1:8000/ -Quit the server with CONTROL-C. +# Linux/macOS +python3 manage.py runserver + +# Windows +py -3 manage.py runserver ``` -> **Note:** The above command shows the Linux/macOS command. -> You can ignore the warnings about "18 unapplied migration(s)" at this point! +> **Note:** You can ignore the warnings about "18 unapplied migration(s)" at this point! Once the server is running you can view the site by navigating to the following URL on your local web browser: `http://127.0.0.1:8000/`. You should see a site that looks like this: diff --git a/files/en-us/learn/server-side/django/skeleton_website/index.md b/files/en-us/learn/server-side/django/skeleton_website/index.md index c78e1ac2f816f1a..87a276a117c43a3 100644 --- a/files/en-us/learn/server-side/django/skeleton_website/index.md +++ b/files/en-us/learn/server-side/django/skeleton_website/index.md @@ -337,16 +337,7 @@ During development, you can serve the website first using the _development web s Run the _development web server_ by calling the `runserver` command (in the same directory as **manage.py**): ```bash -$ python3 manage.py runserver - -Watching for file changes with StatReloader -Performing system checks... - -System check identified no issues (0 silenced). -March 01, 2022 - 04:08:45 -Django version 4.0.2, using settings 'locallibrary.settings' -Starting development server at http://127.0.0.1:8000/ -Quit the server with CONTROL-C. +python3 manage.py runserver ``` Once the server is running, you can view the site by navigating to `http://127.0.0.1:8000/` in your local web browser. You should see a site error page that looks like this: diff --git a/files/en-us/learn/server-side/express_nodejs/deployment/index.md b/files/en-us/learn/server-side/express_nodejs/deployment/index.md index ee958f988dba6b0..f96647c6227d044 100644 --- a/files/en-us/learn/server-side/express_nodejs/deployment/index.md +++ b/files/en-us/learn/server-side/express_nodejs/deployment/index.md @@ -402,7 +402,10 @@ The final step is to copy your application source files into the repo folder, an It should look a bit like the listing below. ```bash - > git status + git status + ``` + + ```plain On branch main Your branch is up-to-date with 'origin/main'. Changes to be committed: diff --git a/files/en-us/learn/server-side/express_nodejs/development_environment/index.md b/files/en-us/learn/server-side/express_nodejs/development_environment/index.md index 161cc566b773d7f..80722f740ab6f3b 100644 --- a/files/en-us/learn/server-side/express_nodejs/development_environment/index.md +++ b/files/en-us/learn/server-side/express_nodejs/development_environment/index.md @@ -159,7 +159,12 @@ As a slightly more exciting test let's create a very basic "pure node" server th 2. Start the server by navigating into the same directory as your `hellonode.js` file in your command prompt, and calling `node` along with the script name, like so: ```bash - >node hellonode.js + node hellonode.js + ``` + + Once the server starts, you will see console output indicating the IP address the server is running on: + + ```plain Server running at http://127.0.0.1:3000/ ``` @@ -260,7 +265,12 @@ The following steps show how you can use npm to download a package, save it into 5. You can start the server by calling node with the script in your command prompt: ```bash - >node index.js + node index.js + ``` + + You will see the following console output: + + ```plain Example app listening on port 3000 ``` diff --git a/files/en-us/learn/server-side/express_nodejs/skeleton_website/index.md b/files/en-us/learn/server-side/express_nodejs/skeleton_website/index.md index ba4f79dc134a7a1..2b8c297b1daf42c 100644 --- a/files/en-us/learn/server-side/express_nodejs/skeleton_website/index.md +++ b/files/en-us/learn/server-side/express_nodejs/skeleton_website/index.md @@ -134,7 +134,7 @@ express express-locallibrary-tutorial --view=pug The generator will create (and list) the project's files. -```bash +```plain create : express-locallibrary-tutorial\ create : express-locallibrary-tutorial\public\ create : express-locallibrary-tutorial\public\javascripts\ @@ -189,17 +189,17 @@ At this point, we have a complete skeleton project. The website doesn't actually - On the Windows CMD prompt, use this command: - ```bash + ```batch SET DEBUG=express-locallibrary-tutorial:* & npm start ``` - On Windows Powershell, use this command: - ```bash - $ENV:DEBUG = "express-locallibrary-tutorial:*"; npm start + ```powershell + ENV:DEBUG = "express-locallibrary-tutorial:*"; npm start ``` - > **Note:** Powershell commands are not covered further in this tutorial (The provided "Windows" commands assume you're using the Windows CMD prompt.) + > **Note:** Powershell commands are not covered in this tutorial (The provided "Windows" commands assume you're using the Windows CMD prompt.) - On macOS or Linux, use this command: @@ -218,8 +218,10 @@ Congratulations! You now have a working Express application that can be accessed > **Note:** You could also start the app just using the `npm start` command. Specifying the DEBUG variable as shown enables console logging/debugging. For example, when you visit the above page you'll see debug output like this: > > ```bash -> >SET DEBUG=express-locallibrary-tutorial:* & npm start +> SET DEBUG=express-locallibrary-tutorial:* & npm start +> ``` > +> ```plain > > express-locallibrary-tutorial@0.0.0 start D:\github\mdn\test\exprgen\express-locallibrary-tutorial > > node ./bin/www > diff --git a/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_deployment_next/index.md b/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_deployment_next/index.md index 71109fced322376..c0e6f1379f42a44 100644 --- a/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_deployment_next/index.md +++ b/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_deployment_next/index.md @@ -171,7 +171,10 @@ To deploy our app, follow these steps. 3. Run `npx vercel` again, and you'll be prompted to answer a few questions, like this: ```bash - > npx vercel + npx vercel + ``` + + ```plain Vercel CLI 19.1.2 ? Set up and deploy "./mdn-svelte-tutorial"? [Y/n] y ? Which scope do you want to deploy to? opensas @@ -231,7 +234,7 @@ Let's have a go at doing this now. 1. Create a `.gitlab-ci.yml` file inside your project's root and give it the following content: - ``` + ```yaml image: node:latest pages: stage: deploy @@ -264,17 +267,10 @@ Let's have a go at doing this now. 3. Now we just have to commit and push our changes to GitLab. Do this by running the following commands: ```bash - > git add public/index.html - > git add .gitlab-ci.yml - > git commit -m "Added .gitlab-ci.yml file and fixed index.html absolute paths" - > git push - Counting objects: 5, done. - Delta compression using up to 8 threads. - Compressing objects: 100% (5/5), done. - Writing objects: 100% (5/5), 541 bytes | 541.00 KiB/s, done. - Total 5 (delta 3), reused 0 (delta 0) - To gitlab.com:opensas/mdn-svelte-todo.git - 7dac9f3..5725f46 main -> main + git add public/index.html + git add .gitlab-ci.yml + git commit -m "Added .gitlab-ci.yml file and fixed index.html absolute paths" + git push ``` Whenever there's a job running GitLab will display an icon showing the process of the job. Clicking on it will let you inspect the output of the job. diff --git a/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md b/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md index f4055fa0f016daa..02bc41513bf1462 100644 --- a/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md +++ b/files/en-us/learn/tools_and_testing/client-side_javascript_frameworks/svelte_typescript/index.md @@ -207,7 +207,7 @@ In this case, if you run `npm run check` (either in the VS Code console or termi ![Check command being run inside VS Code showing type error, ms variable should be assigned a number](07-vscode-svelte-check.png) -Even better, if you run it from the VS Code integrated terminal (you can open it with the Ctrl + ` keyboard shortcut), Cmd/Ctrl clicking on the file name will take you to the line containing the error. +Even better, if you run it from the VS Code integrated terminal (you can open it with the Ctrl + \` keyboard shortcut), Cmd/Ctrl clicking on the file name will take you to the line containing the error. You can also run the `check` script in watch mode with `npm run check -- --watch`. In this case, the script will execute whenever you change any file. If you are running this in your regular terminal, keep it running in the background in a separate terminal window so that it can keep reporting errors but won't interfere with other terminal usage. @@ -300,7 +300,10 @@ Let's start with our `Alert.svelte` component. 1. Add `lang="ts"` into your `Alert.svelte` component's `