GitHub repository¶
In order for GitHub pages to function correctly and automatically publish updated content, the content must be located in a specific repository named after the GitHub organisation, and therefore our website repository is mkdocs-test.
The default branch is called "main", so any branches created for contributing to documentation must use this as the parent, and all pull requests must be submitted against this same branch.
Procedure¶
Procedure overview¶
Ideally the documentation cycle would look like this..

Changes to the original would be pulled down from the original repository directly to your local (PC) repository. You would push your changes to your GitHub website repository. Then create a Pull request to send them to the original for review.
While this is possible, both GitHub Desktop and VSCode make it extremely cumbersome to do so.
So instead a slightly longer approach is described below...

Changes to the original would be pulled down from the original repository to your GitHub website repository with a Pull Request. You will then pull those changes to you local (PC) repository. You will push your changes to your GitHub website repository. Then create a Pull Request to send them to the original for review.
There are a number of possible ways to do this but the instructions below are reasonably simple and work:
After installing the required software (particularly GitHub Desktop and VSCode) ...
One time only:
- Cloning the repository on the GitHub website
- Using GitHub Desktop to download the repository to your PC
Ongoing:
- Opening the repository in VSCode
- Making your changes
- Previewing your changes on your PC
- Using GitHub Desktop to push your changes back to your clone of the Repository on GitHub
- Creating a pull request to send your changes for review
You will periodically need to update your repository:
a. Create a pull request on the GitHub website to get any changes from the original repository to your repository on GitHub website b. Use GitHub Desktop to pull the changes to your repository on your PC
One time only¶
1. Cloning the repository on GitHub website¶
- First you will need to create an account on Github if you don't already have one.
- Go to the original repository
https://github.com/DCC-EX/mkdocs-test - Click on the
Forkbutton and create a new fork. (Do not alter the Repository namemkdocs-test.)
You will now have a new fork located at https://github.com/<your_account_name>/mkdocs-test. Take note of this for the next step.
2. Download the repository to your PC with GitHib Desktop¶
In GitHub Desktop:
- Select
File --> Clone Repository - Enter the name of you repository
<your_account_name>/mkdocs-test - Select a location on your PC to store the repository.
- Click
Clone - Make sure that
Sphinxis selected as the 'Current Branch'
A copy of the repository should now be on the PC.
You can open it in VSCode by selecting Repository -> Open in Visual Studio Code
Ongoing¶
3. Open the repository in VSCode¶
You can open the repository in VSCode at any time by using File --> Open Folder and navigating to the folder you selected in step 2.
You can subsequently open the repository in VSCode using File --> Open Recent and selecting the repository name.
You can also open the repository in VSCode from GitHub Desktop.
4. Make your changes¶
You can use the navigation tree on the left to find the file you want to change. Clicking on a file will open it in the edit window.
While editing, be sure to save often (auto-save should be on by default), preview and commit your changes, and publish them. This way, should anything go wrong with your computer, your work will be saved in GitHub rather than be lost.
5. Live previews¶
Providing you followed the installation guide for VSCode on the page accurately, there are several methods available for generating previews as you are editing the code.
TODO LOW - how to preview options
-
In VSC, you can get a basic preview with the preview button (icon of two pages with a magnifying glass). Top right of the editing page. This only shows basic formatting.
-
You can push to your github repository and view the build (see below).
-
On MS Windows you can use one of the
.batfiles to get a full preview:- local_build_for_win11.bat
- local_dirty_build_for_win11.bat
- local_serve_dirty_for_win11.bat
- local_serve_for_win11.bat
local_serve_for_win11.bat is the simplest and most accurate but is slow.
6. Push your changes to your GitHub repository¶
You will need to:
- Commit your changes
- Push your changes
In GitHub Desktop:
- Open/select the repository
- note and review the changes that have been made
- Add a
Summaryof your changes - Add a
Descriptionof your changes, if the summary is not sufficient - click
Commit to main - click
Push origin
7. Creating a pull request to send your changes for review¶
- Open the GitHub website
- Open/select your repository
https://github.com/<your_account_name>/dcc-ex.github.io
On the 'code' page you should see "This branch is x commit(s) ahead of DCC-EX/dcc-ex.github.io:sphinx."
- Click on the
x commit(s) ahead ofhyperlink - Confirm or add to the title and documentation fields
- Click on the
Create pull requestbutton
This creates a pull request to be reviewed by the documentation team
Periodic¶
To see the changes that other people have made to the original repository you need to periodically refresh your repository on both GitHub website and locally.
a. Get any changes to your repository on GitHub website¶
- Open the GitHub website
- open/select your repository
https://github.com/<your_account_name>/mkdocs-test
On the 'code' page you should see "This branch is x commit(s) behind DCC-EX/mkdocs-test."
If does not say you are 'behind' there is nothing to do. Stop here.
If you are behind...
- Click on the
x commit(s) behindhyperlink - Add to the title and/or documentation fields. This does not matter so entering just
Catchupis fine. - Click on the
Create pull requestbutton - Click on the
Merge pull requestbutton - Click on the
Confirm mergebutton
Any changes are now also in your repository on the GitHub website.
b. Pull the changes to your repository on your PC¶
In GitHub Desktop:
- Click on the
Fetch originbutton
Any changes are now also in your repository on the PC.
Additional¶
Your own github pages¶
You can, optionally, setup github pages from you own repository on the GitHub website. This allows you to make changes that other people can view before creating a pull request.
- In your forked repository settings, navigate to
Settings -> Pages - Under
Build and deployment, SourceconfirmDeploy from a branchis selected - User
Build and deployment, Branchconfirmgh-pagesand/rootare selected. - Click
save
Now, each time you commit and push to your fork or merge a pull request to it, it should automatically build a new pages deployment and publish it.
Building the pages and deploying takes time, every time you push any changes, but you will eventually be able to see your own version of the website at https://<your_account_name>.github.io/mkdocs-test/.
You can see the state of the processing of your changes by looking at the Actions page. It will also tell you there if there are any errors.