mirror of
https://github.com/silverstripe/silverstripe-docsviewer
synced 2024-10-22 09:05:56 +00:00
APICHANGE: upon the popular vote /docs/ for documentation rather than /doc/
This commit is contained in:
parent
aa2c0cadc3
commit
22549a2ab1
@ -3,7 +3,7 @@
|
|||||||
/**
|
/**
|
||||||
* Documentation Handler.
|
* Documentation Handler.
|
||||||
*
|
*
|
||||||
* Reads the bundled markdown files from doc/ folders and displays output in
|
* Reads the bundled markdown files from docs/ folders and displays output in
|
||||||
* a formatted page
|
* a formatted page
|
||||||
*
|
*
|
||||||
* @todo Tidy up template / styling
|
* @todo Tidy up template / styling
|
||||||
@ -62,7 +62,7 @@ class DocumentationViewer extends Controller {
|
|||||||
// see if docs folder is present
|
// see if docs folder is present
|
||||||
$subfolders = scandir(BASE_PATH .'/'. $module);
|
$subfolders = scandir(BASE_PATH .'/'. $module);
|
||||||
|
|
||||||
if($subfolders && in_array('doc', $subfolders)) {
|
if($subfolders && in_array('docs', $subfolders)) {
|
||||||
$readme = ($filename = $this->readmeExists($module)) ? "<a href='todo'>Read Me</a>" : false;
|
$readme = ($filename = $this->readmeExists($module)) ? "<a href='todo'>Read Me</a>" : false;
|
||||||
echo "<div class='box'><h2>". $module .' '. $readme."</h2>";
|
echo "<div class='box'><h2>". $module .' '. $readme."</h2>";
|
||||||
$this->generateNestedTree($module);
|
$this->generateNestedTree($module);
|
||||||
@ -106,7 +106,7 @@ class DocumentationViewer extends Controller {
|
|||||||
$base = Director::baseURL();
|
$base = Director::baseURL();
|
||||||
|
|
||||||
// find page
|
// find page
|
||||||
$path = BASE_PATH . '/'. $module .'/doc';
|
$path = BASE_PATH . '/'. $module .'/docs';
|
||||||
|
|
||||||
echo "<div id='LeftColumn'><div class='box'>";
|
echo "<div id='LeftColumn'><div class='box'>";
|
||||||
if($page = $this->findPage($path, $class)) {
|
if($page = $this->findPage($path, $class)) {
|
||||||
@ -225,7 +225,7 @@ class DocumentationViewer extends Controller {
|
|||||||
* @param String - module to generate
|
* @param String - module to generate
|
||||||
*/
|
*/
|
||||||
private function generateNestedTree($module) {
|
private function generateNestedTree($module) {
|
||||||
$path = BASE_PATH . '/'. $module .'/doc/';
|
$path = BASE_PATH . '/'. $module .'/docs/';
|
||||||
return (is_dir($path)) ? $this->recursivelyGenerateTree($path, $module) : false;
|
return (is_dir($path)) ? $this->recursivelyGenerateTree($path, $module) : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user