mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
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:
parent
e162891989
commit
ab3e3f392a
0
_config.php
Executable file → Normal file
0
_config.php
Executable file → Normal file
@ -21,7 +21,6 @@ class RebuildLuceneDocsIndex extends BuildTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function rebuildIndexes($quiet = false) {
|
function rebuildIndexes($quiet = false) {
|
||||||
require_once(DOCSVIEWER_PATH .'/thirdparty/markdown/markdown.php');
|
|
||||||
require_once 'Zend/Search/Lucene.php';
|
require_once 'Zend/Search/Lucene.php';
|
||||||
|
|
||||||
ini_set("memory_limit", -1);
|
ini_set("memory_limit", -1);
|
||||||
@ -76,7 +75,10 @@ class RebuildLuceneDocsIndex extends BuildTask {
|
|||||||
if(!is_dir($page->getPath())) {
|
if(!is_dir($page->getPath())) {
|
||||||
$doc = new Zend_Search_Lucene_Document();
|
$doc = new Zend_Search_Lucene_Document();
|
||||||
$content = $page->getMarkdown();
|
$content = $page->getMarkdown();
|
||||||
if($content) $content = Markdown($content);
|
if($content) {
|
||||||
|
$md = new ParsedownExtra();
|
||||||
|
$content = $md->text($content);
|
||||||
|
}
|
||||||
|
|
||||||
$entity = ($entity = $page->getEntity()) ? $entity->getTitle() : "";
|
$entity = ($entity = $page->getEntity()) ? $entity->getTitle() : "";
|
||||||
|
|
||||||
@ -121,4 +123,4 @@ class RebuildLuceneDocusIndex_Hourly extends HourlyTask {
|
|||||||
|
|
||||||
$reindex->rebuildIndexes(true);
|
$reindex->rebuildIndexes(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,6 @@
|
|||||||
"erusev/parsedown-extra": "0.1.0"
|
"erusev/parsedown-extra": "0.1.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
"silverstripe/staticpublisher": "Allows publishing documentation as HTML"
|
"silverstripe/staticpublisher": "Allows publishing documentation as HTML"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user