Skip to content

Commit bdd31d5

Browse files
Merge pull request #1 from erikdubbelboer/docs
Added doc generation
2 parents 52f1300 + d48cc6b commit bdd31d5

File tree

6 files changed

+68
-0
lines changed

6 files changed

+68
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
PHP Atomx Api
3+
=============
4+
5+
Interface for the atomx rest api.
6+
7+
For more information read the full [documentation online](https://www.atomx.com/atomx-api-php/),
8+
report bugs in [github](https://github.com/atomx/atomx-api-php>),
9+
or see the [atomx wiki](https://wiki.atomx.com/api)
10+

doc/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sami.phar
2+
build/
3+
cache/

doc/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
2+
generate:
3+
php sami.phar update config.php
4+
5+
deploy:
6+
rsync -avr --delete build/* /var/www/www.atomx.com/public/atomx-api-php/
7+
cp index.php /var/www/www.atomx.com/public/atomx-api-php/
8+
9+
.PHONY: build install
10+

doc/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
We use [Sami](https://github.com/FriendsOfPHP/Sami) to generate the documentation.
3+
4+
To generate:
5+
```bash
6+
$ cd doc
7+
$ make
8+
```
9+
10+
To deploy the generated documentation:
11+
```
12+
$ make deploy
13+
```
14+

doc/config.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
use Sami\Sami;
4+
use Sami\RemoteRepository\GitHubRemoteRepository;
5+
use Sami\Version\GitVersionCollection;
6+
use Symfony\Component\Finder\Finder;
7+
8+
$iterator = Finder::create()
9+
->files()
10+
->name('*.php')
11+
->in($dir = __DIR__.'/../Atomx')
12+
;
13+
14+
$versions = GitVersionCollection::create($dir)
15+
->add('master', 'master branch')
16+
;
17+
18+
return new Sami($iterator, array(
19+
'theme' => 'default',
20+
'versions' => $versions,
21+
'title' => 'Atomx API',
22+
'build_dir' => __DIR__.'/build/%version%',
23+
'cache_dir' => __DIR__.'/cache/%version%',
24+
'remote_repository' => new GitHubRemoteRepository('atomx/atomx-api-php', dirname($dir)),
25+
'default_opened_level' => 2,
26+
));
27+

doc/index.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
3+
header('Location: https://www.atomx.com/atomx-api-php/master/index.html');
4+

0 commit comments

Comments
 (0)