Editing, adding, and saving files
Editing text
- Once signed in, click on the name of your project (or click ‘Manage’ next to the name) to open the project-details page.
- On the details page, click ‘Edit’ to load the editor.
- In the sidebar on the left, click on the file you want to edit. For instance, to edit Chapter 1 in the ‘book’ folder, you might open
book/text/01.md
. - Edit the text in markdown. (See our guidelines on markdown.)
Searching in files
You can search for and replace text in the file you are editing.
- From the editing page, open the file you would like to search in.
- Click anywhere in the text of that file.
To search:
- Type
Ctrl + F
on Windows or Linux, orCmd + F
on Mac, to bring up a search bar within that file. - Enter your search term and hit
Enter
. This will highlight all instances of the search term. - To cycle through the results, type
Ctrl + G
orCmd + G
. - To move backwards through the results, type
Ctrl + Shift + G
orCmd + Shift + G
.
To search and replace:
- Type
Ctrl + Shift + F
on Windows or Linux, orCmd + Alt + F
on Mac. - Enter the term you would like to find, and hit
Enter
. - Enter the term you would like to replace it with, and hit
Enter
. - A small dialogue box will appear in place of the seach box. You can cycle through all instances of the search term, and choose to replace some or all instances by clicking on the relevant option. Hitting
Enter
will select the default option “Yes”.
To do regular expression (regex) search
- Put your search between forward slashes. E.g.
/Americani[sz]e/
will findAmericanise
andAmericanize
. To search and replace use Ctrl + alt + F (or Cmd + alt + F if you’re on Mac). This page explains a bit more.
Adding new files
If you need to add a new file (for a new chapter, for example):
- In the editor view, click ‘New file’.
- Enter the full path to where the file should be created. Note that these paths have very strict requirements. A valid path for a chapter in the book folder would look like this:
book/text/filename.md
. Do not use spaces in filenames. We recommend using only lowercase letters and numbers, optionally separated with hyphens. Remember to include the.md
file extension for markdown files (the filetype for text). - Click ‘Create file’. Your file will now appear at the bottom of the sidebar.
-
Every markdown file in a book must start with two rows of three hyphens:
--- ---
Between these, you can include ‘YAML frontmatter’, which is information about the file. Usually, this is just a title for the file. For example:
--- title: "Chapter One" ---
After this frontmatter section, add your text content.
Saving and version-control
Storing your content is done in two steps:
- Saving your work on the EBM server (by saving).
- Taking a snapshot of the project for version control (by committing after saving).
To save, click ‘Save’ while you work as often as you like. At least, when you’re done making changes and before you close a file, click ‘Save’.
When you are ready to create a snapshot of your project for version-control, click ‘Commit’ and enter a short note that describes the changes you’ve made. Committing does two important things:
- It takes a snapshot of the entire project.
- It sends that snapshot to your GitHub account.
Once you have clicked ‘Commit’ and entered a description of your change, you can click ‘View Edit History’ to go to GitHub and see the changes stored in your commit. This will open in a new tab. If you click on the commit description on GitHub, you will see a diff (for ‘difference’) of your contributions, with additions in green and deletions in red.
If your project has a parent repository, where you can send your changes to be reviewed by a managing editor, on the EBM you can click ‘Submit these changes for review’, and enter a short description of your submission. If you do not see this button, it means that there is no parent repository, or that you have not made any changes that the managing editor of the parent repository doesn’t already have.
You do not have to submit your changes after every commit. Try to group similar changes into one commit. And try to group similar commits into one submission. This will make your project history easier for you and others to understand.
Also keep in mind that sensible batches of commits and submissions makes it easier for a managing editor to review.
For more detail on collaborating, see Collaboration.