forked from phpcoinn/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
50 lines (42 loc) · 1.18 KB
/
index.php
File metadata and controls
50 lines (42 loc) · 1.18 KB
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
<?php
require_once dirname(__DIR__)."/apps.inc.php";
require_once './Parsedown.php';
//error_reporting(E_ALL);
//ini_set('display_errors', 1);
class ParsedownExt extends Parsedown {
function inlineLink($Excerpt)
{
if (!isset($Excerpt['text'])) {
return null;
}
$link = parent::inlineLink($Excerpt);
if (!isset($link['element']['attributes']['href'])) {
return $link;
}
$link['element']['attributes']['href'] = "/apps/docs/index.php?link=".urlencode($link['element']['attributes']['href']);
return $link;
}
}
$docsDir = dirname(dirname(dirname(__DIR__)));
if(isset($_GET['link'])) {
$link = $_GET['link'];
$file = $docsDir.'/docs/' . $link;
} else {
$file = $docsDir.'/docs/index.md';
}
$pd = new ParsedownExt();
$pd->setSafeMode(true);
$text = file_get_contents($file);
define("PAGE", "Docs");
define("APP_NAME", "Docs");
?>
<?php
require_once __DIR__. '/../common/include/top.php';
?>
<ol class="breadcrumb m-0 ps-0 h4">
<li class="breadcrumb-item"><a href="/apps/docs">Home</a></li>
</ol>
<?php echo $pd->text($text); ?>
<?php
require_once __DIR__ . '/../common/include/bottom.php';
?>