-
Notifications
You must be signed in to change notification settings - Fork 6
Making changes to published guides
(Written in Markdown but needs converting to Asciidoc for ease of editing.)
Found a mistake or something that could be clearer in one of the published guides? Here's how to make and publish a change.
Each Open Liberty guide lives in its own GitHub repository. For example, the Creating a RESTful web service guide lives in the openliberty/guide-rest-intro repository. In the repository is both the text of the guide (in the README.adoc) and the sample code (in the start
and finish
directories).
- On the GitHub.com website, fork the repository of the guide you want to edit:
- Log into your GitHub.com account.
- Find the repository for the guide (I'm using the REST guide as an example here).
- At the top of the page, click the Fork button. This creates a copy of the repository in your account. (Find out more about forks.)
- Clone the forked repository to your machine. In the terminal:
git clone https://github.com/lauracowen/guide-rest-intro.git
(replace this URL with the URL you get when you click the green Clone or download button on the repository's webpage). You should now have a directory calledguide-rest-intro
in your current location (/Users/laura/github/openliberty/openliberty.io/src/main/content/guides
). - In the terminal:
cd guide-rest-intro
. This is the guide. TheREADME.adoc
file contains the guide text. - Edit the README.adoc file using Asciidoc.
- Test your changes.
What? | Who? | How? |
---|---|---|
The guide transforms to HTML correctly without any errors only. | Author. | Install and run Asciidoctor |
The guide transforms to HTML correctly and the content looks right on the Open Liberty website. | Author or pull request reviewer. | Install and run a local test website |
Ideally, authors should take the second approach but the first approach is quicker to work with whilst editing, and there's slightly less setup involved.
When you're happy with how your changes look in the test site, you can create a pull request to push them back to the main GitHub repository.
- In a terminal in the guide you've been changing (e.g.
/Users/laura/github/openliberty/openliberty.io/src/main/content/guides/guide-rest-intro
), check the changes:git status
TheREADME.adoc
file should be listed as 'modified'. - Add the file to be committed:
git add README.adoc
- Commit the file in your local git version control:
git commit
then enter a description (or list) of why you made the changes (the changes themselves can be easily seen; a good commit message describes why). If you can't handle the default text editor, instead use the commandgit commit -m type_your_commit_message_here
but you can only provide a single line this way. - Create a new branch in your account:
git checkout -b branch_name
(where branch_name is your initials and a brief name for the branch; e.g.ljc_fixedtypos
). - Push the changes to GitHub:
git push origin ljc_fixedtypos
The file is now updated in your fork (copy) of the guide repository on GitHub.com. Click the Branch button on the repository page to switch frommaster
to your new branch to see the changes. - Create a pull request to the guide's repository, e.g.
openliberty/guide-rest-intro
: - On the repository page in your account (eg https://github.com/lauracowen/guide-rest-intro), click New Pull Request.
- Make sure the settings are
base fork: OpenLiberty/guide-rest-intro
,base: master
,head fork: lauracowen/guide-rest-intro
,base: ljc_fixedtypos
. - Check that the correct file and changes are included in the pull request, then enter a description of the changes you've made in the pull request.
- Add a reviewer to the pull request.
- Submit the pull request.
- Optionally, link your pull request to the issue(s) that it resolves. Feel free to create new issues as appropriate.
The reviewer will then be notified to review the changes. They might ask you to make some modifications. If they do, just make your changes locally and go through the git add
, git commit
, git push
steps again (use the same branch). I think the PR is automatically updated to include the changes...[check this]. When the reviewer is happy, they'll merge your changes into the master
branch of the guide. Next time the guide is built, the changes will be incorporated into the live website at http://openliberty.io/guides
. And you're done!