mirror of
https://github.com/Karaka-Management/oms-Help.git
synced 2026-01-26 03:28:39 +00:00
impl. dev help documentation
This commit is contained in:
parent
5bc2a55186
commit
911e5e6810
|
|
@ -155,15 +155,18 @@ final class BackendController extends Controller
|
|||
$view = new View($this->app->l11nManager, $request, $response);
|
||||
$path = $this->getHelpModulePath($request);
|
||||
|
||||
$toParse = \file_get_contents($path);
|
||||
$summary = \file_get_contents(__DIR__ . '/../../' . $request->getData('id') . '/Docs/Help/en/SUMMARY.md');
|
||||
$toParse = \file_get_contents($path);
|
||||
$summary = \file_get_contents(__DIR__ . '/../../' . $request->getData('id') . '/Docs/Help/en/SUMMARY.md');
|
||||
$devSummary = \file_get_contents(__DIR__ . '/../../' . $request->getData('id') . '/Docs/Dev/en/SUMMARY.md');
|
||||
|
||||
$content = Markdown::parse($toParse === false ? '' : $toParse);
|
||||
$navigation = Markdown::parse($summary === false ? '' : $summary);
|
||||
$content = Markdown::parse($toParse === false ? '' : $toParse);
|
||||
$navigation = Markdown::parse($summary === false ? '' : $summary);
|
||||
$devNavigation = $devSummary === false ? null : Markdown::parse($devSummary);
|
||||
|
||||
$view->setTemplate('/Modules/Help/Theme/Backend/help-module');
|
||||
$view->setData('content', $content);
|
||||
$view->setData('navigation', $navigation);
|
||||
$view->setData('devNavigation', $devNavigation);
|
||||
|
||||
return $view;
|
||||
}
|
||||
|
|
@ -180,15 +183,18 @@ final class BackendController extends Controller
|
|||
*/
|
||||
private function getHelpModulePath(RequestAbstract $request) : string
|
||||
{
|
||||
$type = '';
|
||||
if ($request->getData('page') === 'table-of-contencts' || $request->getData('page') === null) {
|
||||
$page = 'introduction';
|
||||
} else {
|
||||
$page = $request->getData('page');
|
||||
$typePos = \stripos($request->getData('page'), '/');
|
||||
$page = \substr($request->getData('page'), $typePos + 1);
|
||||
$type = \substr($request->getData('page'), 0, $typePos);
|
||||
}
|
||||
|
||||
$path = \realpath(__DIR__ . '/../../' . $request->getData('id') . '/Docs/Help/en/' . $page . '.md');
|
||||
$path = \realpath(__DIR__ . '/../../' . $request->getData('id') . '/Docs/' . $type . '/' . $request->getHeader()->getL11n()->getLanguage() . '/' . $page . '.md');
|
||||
if ($path === false) {
|
||||
$path = \realpath(__DIR__ . '/../../' . $request->getData('id') . '/Docs/Help/en/introduction.md');
|
||||
$path = \realpath(__DIR__ . '/../../' . $request->getData('id') . '/Docs/' . $type . '/' . $request->getHeader()->getL11n()->getLanguage() . '/introduction.md');
|
||||
}
|
||||
|
||||
return $path === false ? '' : $path;
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
# Table of Contents
|
||||
# User Content
|
||||
|
||||
* [Documentation]({%}&page=documentation)
|
||||
* [Documentation]({%}&page=Help/documentation)
|
||||
|
|
@ -9,9 +9,9 @@ Mandatory files are a `SUMMARY.md` file which contains the list of all documents
|
|||
```md
|
||||
# Table of Contents
|
||||
|
||||
* [Link Name 1]({%}&page=document_name_1)
|
||||
* [Link Name 2]({%}&page=document_name_2)
|
||||
* [Link Name 3]({%}&page=document_name_3)
|
||||
* [Link Name 1]({%}&page=Help/document_name_1)
|
||||
* [Link Name 2]({%}&page=Help/document_name_2)
|
||||
* [Link Name 3]({%}&page=Help/document_name_3)
|
||||
```
|
||||
|
||||

|
||||
|
|
@ -17,5 +17,13 @@
|
|||
<?= $this->getData('navigation'); ?>
|
||||
</article>
|
||||
</section>
|
||||
|
||||
<?php if ($this->hasData('devNavigation')) : ?>
|
||||
<section class="box wf-100">
|
||||
<article>
|
||||
<?= $this->getData('devNavigation'); ?>
|
||||
</article>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user