Skip to content

Commit

Permalink
fix: upgrade to docusaurus beta 15, which allows for fix of styled code
Browse files Browse the repository at this point in the history
in pre tags
  • Loading branch information
dwmkerr committed Jan 31, 2022
1 parent ca7336d commit 5d5adfc
Show file tree
Hide file tree
Showing 159 changed files with 13,109 additions and 635 deletions.
26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,13 @@ to:

Use this pattern in Visual Studio Code (regex search and replace):

| Search | Replace |
|--------------------|---------------------------------------|
| `src="images(.*?)"` | `src={require('./images$1').default}` |
| Search | Replace |
|------------------------------------------------|---------------------------------------|
| `src="[\./]*images(.*?)"` | `src={require('./images$1').default}` |
| `\{\{<[ ]*relref "\/docs\/(.*?)"[ ]*>[ ]*\}\}` | `../../$1` |
| `\{\{< hint info >\}\}\n\*\*(.*?)\*\*` | `:::tip $1\n` |
| `\{\{< /hint >\}\}` | `\n:::` |
| `<Three backticks>` | `<Three backticks>bash` |

### Task List

Expand All @@ -144,13 +148,19 @@ This is a short-and-sweet task list for the refactoring process.
- [x] Build
- [x] Deploy
- [x] Test deployment
- [x] Fix hints
- [ ] Part 2, migrate and preview
- [ ] Part 3, migrate and preview
- [ ] Part 4, migrate and preview
- [ ] Part 5, migrate and preview
- [ ] Part 6, migrate and preview
- [ ] Create a really nice animation: https://starship.rs/ also look at a yes no question, 'become a shell expert' or something
- [ ] Fixup table of contents
- [ ] Fixup appendix/todo/missing chapters
- [ ] Fix relref links
- [ ] Fix TODOs
- [ ] Test grep styling and relrefs
- [ ] Ensure that google analytics integration is working.
- [ ] Part 2
- [ ] Part 3
- [ ] Part 4
- [ ] Part 5
- [ ] Part 6
- [ ] Replace `version.txt` to `package.json`
- [ ] Remove old files
- [ ] Build
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: 'Getting Started'
id: '01-getting-started'
slug: '/part-1-transitioning-to-the-shell/getting-started/'
---

