Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shell annotations on code blocks in English docs. #1801

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions en/chromebook_setup/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Now you should see an interface with a sidebar, buttons at the left.
Click "Terminal" button to open terminal window with prompt like this:

{% filename %}Terminal{% endfilename %}
```
```shell
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't shell, but console

$
```

Expand Down Expand Up @@ -53,7 +53,7 @@ Now you should see an interface with a sidebar, a big main window with some
text, and a small window at the bottom that looks something like this:

{% filename %}bash{% endfilename %}
```
```shell
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is more like console, but that doesn't recognize a full prompt (like a full PS1 variable: https://docs.pulpproject.org/pulpcore/configuration/settings.html#pulp-settings).

yourusername:~/workspace $
```

Expand All @@ -69,7 +69,7 @@ bigger.
4. Click on the Tools dropdown list (at the bottom left side of the window), then on Terminal button to open terminal tab with a prompt like this:

{% filename %}Terminal{% endfilename %}
```
```shell
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

app@name-of-your-glitch-project:~
```

Expand Down Expand Up @@ -111,7 +111,7 @@ python3 manage.py runserver $PORT
Once these files are created, go to the Terminal and execute the following commands to create your first Django project:

{% filename %}Terminal{% endfilename %}
```
```shell
django-admin.py startproject mysite .
refresh
```
Expand Down Expand Up @@ -140,6 +140,7 @@ LOGGING = {
},
}
```

This will create a `debug.log` file detailing Django operations and any error messages that might come up, making it much easier to fix if your website does not work.

The initial restarting of the Glitch project should fail.
Expand All @@ -156,7 +157,7 @@ things don't get mixed up between projects.
Run:

{% filename %}Cloud 9{% endfilename %}
```
```shell
mkdir djangogirls
cd djangogirls
python3 -m venv myvenv
Expand Down
12 changes: 6 additions & 6 deletions en/cloud_development_setup/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ All you need to do is find a directory in which you want to create the `virtuale
For this tutorial we will be using a new directory `djangogirls` from your home directory:

{% filename %}command-line{% endfilename %}
```
```shell
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very common in this file, so I'm not commenting it on every line.

Suggested change
```shell
```console

$ mkdir djangogirls
$ cd djangogirls
```
Expand All @@ -38,23 +38,23 @@ We will make a virtualenv called `myvenv`.

To create a new `virtualenv` on RunCode, you first need to install the `virtualenv` module. To do so, first you need to update
the packages in your environment
>```
>```shell
>$ sudo apt-get update -y
>```
> then install `virtualenv` by running the command:
>```
>```shell
>$ sudo apt-get install -y virtualenv
>```

> After this you can create the `virtualenv` run the command:
>```
>```shell
>$ virtualenv -p python myvenv
>```
> and a new `virtualenv` with the name `myvenv` or whatever name you chose should be created in your `djangogirls` folder.

## Working with a Virtual Environment
>Start your virtual environment by running:
>```
>```shell
>$ . myvenv/bin/activate
>```

Expand Down Expand Up @@ -82,7 +82,7 @@ Django~={{ book.django_version }}
Now, run `pip install -r requirements.txt` to install Django.

{% filename %}command-line{% endfilename %}
```
```shell
(myvenv) ~$ pip install -r requirements.txt
Collecting Django~={{ book.django_version }} (from -r requirements.txt (line 1))
Downloading Django-{{ book.django_version }}-py3-none-any.whl (7.9MB)
Expand Down
1 change: 1 addition & 0 deletions en/css/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Between the `<head>` and `</head>` tags, after the links to the Bootstrap CSS fi
```html
<link rel="stylesheet" href="{% static 'css/blog.css' %}">
```

The browser reads the files in the order they're given, so we need to make sure this is in the right place. Otherwise the code in our file may be overriden by code in Bootstrap files.
We just told our template where our CSS file is located.

Expand Down
13 changes: 7 additions & 6 deletions en/deploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,29 @@ Git tracks changes to a particular set of files in what's called a code reposito
> **Note** Check your current working directory with a `pwd` (Mac OS X/Linux) or `cd` (Windows) command before initializing the repository. You should be in the `djangogirls` folder.

{% filename %}command-line{% endfilename %}
```
```shell
$ git init
Initialized empty Git repository in ~/djangogirls/.git/
$ git config --global user.name "Your Name"
$ git config --global user.email you@example.com
```

