forked from codeigniter4/CodeIgniter4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add apibot for API docs using phpDocumentor
- Loading branch information
Showing
6 changed files
with
93 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
# Rebuild and deploy all CodeIgniter4 docs | ||
# | ||
|
||
. admin/docbot $1 | ||
. admin/apibot $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters