Photo by Stephen Kraakmo on Unsplash
When using GitHub as a collaboration tool to maintain documentation, you can contribute to the documentation in GitHub via Pull Requests (PRs) by adding new content and making improvements to the existing content. In addition, you can also review PRs sent by other contributors. The rich diff mode in GitHub does not display the exact output that appears when you run MkDocs. Therefore, there is a high chance that you may miss certain formatting aspects at the time of reviewing the PR. Here is a workaround to make the PR reviewing process foolproof.
Generally, when the PR is not too large and I notice multiple aspects that need to be improved in it, I click on the Edit file menu option, copy the content in the file, paste the content in my local MkDocs setup, run the MkDocs server, and check the content locally. Thereafter, I copy the content of the updated MD file, replace the existing content in the PR with the new content, and commit my changes to the existing PR. However, I recommend the following workaround if the PR is large and has images as well.
Workround
Follow the instructions below to review the changes in the PR locally:
- Optionally, check the name of the upstream repository.
You only need to do this if you are not sure of the name of your upstream repository.git remote -v
- Create a branch that corresponds to the specific PR.
Format:
git fetch upstream pull/<PR-ID>/head:<branch-name>
Example:
git fetch upstream pull/3810/head:temp1
- Navigate to the branch that you created in the previous step.
Format:
git checkout <branch-name>
Example: git checkout temp1 Review the content of the PR locally using a code editor such as Visual Studio Code.
Make and save the changes locally. Format:
git add <file-path-or-folder-path>
git commit -m "<commit-message>"
Example: Let’s assume that you are updating some content related to the pages in the create-streaming-api folder.git add en/docs/design/create-api/create-streaming-api/
git commit -m "Revamping the streaming API content"- Send the changes to your remote GitHub repository.
Format:
git push <your-remote-branch> <local-branch-name>
Example:
git push Mariangela temp1
Navigate to your remote GitHub repository. You can type in the exact URL of your GitHub repository and navigate to it or follow the steps below.
View your remote references.
git remote -v
Press Ctrl and click on your remote repository link.
Select Open URL to access the link.
Close the original contributor's PR.
Create and send a new PR with the changes that you added. I would recommend that you add a link to the original contributor’s PR in your new PR.
[1] Original PR - | https://github.com/wso2/docs-apim/pull/4913 |
[2] New PR - | https://github.com/wso2/docs-apim/pull/4962 |
Asyngbelcomp-ga Nicole Hurt Visit
ReplyDeleteOne Commander 3.6.3.0
Microsoft Word 2016
Stardock Fences 4.0.7.2
chandstarinco