Exercise 7: File structure by titles

Exercise 7: File structure by titles#

In this exercise you will learn how to structure your chapters.

Tip

More useful Markdown syntax is explained in the MyST cheat sheet.

  1. Let’s add a new file by going to a directory of your choice within /book and make sure you’re in the correct branch. When you’ve arrived there, click Add file - Create new file.

  2. Name your file and end it with the file extension .md (e.g. my_new_file.md), your filename preferable shouldn’t include spaces.

  3. Now let’s create the structure of your chapter. You need to start with a title on the top of this page. The title is always defined in one of the first lines of the file after the hashtag #. So your file should look like:

# Chapter title
  1. Now let’s add some more text and subsections as needed. You’re only allowed to use one chapter title #, but there’s no limit for the amount of sections, subsections, etc:

# Chapter Title 
text

## Section Title 1
text

## Section Title 2
text

### Subsection Title 1
text

### Subsection Title 2
text

#### Heading 
##### Smaller Heading
###### Smallest Heading
  1. When you are ready, commit your changes to the repository by clicking on the green Commit changes button.

  2. Add a commit message.

  3. Now let’s add your new file tot the table of contents, as explained in Exercise 2: Add a new file to the table of contents.

  4. To see you changes, go to Actions - The most recent workflow run overview.md / the commit message of the commit you just made - Wait for it to finish - In the summary, click on the link of your book shown in the table Branches deployed and under Primary book at root (getting bored of waiting? Soon, there’ll be exercising on doing this locally which prevents you from waiting).

  5. Do you see your change? If you don’t see it click CTRL+F5/Control+F5to refresh the page. Please not that the name of the page in the table of contents is identical to the title of the page, while the URL corresponds to the directory structure of the source files.

Check your understanding

Before moving on to the next exercise, make sure you understand the following:

  • What is the correct way to define a title in a Markdown file?

  • How many chapter titles (#) are allowed in a single Markdown file?

  • What file type are you using?