Skip to content

Commit 1a558a9

Browse files
committed
Add apibot for API docs using phpDocumentor
1 parent 895ae04 commit 1a558a9

6 files changed

Lines changed: 93 additions & 2 deletions

File tree

admin/alldocs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# Rebuild and deploy all CodeIgniter4 docs
4+
#
5+
6+
. admin/docbot $1
7+
. admin/apibot $1

admin/apibot

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
# Rebuild and deploy CodeIgniter4 under-development user guide
4+
#
5+
# This is a quick way to test user guide changes, and if they
6+
# look good, to push them to the gh-pages branch of the
7+
# development repository.
8+
#
9+
# This is not meant for updating the "stable" user guide.
10+
11+
UPSTREAM=https://github.com/codeigniter4/api.git
12+
13+
# Prepare the nested repo clone folder
14+
rm -rf build/api*
15+
mkdir -p build/api/docs
16+
17+
# Get ready for git
18+
cd build/api
19+
git init
20+
git remote add origin $UPSTREAM
21+
git fetch
22+
git checkout master
23+
git reset --hard origin/master
24+
rm -r docs/*
25+
26+
# Make the new user guide
27+
cd ../..
28+
phpdoc
29+
cp -R api/build/* build/api/docs
30+
31+
# All done?
32+
if [ $# -lt 1 ]; then
33+
exit 0
34+
fi
35+
36+
# Optionally update the remote repo
37+
if [ $1 = "deploy" ]; then
38+
cd build/api
39+
git add .
40+
git commit -S -m "APIbot synching"
41+
git push -f origin master
42+
fi

admin/apibot.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# apibot
2+
3+
Builds & deploys API docs.
4+
5+
The in-progress CI4 API docs, warts & all, are rebuilt and
6+
then copied to a nested
7+
repository clone (`build/api`), with the result
8+
optionally pushed to the `master` branch of the `api` repo.
9+
That would then be publically visible as the in-progress
10+
version of the [API](https://codeigniter4.github.io/api/).
11+
12+
## Requirements
13+
14+
You must have phpDocumentor installed, with a `phpdoc` alias installed globally.
15+
16+
## Audience
17+
18+
This script is intended for use by framework maintainers,
19+
i.e. someone with commit rights on the CI4 repository.
20+
21+
You will be prompted for your github credentials and
22+
GPG-signing key as appropriate.
23+
24+
## Usage
25+
26+
Inside a shell prompt, in the project root:
27+
28+
`admin/apibot [deploy]`
29+
30+
If "deploy" is not added, the script execution is considered
31+
a trial run, and nothing is pushed to the repo.
32+
33+
Whether or not deployed, the results are left inside
34+
`build/api` (which is git ignored).
35+
36+
Generate these and the userguide together with the 'alldocs' script.

admin/docbot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#
99
# This is not meant for updating the "stable" user guide.
1010

11-
UPSTREAM=https://github.com/bcit-ci/CodeIgniter4.git
11+
UPSTREAM=https://github.com/codeigniter4/CodeIgniter4.git
1212

1313
# Prepare the nested repo clone folder
1414
cd user_guide_src

admin/docbot.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ optionally pushed to the `gh-pages` branch of the repo.
88
That would then be publically visible as the in-progress
99
version of the [User Guide](https://codeigniter4.github.io/CodeIgniter4/).
1010

11+
## Requirements
12+
13+
You must have python & sphinx installed.
14+
1115
## Audience
1216

1317
This script is intended for use by framework maintainers,
@@ -31,3 +35,5 @@ a trial run, and nothing is pushed to the repo.
3135

3236
Whether or not deployed, the results are left inside
3337
user_guide_src/build (which is git ignored).
38+
39+
Generate these and the API docs together with the 'alldocs' script.

phpdoc.dist.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<phpdoc>
3-
<title>CodeIgniter v4.0.0 API</title>
3+
<title>CodeIgniter v4.0 API</title>
44
<parser>
55
<target>api/data/</target>
66
</parser>

0 commit comments

Comments
 (0)