Skip to content

Commit

Permalink
Replace Sami by Doctum
Browse files Browse the repository at this point in the history
  • Loading branch information
williamdes committed Sep 11, 2020
1 parent 8f8cdfb commit 11264c6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ generator/*
util/elasticsearch/
util/cache/

# Sami docs generator
/sami.phar
# Doctum docs generator
/doctum.phar

# PHPUnit
/phpunit.xml
Expand Down
12 changes: 6 additions & 6 deletions util/docsConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @copyright Copyright (c) Elasticsearch B.V (https://www.elastic.co)
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/lgpl-2.1.html GNU Lesser General Public License, Version 2.1
*
*
* Licensed to Elasticsearch B.V under one or more agreements.
* Elasticsearch B.V licenses this file to you under the Apache 2.0 License or
* the GNU Lesser General Public License, Version 2.1, at your option.
Expand All @@ -16,18 +16,18 @@

declare(strict_types = 1);

use Sami\Sami;
use Doctum\Doctum;
use Symfony\Component\Finder\Finder;

$iterator = Finder::create()
->files()
->name('*Namespace.php')
->name("Client.php")
->name("ClientBuilder.php")
->notName("AbstractNamespace.php")
->name('Client.php')
->name('ClientBuilder.php')
->notName('AbstractNamespace.php')
->in(__DIR__.'/../src/');

return new Sami($iterator, [
return new Doctum($iterator, [
'theme' => 'asciidoc',
'template_dirs' => [__DIR__.'/docstheme/'],
'title' => 'Elasticsearch-php',
Expand Down
22 changes: 20 additions & 2 deletions util/generate_docs.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
#!/usr/bin/env bash

curl -O http://get.sensiolabs.org/sami.phar
php sami.phar update --force -v util/docsConfig.php
set -e

# Clean the files just in case
rm -f doctum.phar
rm -f doctum.phar.sha256

# Download the latest (5.1.x) release
curl -O https://doctum.long-term.support/releases/5.1/doctum.phar
curl -O https://doctum.long-term.support/releases/5.1/doctum.phar.sha256

sha256sum --strict --check doctum.phar.sha256
rm -f 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

# Only exit if the process fails, not if parse errors are found
php doctum.phar update --force --ignore-parse-errors -v util/docsConfig.php

0 comments on commit 11264c6

Please sign in to comment.