Skip to content

Commit

Permalink
Merge #29 - Fixes #27 - documentation is not building
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Jul 19, 2020
2 parents 802b49b + 60992f3 commit bcaccbe
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 44 deletions.
10 changes: 5 additions & 5 deletions develdocs/build.sh
Expand Up @@ -20,14 +20,14 @@ for repo in phpmyadmin sql-parser motranslator shapefile simple-math ; do
# Clean output
rm -rf "$BUILDER_REPO/develdocs/output/$repo/"
# Generate config file
nice -19 "$BUILDER_REPO/develdocs/sami.php" \
nice -19 "$BUILDER_REPO/develdocs/doctum.php" \
--root "$BUILDER_ROOT/$repo" \
--build-dir "$BUILDER_REPO/develdocs/output/$repo/" \
--cache-dir "$BUILDER_REPO/develdocs/tmp/$repo/" \
--output-config "$BUILDER_REPO/develdocs/sami-$repo.php" \
--title-of-composer
--slug "phpmyadmin/$repo" \
--output-config "$BUILDER_REPO/develdocs/doctum-$repo.php"
# Render
nice -19 "$BUILDER_REPO/develdocs/vendor/bin/sami.php" update "$BUILDER_REPO/develdocs/sami-$repo.php"
nice -19 "$BUILDER_REPO/develdocs/vendor/bin/doctum.php" update "$BUILDER_REPO/develdocs/doctum-$repo.php"
# Delete config file
rm "$BUILDER_REPO/develdocs/sami-$repo.php"
rm "$BUILDER_REPO/develdocs/doctum-$repo.php"
done
2 changes: 1 addition & 1 deletion develdocs/composer.json
@@ -1,5 +1,5 @@
{
"require": {
"sami/sami": "^4.0"
"code-lts/doctum": "^5.0"
}
}
47 changes: 47 additions & 0 deletions develdocs/doctum.php
@@ -0,0 +1,47 @@
#!/usr/bin/php
<?php
$_CLI = getopt('', ['slug:', 'root:', 'build-dir:', 'cache-dir:', 'output-config:', 'title::', 'title-of-composer']);

$SOURCE = 'src';

if (is_dir($_CLI['root'] . '/src') === false) {
$SOURCE = 'libraries';
}

$output = <<<'EOT'
<?php
/**
* This file has been generated by phpmyadmin/scripts/develdocs/build.sh
* @see https://github.com/phpmyadmin/scripts/blob/master/develdocs/doctum.php
* @see https://github.com/phpmyadmin/scripts/blob/master/develdocs/build.sh
*/
use Doctum\Doctum;
use Symfony\Component\Finder\Finder;
use Doctum\RemoteRepository\GitHubRemoteRepository;
$iterator = Finder::create()
->files()
->name('*.php')
->in('%s');
return new Doctum($iterator, [
'title' => json_decode(file_get_contents('%s'))->description,
'build_dir' => '%s',
'cache_dir' => '%s',
'remote_repository' => new GitHubRemoteRepository('%s', '%s'),
]);
EOT;

$root = rtrim($_CLI['root'], '/') . '/';

$output = sprintf(
$output,
$root . $SOURCE,
$root . 'composer.json',
$_CLI['build-dir'],
$_CLI['cache-dir'],
$_CLI['slug'],
$root
);

file_put_contents($_CLI['output-config'], $output);
38 changes: 0 additions & 38 deletions develdocs/sami.php

This file was deleted.

0 comments on commit bcaccbe

Please sign in to comment.