diff --git a/.sami.php b/.sami.php new file mode 100644 index 00000000..9a2fca35 --- /dev/null +++ b/.sami.php @@ -0,0 +1,24 @@ +files() + ->name('*.php') + ->in($dir = __DIR__ . '/src'); +$versions = GitVersionCollection::create($dir) + ->addFromTags(function ($version) { + return preg_match('~^\d+\.\d+\.\d+$~', $version); + }) + ->add('master'); + +return new Sami($iterator, [ + 'title' => 'PhpSpreadsheet', + 'versions' => $versions, + 'build_dir' => __DIR__ . '/build/%version%', + 'cache_dir' => __DIR__ . '/cache/%version%', + 'remote_repository' => new GitHubRemoteRepository('PHPOffice/PhpSpreadsheet', dirname($dir)), +]); diff --git a/.travis.yml b/.travis.yml index 463f195a..de08a728 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,3 +38,20 @@ jobs: after_script: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover tests/coverage-clover.xml + + - stage: API documentation + before_script: + - curl -O http://get.sensiolabs.org/sami.phar + script: + - git fetch origin master:master + - git fetch origin --tags + - php sami.phar update .sami.php + - echo '

If you are not automatically redirected, please go to the latest stable API documentation.

' > build/index.html + deploy: + provider: pages + skip-cleanup: true + local-dir: docs + github-token: $GITHUB_TOKEN + on: + all_branches: true + condition: $TRAVIS_BRANCH =~ ^master|develop$ diff --git a/README.md b/README.md index 0a138d72..e63e26e3 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,7 @@ PhpSpreadsheet is a library written in pure PHP and providing a set of classes t ## Documentation -Read more about it, including install instructions, in the official documentation: - -https://phpspreadsheet.readthedocs.io +Read more about it, including install instructions, in the [official documentation](https://phpspreadsheet.readthedocs.io). Or check out the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). Please ask your support questions on [StackOverflow](http://stackoverflow.com/questions/tagged/phpspreadsheet), or have a quick chat on [Gitter](https://gitter.im/PHPOffice/PhpSpreadsheet). diff --git a/docs/topics/recipes.md b/docs/topics/recipes.md index 0c6c3139..a70411cb 100644 --- a/docs/topics/recipes.md +++ b/docs/topics/recipes.md @@ -3,12 +3,12 @@ The following pages offer you some widely-used PhpSpreadsheet recipes. Please note that these do NOT offer complete documentation on specific PhpSpreadsheet API functions, but just a bump to get you started. If you -need specific API functions, please refer to the API documentation. +need specific API functions, please refer to the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). For example, [setting a worksheet's page orientation and size ](#setting-a-worksheets-page-orientation-and-size) covers setting a page orientation to A4. Other paper formats, like US Letter, are not covered -in this document, but in the PhpSpreadsheet API documentation. +in this document, but in the PhpSpreadsheet [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master). ## Setting a spreadsheet's metadata @@ -301,7 +301,7 @@ $spreadsheet->getActiveSheet()->getPageSetup() ``` Note that there are additional page settings available. Please refer to -the API documentation for all possible options. +the [API documentation](https://phpoffice.github.io/PhpSpreadsheet/master) for all possible options. ### Page Setup: Scaling options