Use Doctum instead of Sami (#761)

* Use Doctum instead of Sami

- Fix .gitignore
- Move the process to docs
- Add .gitattributes

* Fix the symfony/process versions after sami was removed

Used the maximum version of 2.x and forced 3.3 before deprecation in 3.4
This commit is contained in:
William Desportes 2020-10-12 16:04:21 +02:00 committed by GitHub
commit 6a61d67288
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 48 additions and 23 deletions

4
.gitattributes vendored Normal file
View file

@ -0,0 +1,4 @@
.gitattributes export-ignore
.gitignore export-ignore
.github export-ignore
docs export-ignore

3
.gitignore vendored
View file

@ -6,6 +6,7 @@ composer.lock
phpunit.xml
.phpunit.result.cache
/tests/Functional/output/output-*
sami.phar
/docs/doctum.phar
/docs/source/API/API/cache/twig/*
.idea/
/phpunit

View file

@ -1,20 +0,0 @@
<?php
include 'vendor/autoload.php';
use Sami\Sami;
use Symfony\Component\Finder\Finder;
$iterator = Finder::create()
->files()
->name('*.php')
->in($dir = 'src')
;
return new Sami($iterator, array(
'title' => 'PHP-FFMpeg API',
'theme' => 'enhanced',
'build_dir' => __DIR__.'/docs/source/API/API',
'cache_dir' => __DIR__.'/docs/source/API/API/cache',
'default_opened_level' => 2,
));

View file

@ -42,9 +42,9 @@
"php-ffmpeg/extras": "A compilation of common audio & video drivers for PHP-FFMpeg"
},
"require-dev": {
"sami/sami": "~1.0",
"silex/silex": "~1.0",
"symfony/phpunit-bridge": "^5.0.4"
"symfony/phpunit-bridge": "^5.0.4",
"symfony/process": "2.8 || 3.3"
},
"autoload": {
"psr-0": {

15
docs/doctum.php Normal file
View file

@ -0,0 +1,15 @@
<?php
use Doctum\Doctum;
use Symfony\Component\Finder\Finder;
$iterator = Finder::create()
->files()
->name('*.php')
->in(__DIR__.'/../src/');
return new Doctum($iterator, [
'title' => 'PHP-FFMpeg API',
'build_dir' => __DIR__.'/source/API/API',
'cache_dir' => __DIR__.'/source/API/API/cache',
]);

25
docs/generate-docs.sh Executable file
View file

@ -0,0 +1,25 @@
#!/bin/bash
set -e
SELF_DIR=$(dirname $0)
cd ${SELF_DIR}
rm -f doctum.phar
rm -f doctum.phar.sha256
# Download the latest (5.1.x) release if the file does not exist
# Remove it to update your phar
curl -o doctum.phar https://doctum.long-term.support/releases/5.1/doctum.phar
curl -o doctum.phar.sha256 https://doctum.long-term.support/releases/5.1/doctum.phar.sha256
sha256sum --strict --check doctum.phar.sha256
rm doctum.phar.sha256
# You can fetch the latest (5.1.x) version code here:
# https://doctum.long-term.support/releases/5.1/VERSION
# Show the version to inform users of the script
php doctum.phar --version
php doctum.phar update --force --ignore-parse-errors doctum.php -v