Fix RebuildLuceneDocsIndex to use new Markdown parser

Previously, it was attempting to use the already removed Markdown class.
Also some minor permission / indentation fixes.
This commit is contained in:
Stephen Shkardoon 2014-11-11 20:44:50 +13:00
parent e162891989
commit ab3e3f392a
5 changed files with 7 additions and 5 deletions

0
LICENSE Executable file → Normal file
View File

0
README.md Executable file → Normal file
View File

0
_config.php Executable file → Normal file
View File

View File

@ -21,7 +21,6 @@ class RebuildLuceneDocsIndex extends BuildTask {
}
function rebuildIndexes($quiet = false) {
require_once(DOCSVIEWER_PATH .'/thirdparty/markdown/markdown.php');
require_once 'Zend/Search/Lucene.php';
ini_set("memory_limit", -1);
@ -76,7 +75,10 @@ class RebuildLuceneDocsIndex extends BuildTask {
if(!is_dir($page->getPath())) {
$doc = new Zend_Search_Lucene_Document();
$content = $page->getMarkdown();
if($content) $content = Markdown($content);
if($content) {
$md = new ParsedownExtra();
$content = $md->text($content);
}
$entity = ($entity = $page->getEntity()) ? $entity->getTitle() : "";
@ -121,4 +123,4 @@ class RebuildLuceneDocusIndex_Hourly extends HourlyTask {
$reindex->rebuildIndexes(true);
}
}
}

View File

@ -18,6 +18,6 @@
"erusev/parsedown-extra": "0.1.0"
},
"suggest": {
"silverstripe/staticpublisher": "Allows publishing documentation as HTML"
}
"silverstripe/staticpublisher": "Allows publishing documentation as HTML"
}
}