Section A.2 Workflow
Claim an issue on GitHub. This will avoid you competing against others to contribute first (and avoid conflicts in the files). Then pull the most recent version of the book from GitHub to work from, and create a branch to work on.
Add content locally (on your own machine) on your branch. When you are happy with your work (which you should compile with PreTeXt), you will commit the work to that branch.
Submit your work: first push your branch to GitHub. Then create a pull request so someone else can evaluate your work and add it to the official (master) branch.
Subsection A.2.1 Claiming an Issue
Every time we decide as a class that something should be added to the book, one of use will โmake an issueโ on GitHub. This is done on the issues tab on the GitHub page for our project. Issues can be tagged and assigned to individuals or you can assign yourself. As a rule for this course, you should not work on any part of the document that is unrelated to an issue to which you have been assigned (or to which you have assigned yourself). Collaboration is fine, but then everyone working on that issue should be assigned to it, and all those working on the issue should communicate amongst themselves (using the comments that are part of the issue) to decide on who does what. Once you have claimed an issue, but before you can start working on it, you need make sure you have the most recent version of the project. In VS Code, open the workspace for the book. In the lower-left corner of the window you will see some โsource controlโ info. Make sure it says โmasterโ (you want to be on the correct branch). Now you are going to pull the most recent changes from the remote repository. You can do this using VS Code: go to the โsource controlโ tab. The three dots at the top (views and more options) includes a menu for pull, push. You want to pull. (You can also, in a terminal, typegit pull
.)
Now create a new branch for the new work you will do. This can be done in the same menu (under Branch). Name the branch something descriptive, e.g., โadd-thm-2-proofโ. You should now see that as the branch name in the lower-left corner of the window.Subsection A.2.2 Writing and Compiling
Now it's time to write. Add content, using proper PreTeXt markup. Using the pretext-tools extension should help a lot. Remember, everything needs to be inside some sorts of tags. Probably the most important thing to remember is to put each paragraph inside<p>
tags. Using the extension, typing a โpโ and hitting tab will start and end these for you and put your cursor in the right spot. Math goes inside <m>
tags. Again, type โmโ and hit tab.
To see your work, you will need to compile the document. Save the file you are working in (there is a setting in VS Code to autosave, which is useful). Assuming you have installed the PreTeXt command line interface (pip install pretextbook
), you should be able to:
Open a terminal (in VS Code).
Type
pretext build html
, orpretext build html -d
if you have added any tikz images that you want included.
pretext view
and open a web browser to http://localhost:8000/
. Rinse and repeat.
Once you are happy with what you have, you need to tell git this. You have made some changes, and now you need to commit them to (your local copy of) the repository. In the โsource controlโ area of VS Code, click on the +
next to the files listed under โchangesโ. This will stage them to be committed. Then you can enter a commit message that very briefly describes what changes are part of the commit. Finally, commit the staged files (the checkmark above the message).
To keep things clean, it would be helpful to put all the changes for a particular issue into one or two commits. The idea of a commit is that it is something that could be rolled back to an earlier state.