forked from pronamic/wp-documentor
-
Notifications
You must be signed in to change notification settings - Fork 1
/
markdown.php
58 lines (43 loc) · 1.03 KB
/
markdown.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
<?php
/**
* Markdown Template
*
* @link https://guides.github.com/features/mastering-markdown/
* @author Pronamic <info@pronamic.eu>
* @copyright 2005-2022 Pronamic
* @license GPL-3.0-or-later
* @package DigitalJoeCo\Leantime\Documentor
*/
namespace DigitalJoeCo\Leantime\Documentor;
if ( ! isset( $documentor ) ) {
return;
}
$actions = $documentor->get_actions();
$filters = $documentor->get_filters();
$eol = "\n";
echo '# Hooks', $eol;
echo $eol;
echo '- [Events](#events)', $eol;
echo '- [Filters](#filters)', $eol;
echo $eol;
echo '## Events', $eol;
echo $eol;
if ( empty( $actions ) ) {
echo '*This project does not contain any Leantime events.*', $eol;
echo $eol;
} else {
foreach ( $actions as $hook ) {
include __DIR__ . '/parts/markdown-hook.php';
}
}
echo '## Filters', $eol;
echo $eol;
if ( empty( $filters ) ) {
echo '*This project does not contain any Leantime filters.*', $eol;
echo $eol;
} else {
foreach ( $filters as $hook ) {
include __DIR__ . '/parts/markdown-hook.php';
}
}
echo $eol;