Initializing the git repository is something we need to do only once per project (and you won't have to re-enter the username and email ever again).

### Adjusting your branch name

If the version of Git that you are using is older than **2.28**, you will need to change the name of your branch to "main". To determine the version of Git, please enter the following command:

{% filename %}command-line{% endfilename %}
```
```shell
$ git --version
git version 2.xx...
```

Only if the second number of the version, shown as "xx" above, is less than 28, will you need to enter the following command to rename your branch. If it is 28 or higher, please continue to "Ignoring files". As in "Initializing", this is something we need to do only once per project, as well as only when your version of Git is less than 2.28:

{% filename %}command-line{% endfilename %}
```
```shell
$ git branch -M main
```

Expand Down Expand Up @@ -100,7 +101,7 @@ Instead use `ls -a` to see the `.gitignore` file.
It's a good idea to use a `git status` command before `git add` or whenever you find yourself unsure of what has changed. This will help prevent any surprises from happening, such as wrong files being added or committed. The `git status` command returns information about any untracked/modified/staged files, the branch status, and much more. The output should be similar to the following:

{% filename %}command-line{% endfilename %}
```
```shell
$ git status
On branch main

Expand All @@ -121,7 +122,7 @@ nothing added to commit but untracked files present (use "git add" to track)
And finally we save our changes. Go to your console and run these commands:

{% filename %}command-line{% endfilename %}
```
```shell
$ git add .
$ git commit -m "My Django Girls app, first commit"
[...]
Expand Down Expand Up @@ -151,7 +152,7 @@ Now we need to hook up the Git repository on your computer to the one up on GitH
Type the following into your console (replace `<your-github-username>` with the username you entered when you created your GitHub account, but without the angle-brackets -- the URL should match the clone URL you just saw).

{% filename %}command-line{% endfilename %}
```
```shell
$ git remote add origin https://github.com/<your-github-username>/my-first-blog.git
$ git push -u origin main
```
Expand Down
6 changes: 3 additions & 3 deletions en/deploy/install_git.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ $ sudo apt install git
This will align your installation of Git with the broad direction of the global developer community, and the "main" branch will be used through the remainder of this tutorial. Please see https://sfconservancy.org/news/2020/jun/23/gitbranchname/ and https://github.com/github/renaming for further discussion of this subject.

{% filename %}command-line{% endfilename %}
```
```shell
$ git config --global --add init.defaultBranch main
```

Expand All @@ -55,7 +55,7 @@ $ sudo dnf install git
This will align your installation of Git with the broad direction of the global developer community, and the "main" branch will be used through the remainder of this tutorial. Please see https://sfconservancy.org/news/2020/jun/23/gitbranchname/ and https://github.com/github/renaming for further discussion of this subject.

{% filename %}command-line{% endfilename %}
```
```shell
$ git config --global --add init.defaultBranch main
```

Expand All @@ -74,7 +74,7 @@ $ sudo zypper install git
This will align your installation of Git with the broad direction of the global developer community, and the "main" branch will be used through the remainder of this tutorial. Please see https://sfconservancy.org/news/2020/jun/23/gitbranchname/ and https://github.com/github/renaming for further discussion of this subject.

{% filename %}command-line{% endfilename %}
```
```shell
$ git config --global --add init.defaultBranch main
```

Expand Down
8 changes: 4 additions & 4 deletions en/deploy/pythonanywhere.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Go back to the main [PythonAnywhere Dashboard](https://www.pythonanywhere.com/)
Deploying a web app on PythonAnywhere involves pulling down your code from GitHub, and then configuring PythonAnywhere to recognise it and start serving it as a web application. There are manual ways of doing it, but PythonAnywhere provides a helper tool that will do it all for you. Let's install it first:

{% filename %}PythonAnywhere command-line{% endfilename %}
```
```shell
$ pip{{ book.pa_py_version }} install --user pythonanywhere
```

Expand All @@ -25,7 +25,7 @@ That should print out some things like `Collecting pythonanywhere`, and eventual
Now we run the helper to automatically configure our app from GitHub. Type the following into the console on PythonAnywhere (don't forget to use your GitHub username in place of `<your-github-username>`, so that the URL matches the clone URL from GitHub):

{% filename %}PythonAnywhere command-line{% endfilename %}
```
```shell
$ pa_autoconfigure_django.py --python={{ book.pa_py_version }} https://github.com/<your-github-username>/my-first-blog.git
```

Expand All @@ -43,7 +43,7 @@ On PythonAnywhere all those steps are automated, but they're the same steps you
The main thing to notice right now is that your database on PythonAnywhere is actually totally separate from your database on your own computer, so it can have different posts and admin accounts. As a result, just as we did on your own computer, we need to initialize the admin account with `createsuperuser`. PythonAnywhere has automatically activated your virtualenv for you, so all you need to do is run:

{% filename %}PythonAnywhere command-line{% endfilename %}
```
```shell
(ola.pythonanywhere.com) $ python manage.py createsuperuser
```

Expand All @@ -52,7 +52,7 @@ Type in the details for your admin user. Best to use the same ones as you're us
Now, if you like, you can also take a look at your code on PythonAnywhere using `ls`:

{% filename %}PythonAnywhere command-line{% endfilename %}
```
```shell
(ola.pythonanywhere.com) $ ls
blog db.sqlite3 manage.py mysite requirements.txt static
(ola.pythonanywhere.com) $ ls blog/
Expand Down
4 changes: 2 additions & 2 deletions en/django_admin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ To log in, you need to create a *superuser* - a user account that has control ov
> Remember, to write new commands while the web server is running, open a new terminal window and activate your virtualenv. We reviewed how to write new commands in the <b>Your first Django project!</b> chapter, in the <b>Starting the web server</b> section.

{% filename %}Mac OS X or Linux:{% endfilename %}
```
```shell
(myvenv) ~/djangogirls$ python manage.py createsuperuser
```

{% filename %}Windows:{% endfilename %}
```
```shell
(myvenv) C:\Users\Name\djangogirls> python manage.py createsuperuser
```

Expand Down
4 changes: 2 additions & 2 deletions en/django_forms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ Let's see if all this works on PythonAnywhere. Time for another deploy!
* First, commit your new code, and push it up to GitHub:

{% filename %}command-line{% endfilename %}
```
```shell
$ git status
$ git add .
$ git status
Expand All @@ -444,7 +444,7 @@ $ git push
* Then, in a [PythonAnywhere Bash console](https://www.pythonanywhere.com/consoles/):

{% filename %}PythonAnywhere command-line{% endfilename %}
```
```shell
$ cd ~/<your-pythonanywhere-domain>.pythonanywhere.com
$ git pull
[...]
Expand Down
Loading