From 1a558a95e0c8adf39d151af0c06070ff4411674b Mon Sep 17 00:00:00 2001 From: Jim Parry Date: Tue, 12 Mar 2019 13:45:20 -0700 Subject: [PATCH] Add apibot for API docs using phpDocumentor --- admin/alldocs | 7 +++++++ admin/apibot | 42 ++++++++++++++++++++++++++++++++++++++++++ admin/apibot.md | 36 ++++++++++++++++++++++++++++++++++++ admin/docbot | 2 +- admin/docbot.md | 6 ++++++ phpdoc.dist.xml | 2 +- 6 files changed, 93 insertions(+), 2 deletions(-) create mode 100755 admin/alldocs create mode 100755 admin/apibot create mode 100644 admin/apibot.md diff --git a/admin/alldocs b/admin/alldocs new file mode 100755 index 0000000000..12d0b410ff --- /dev/null +++ b/admin/alldocs @@ -0,0 +1,7 @@ +#!/bin/bash + +# Rebuild and deploy all CodeIgniter4 docs +# + +. admin/docbot $1 +. admin/apibot $1 \ No newline at end of file diff --git a/admin/apibot b/admin/apibot new file mode 100755 index 0000000000..75a0eb27b2 --- /dev/null +++ b/admin/apibot @@ -0,0 +1,42 @@ +#!/bin/bash + +# Rebuild and deploy CodeIgniter4 under-development user guide +# +# This is a quick way to test user guide changes, and if they +# look good, to push them to the gh-pages branch of the +# development repository. +# +# This is not meant for updating the "stable" user guide. + +UPSTREAM=https://github.com/codeigniter4/api.git + +# Prepare the nested repo clone folder +rm -rf build/api* +mkdir -p build/api/docs + +# Get ready for git +cd build/api +git init +git remote add origin $UPSTREAM +git fetch +git checkout master +git reset --hard origin/master +rm -r docs/* + +# Make the new user guide +cd ../.. +phpdoc +cp -R api/build/* build/api/docs + +# All done? +if [ $# -lt 1 ]; then + exit 0 +fi + +# Optionally update the remote repo +if [ $1 = "deploy" ]; then + cd build/api + git add . + git commit -S -m "APIbot synching" + git push -f origin master +fi \ No newline at end of file diff --git a/admin/apibot.md b/admin/apibot.md new file mode 100644 index 0000000000..ef22277069 --- /dev/null +++ b/admin/apibot.md @@ -0,0 +1,36 @@ +# apibot + +Builds & deploys API docs. + +The in-progress CI4 API docs, warts & all, are rebuilt and +then copied to a nested +repository clone (`build/api`), with the result +optionally pushed to the `master` branch of the `api` repo. +That would then be publically visible as the in-progress +version of the [API](https://codeigniter4.github.io/api/). + +## Requirements + +You must have phpDocumentor installed, with a `phpdoc` alias installed globally. + +## Audience + +This script is intended for use by framework maintainers, +i.e. someone with commit rights on the CI4 repository. + +You will be prompted for your github credentials and +GPG-signing key as appropriate. + +## Usage + +Inside a shell prompt, in the project root: + + `admin/apibot [deploy]` + +If "deploy" is not added, the script execution is considered +a trial run, and nothing is pushed to the repo. + +Whether or not deployed, the results are left inside +`build/api` (which is git ignored). + +Generate these and the userguide together with the 'alldocs' script. diff --git a/admin/docbot b/admin/docbot index 0d106547e6..c4dd8229c9 100755 --- a/admin/docbot +++ b/admin/docbot @@ -8,7 +8,7 @@ # # This is not meant for updating the "stable" user guide. -UPSTREAM=https://github.com/bcit-ci/CodeIgniter4.git +UPSTREAM=https://github.com/codeigniter4/CodeIgniter4.git # Prepare the nested repo clone folder cd user_guide_src diff --git a/admin/docbot.md b/admin/docbot.md index b61f72cfbf..f40b81a35d 100644 --- a/admin/docbot.md +++ b/admin/docbot.md @@ -8,6 +8,10 @@ optionally pushed to the `gh-pages` branch of the repo. That would then be publically visible as the in-progress version of the [User Guide](https://codeigniter4.github.io/CodeIgniter4/). +## Requirements + +You must have python & sphinx installed. + ## Audience This script is intended for use by framework maintainers, @@ -31,3 +35,5 @@ a trial run, and nothing is pushed to the repo. Whether or not deployed, the results are left inside user_guide_src/build (which is git ignored). + +Generate these and the API docs together with the 'alldocs' script. diff --git a/phpdoc.dist.xml b/phpdoc.dist.xml index ecc7529023..845154472b 100644 --- a/phpdoc.dist.xml +++ b/phpdoc.dist.xml @@ -1,6 +1,6 @@ - CodeIgniter v4.0.0 API + CodeIgniter v4.0 API api/data/