add parsedown for descriptions
This commit is contained in:
parent
26533a6bde
commit
5419bbf675
3 changed files with 13 additions and 4 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,5 +1,8 @@
|
|||
pile.db
|
||||
vendor
|
||||
docs
|
||||
|
||||
vendor
|
||||
_lib
|
||||
*.woff
|
||||
|
||||
error_log
|
||||
|
|
1
www/_lib/.htaccess
Normal file
1
www/_lib/.htaccess
Normal file
|
@ -0,0 +1 @@
|
|||
Deny from all
|
|
@ -1,12 +1,15 @@
|
|||
<?php
|
||||
require '_templates/Template.php';
|
||||
require '_util/PileDB.php';
|
||||
require '_lib/Parsedown.php';
|
||||
|
||||
$db = new PileDB();
|
||||
$pd = new Parsedown();
|
||||
session_start();
|
||||
|
||||
if (isset($_GET["item"])) {
|
||||
$doc = $db->fetchDoc($_GET["item"]);
|
||||
$doc["Description"] = $pd->text($doc["Description"]);
|
||||
|
||||
$doc_template = new Template();
|
||||
$doc_template->doc = $doc;
|
||||
|
@ -18,9 +21,11 @@ if (isset($_GET["item"])) {
|
|||
} elseif ($_GET["tag"] == "_") {
|
||||
$docs = $db->listDocs(-1);
|
||||
} else {
|
||||
$tag = $db->findTag($_GET["tag"]);
|
||||
$docs = $db->listDocs($tag["ID"]);
|
||||
$doc_list_template->tag = $db->fetchTag($tag["ID"]);
|
||||
$tagObj = $db->findTag($_GET["tag"]);
|
||||
$docs = $db->listDocs($tagObj["ID"]);
|
||||
$tag = $db->fetchTag($tagObj["ID"]);
|
||||
$tag["Description"] = $pd->text($tag["Description"]);
|
||||
$doc_list_template->tag = $tag;
|
||||
}
|
||||
$doc_list_template->docs = $docs;
|
||||
$content = $doc_list_template->render('front_doc_listing.php');
|
||||
|
|
Loading…
Reference in a new issue