Edit an article
Get SuperOfficeDocs running locally: To edit an article, you need to get SuperOfficeDocs running locally on your machine.
Markdown: Docs uses markdown syntax to format content. Markdown is simple to pick up on. Familiarize yourself with the Markdown Guide to DocFx before making updates to content.
Now that you've gotten SuperOfficeDocs running locally (congrats BTW!), we will talk through the steps for making an edit, previewing the edit, pushing it to your forked repo, then creating a pull request.
How to edit and preview content
Fork the SuperOfficeDocs repo into your own repo.
Set your remote repositories. We will use the terms upstream and origin. When you originally cloned the repo (in the pre-requisites), the
originwas added for you implicitly.
git remote add upstream https://github.com/SuperOfficeDocs/superoffice-docsto add the main SuperOffice Docs repo as your upstream repo.
Remotes can be named anything you like. Find out your remotes by typing
git remote -v.
git remote -vto list your remotes. If you are new to Git, you should have 2 remotes:
originis your forked repo
upstreamis the main SuperOfficeDocs repo
Create an issue on GitHub that corresponds with the edit you're working on by clicking the New Issue button in the browser. Be sure to include relevant information providing context to the issue in the description or comment section. This helps reviewers understand what you're working on.
Make note of the issue number that GitHub generates.
Create a new branch for your work. Typically branch names align with the issue number for ease of tracking.
Example branch name:
Example Git command to create new branch:
git checkout -b issue-107
Make your edits.
Preview your work locally by invoking the
docfx --servein your terminal (in VS Code, Powershell, or similar). This will run SuperOfficeDocs locally on your machine at a URL similar to this
localhost:8080. Click the link or copy and paste it into your browser.
When you are happy with your changes, you can move on to pushing it to your forked repo and creating a pull request.
How to commit and share
git statusto review the files you are working on and ensure the proper files are being tracked.
git add [INSERT FILE NAME]to stage a single file or
git add .to stage all modified files to be committed.
git commit -m [INSERT YOUR COMMIT MESSAGE HERE]to commit your files. The
-mstands for message. Replace the INSERT YOUR COMMIT MESSAGE HERE text with brief and relevant text summarizing your commit. Remember to include the issue ID!
git push origin [INSERT A NEW BRANCH NAME HERE]to push your updated files to your repo. Replace the INSERT A NEW BRANCH NAME HERE with the name of your new branch.
Go to your forked GitHub repo on GitHub.com. GitHub should detect the updated code and prompt you to make a pull request.
Create a pull request by clicking the Compare and create pull request button. In the description or comments section be sure to include the text "Resolves
#[INSERT ISSUE NUMBER HERE]where your previously created issue number is associated with this pull request.
Want more info on Git? Check out the free, online GitBook.