Expand Down Expand Up @@ -249,15 +248,15 @@ First, follow the instructions online to install [Homebrew](https://brew.sh/):

In most cases, this will require opening the terminal programming and running a snippet which looks like this:

```sh
```bash
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
```

However, this might have changed since the time of writing so do [check the website](https://brew.sh/) to see what the latest instructions are. You don't actually need to know what is going on with this command (but by the time you've worked through a bit more of this book it will make sense!), but in a nutshell it runs a basic installation script, using the _Ruby_ programming language (which comes pre-installed on MacOS).

Once this has installed, install Bash by running the following command in the shell:

```sh
```bash
brew install bash
```

Expand Down Expand Up @@ -289,7 +288,7 @@ Start by opening your shell. This is covered in [Opening the Shell](#Opening-The

You should see your terminal program running your shell. You can see what the _version_ is of your shell by running:

```sh
```bash
bash --version
```

Expand All @@ -303,21 +302,21 @@ Let's move to the _home_ folder. On most computers your home folder is your pers

Let's switch to the home folder by running the following command:

```sh
```bash
cd ~
```

Once you've done that, run the `pwd` command:

```sh
```bash
pwd
```

![Screenshot: Moving to the home directory](./images/moving-to-home.png)

So what has happened here? The first command:

```sh
```bash
cd ~
```

Expand All @@ -327,7 +326,7 @@ Finally, we ran the `pwd` command. This command is short for _print working dire

Let's take another look at a command. Run the following in your shell:

```sh
```bash
ls
```

Expand All @@ -337,7 +336,7 @@ The `ls` command is short for _list directory contents_ - it shows you everythin

We can pass different parameters to `ls`. The main parameter is the location of the folder we'd like to list the contents of. So if we wanted to see what was in the `Music` folder, we'd just run:

```sh
```bash
ls Music
```

Expand All @@ -347,7 +346,7 @@ Not much to see here:

Many commands actually allow us to pass multiple parameters. For example, we could list the contents of my Movies and my personal applications:

```sh
```bash
ls Movies Applications
```

Expand All @@ -373,7 +372,7 @@ The error above shows what happens when we miss the quotation marks.

Now we can take a look at how a _flag_ would work. A flag is a parameter which changes how a command works. Flags normally start with a hyphen. Let's say we wanted to know the _size_ of the files in the folder. We do this by using the `-lh` pass the parameter, which is short for _long list, human readable_:

```sh
```bash
ls -lh Downloads/*.jpg
```

Expand All @@ -395,7 +394,7 @@ Now let's look at one more command.

The 'echo' command is used to write out a message in the shell. Here's an example of how it works:

```sh
```bash
echo "Hello Shell!"
```

Expand All @@ -405,7 +404,7 @@ This command writes out the text `Hello Shell!`:

Why would we do this? One of the most common reasons would be to _see_ what the shell thinks a certain value is. For example, try this command:

```sh
```bash
echo "My home directory is at: $HOME"
```

Expand Down Expand Up @@ -433,7 +432,7 @@ Here we map the shell commands to the visual interface's equivalents:

As a final trick, lets see how we open a file or folder. Let's say I want to open one of the photos in my Downloads folder. Here's how I can do it:

```sh
```bash
cd ~/Downloads
open himalayas.jpg
```
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: 'Navigating Your System'
id: '02-navigating-your-system'
slug: '/part-1-transitioning-to-the-shell/navigating-your-system/'
---

Expand All @@ -14,7 +13,7 @@ If these commands far familiar to you then feel free to jump to the next chapter

Perhaps the easiest way to start to understand how to navigate your system using the shell is to use a graphical interface as an illustration of how we often navigate. Open your shell, and enter the following command:

```sh
```bash
pwd
```

Expand All @@ -32,7 +31,7 @@ An environment variable is just a bit of data that you can access from your shel

Try the following command:

```sh
```bash
echo "My current working directory is: $PWD"
```

Expand All @@ -46,7 +45,7 @@ The dollar symbol is used to tell the shell we want to use the `PWD` variable, n

In the graphical user interface, we can also see the files and folders in the current directory. In the shell, we don't see this content. But we can show the contents of the current working directory with the following command:

```sh
```bash
ls
```

Expand All @@ -58,7 +57,7 @@ The `ls` command is the _List Directory Contents_ command. It will show the cont

There are a lot of options for the `ls` command. In [Chapter 5](#TODO) we'll see how to find out the options for commands. For now, let's look at one of the most common options `-l`. This shows the contents as a list:

```sh
```bash
ls -l
```

Expand All @@ -72,7 +71,7 @@ In a graphical user interface, you move to a different directory by clicking on

In the shell, you run the `cd` command. Try it out with:

```sh
```bash
# Move to the pictures directory...
cd Pictures

Expand Down Expand Up @@ -111,13 +110,13 @@ website/content/docs/part-1-transitioning-to-the-shell

This path is _relative_ to my current working directory in the shell. This means that this path only makes sense if you use it from a specific directory. If I am in my `Pictures` folder, and I want to move to the `2020-photos` folder, I could do it in two ways. The first is with an absolute path:

```sh
```bash
cd /Users/dwmkerr/Pictures/2020-photos
```

The second is with a relative path:

```sh
```bash
cd 2020-photos
```

Expand All @@ -127,7 +126,7 @@ In short - relative paths are often useful if you want to move to something _wit

As you experiment with these commands, you might have noticed that every folder contains two other folders, one with the name `.` and one with the name `..`. Run `ls -al` on the `pictures` folder to see an example:

```sh
```bash
ls -al pictures
```

Expand All @@ -139,15 +138,15 @@ This picture highlights two special folders - `.` and `..`. These are special fo

The first folder, `.`, represents the folder it is in. Why would this be useful? Well, sometimes we just want a quick way to say the equivalent of "right here" in a command. For example, if I wanted to copy the current folder to a backup folder, I could do this:

```sh
```bash
cp . /backup
```

The `cp` command is the _Copy_ command, and we'll see it in the next chapter. But the key thing to note is that we can use `.` to tell the command to copy the folder we are in right now.

The `..` folder means _the parent folder_. You can use this to "go up" to the parent folder, for example:

```sh
```bash
cd ..
ls .
```
Expand All @@ -160,7 +159,7 @@ Note that we've used `cd ..` to _change directory to the parent folder_ then `ls

The `..` folder can be helpful if you need to navigate to a location which is outside of your current folder. For example, if I am in the `pictures` folder and I want to move to the `scripts` folder, I can just use:

```sh
```bash
cd ../scripts
ls
```
Expand All @@ -175,7 +174,7 @@ There is one more special part of the file system we have to know about. That is

This directory can always be accessed through the `~` character. For example, no matter where I am in the system, I can run the following command to move to my home directory and show the contents:

```sh
```bash
cd ~
ls
```
Expand All @@ -186,15 +185,15 @@ This would show something like this:

This makes moving around your home directory very easy. For example, on a Mac, to go to your pictures folder from anywhere, you can always just run:

```sh
```bash
cd ~/Pictures
```

Your home directory on most computers will be where you keep your documents, pictures, videos and so on. Normally this directory is _not accessible_ to other users of the system. Each user in a system gets their own home directory.

You can also see the home directory by using the special `HOME` environment variable:

```sh
```bash
echo "My home directory is: $HOME"
```

Expand All @@ -204,7 +203,7 @@ This would show something like this:

One useful trick - running `cd` without any parameters will always take you home! So to go home, just run:

```sh
```bash
cd
```

Expand All @@ -214,7 +213,7 @@ Now that we know about relative paths, absolute paths, and the special dot and d

One thing we might want to do is quickly move from one location to another, then go back again. Let's say for example I am working in on this chapter, but I want to check my downloads. One way to do this is with this `pushd` command:

```sh
```bash
pushd ~/Downloads
ls
popd
Expand All @@ -236,7 +235,7 @@ These commands can be useful if you need to move to other locations but want to

One last trick which can save time is the following command:

```sh
```bash
cd -
```

Expand Down
Loading

0 comments on commit 5d5adfc

Please sign in to comment.