Skip to content

Tech: How to update the JavaDocs

Sean Leary edited this page Mar 3, 2024 · 7 revisions

For now, the JSON-Java JavaDocs reside in the root directory of the gh-pages branch of the repository.

This branch is linked to the GitHub webpage via the GitHub Pages section in Settings. The GitHub pages content is taken from the / (root) directory of the gh-pages branch, and is published at http://stleary.github.io/JSON-java/

JavaDocs should be manually updated whenever the source JavaDocs are changed. For now, this is a manual step performed by the project owner when PRs are merged. To update the JavaDocs and link to the oracle v7 docs, execute these commands (assumes the project repo is in the JSON-Java directory):

cd <project directory>
git checkout master
git pull
git checkout gh-pages
git merge master
cd JSON-Java\src\main\java
javadoc -d \JSON-Java -link https://docs.oracle.com/javase/7/docs/api/ org.json
git add <all changed files>
git commit
git push 

Note that it can take up to an hour for the changes to be published.

At some point in the future, the JavaDocs will be generated on merge by an action in pipeline.xml.

For more information see:

https://github.blog/2016-08-22-publish-your-project-documentation-with-github-pages/

https://docs.github.com/en/free-pro-team@latest/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site