generated from MarwanAlsoltany/php-package
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.doctum.dist.php
64 lines (57 loc) · 2.06 KB
/
.doctum.dist.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php
use Doctum\Doctum;
use Doctum\Parser\Filter\TrueFilter;
use Doctum\Version\GitVersionCollection;
use Doctum\RemoteRepository\GitHubRemoteRepository;
use Symfony\Component\Finder\Finder;
$finder = (new Finder())
->in([
__DIR__ . '/src',
])
->exclude([
__DIR__ . '/tests',
__DIR__ . '/vendor',
])
->files()
->name('/\.php$/')
->notName('/\.html\.php$/');
Doctum::$defaultVersionName = 'master';
return new Doctum($finder, getConfig());
function getConfig(): array {
$owner = 'MarwanAlsoltany';
$repo = 'mighty';
$filter = new TrueFilter();
$remote = new GitHubRemoteRepository(implode('/', [$owner, $repo]), __DIR__);
$versions = new GitVersionCollection(__DIR__ . '/src');
$versions
->addFromTags('v1.*.*')
->add('master', 'Upstream (master)')
->setFilter(fn () => true);
return [
'base_url' => "https://{$owner}.github.io/{$repo}",
'title' => 'Mighty API Docs',
'favicon' => null,
'language' => 'en',
'filter' => $filter,
// 'versions' => $versions,
'remote_repository' => $remote,
'build_dir' => __DIR__ . '/build/doctum',
'cache_dir' => __DIR__ . '/build/doctum/.cache',
'source_dir' => __DIR__ . '/src',
'default_opened_level' => 2,
'sort_class_properties' => true,
'sort_class_methods' => true,
'sort_class_constants' => true,
'sort_class_traits' => true,
'include_parent_data' => true,
'insert_todos' => false,
'footer_link' => [
'href' => "https://github.com/{$owner}/{$repo}",
'rel' => 'noreferrer noopener',
'target' => '_blank',
'before_text' => 'Want to learn more about Mighty? Click ',
'link_text' => 'here',
'after_text' => 'to view the source code on GitHub!',
],
];
}