Updated wiki.php to use parsedown
This commit is contained in:
parent
261791daec
commit
8a3e498b22
22
wiki.php
22
wiki.php
|
@ -1,10 +1,15 @@
|
|||
<?php
|
||||
/*
|
||||
This code is Copyright(c) 2019 by ubergeek under the GPL 3 or later.
|
||||
Parsedown is licensed under the MIT license.
|
||||
*/
|
||||
|
||||
include('config.php');
|
||||
include('parrsedown-1.7.3/Parsedown.php');
|
||||
include('parsedown-1.7.3/Parsedown.php');
|
||||
|
||||
$page = $_GET['page'];
|
||||
$style = $_GET['style'];
|
||||
$Parsedown = new Parsedown();
|
||||
|
||||
if ( $page == "") {
|
||||
$page = "main";
|
||||
|
@ -18,6 +23,11 @@ if ( $style == "") {
|
|||
else {
|
||||
$site_style=$style;
|
||||
}
|
||||
|
||||
$header = file_get_contents("$doc_root/includes/header.md");
|
||||
$sidebar = file_get_contents("$doc_root/includes/sidebar.md");
|
||||
$content = file_get_contents("$doc_root/articles/$page.md");
|
||||
$footer = file_get_contents("$doc_root/includes/footer.md");
|
||||
|
||||
print "<!DOCTYPE html>
|
||||
<html lang='en'>
|
||||
|
@ -30,7 +40,8 @@ print "<!DOCTYPE html>
|
|||
|
||||
<div id='header'>";
|
||||
|
||||
echo ( shell_exec("/usr/bin/pandoc $doc_root/includes/header.md") );
|
||||
print $Parsedown->text($header);
|
||||
|
||||
print "
|
||||
</div>
|
||||
<!-- End Header -->
|
||||
|
@ -42,7 +53,8 @@ print "<hr>
|
|||
<!-- Begin Sidebar -->
|
||||
<div id='sidebar'>
|
||||
";
|
||||
echo ( shell_exec("/usr/bin/pandoc $doc_root/includes/sidebar.md") );
|
||||
|
||||
echo $Parsedown->text($sidebar);
|
||||
|
||||
print " </div>
|
||||
<!-- End Sidebar -->
|
||||
|
@ -50,7 +62,7 @@ print " </div>
|
|||
<!-- Begin Body -->
|
||||
<div id='content'>";
|
||||
|
||||
echo ( shell_exec("/usr/bin/pandoc $doc_root/articles/$page.md") );
|
||||
echo $Parsedown->text($content);
|
||||
|
||||
print " </div>
|
||||
<!-- End Body -->
|
||||
|
@ -62,7 +74,7 @@ print " </div>
|
|||
<hr>
|
||||
";
|
||||
|
||||
echo ( shell_exec("/usr/bin/pandoc $doc_root/includes/footer.md") );
|
||||
echo $Parsedown->text($footer);
|
||||
|
||||
print " </div>
|
||||
<!-- End Footer -->
|
||||
|
|
Loading…
Reference in New Issue