add pseudo de help doc

This commit is contained in:
Dennis Eichhorn 2020-06-25 19:41:45 +02:00
parent 6ee3528893
commit 6faf8fa959
4 changed files with 47 additions and 4 deletions

View File

@ -158,7 +158,7 @@ final class BackendController extends Controller
$summaryPath = __DIR__ . '/../../' . $request->getData('id') . '/Docs/Help/en/SUMMARY.md';
$devSummaryPath = __DIR__ . '/../../' . $request->getData('id') . '/Docs/Dev/en/SUMMARY.md';
$toParse = \file_get_contents($path);
$toParse = $path === '' ? '' : \file_get_contents($path);
$summary = \file_exists($summaryPath) ? \file_get_contents($summaryPath) : '';
$devSummary = \file_exists($devSummaryPath) ? \file_get_contents($devSummaryPath) : '';
@ -190,14 +190,26 @@ final class BackendController extends Controller
if ($request->getData('page') === 'table-of-contencts' || $request->getData('page') === null) {
$page = 'introduction';
} else {
$typePos = \stripos($request->getData('page'), '/');
$decoded = \urldecode($request->getData('page'));
$typePos = \stripos($decoded, '/');
$typePos = $typePos === false ? -1 : $typePos;
$page = \substr($request->getData('page'), $typePos + 1);
$type = \substr($request->getData('page'), 0, $typePos);
$page = \substr($decoded, $typePos + 1);
$type = \substr($decoded, 0, $typePos);
}
$basePath = __DIR__ . '/../../' . $request->getData('id') . '/Docs/' . $type . '/' . $request->getHeader()->getL11n()->getLanguage();
$path = \realpath($basePath . '/' . $page . '.md');
if ($path === false) {
$basePath = __DIR__ . '/../../' . $request->getData('id') . '/Docs/' . $type . '/' . $this->app->l11nServer->getLanguage();
$path = \realpath($basePath . '/' . $page . '.md');
}
if ($path === false) {
$basePath = __DIR__ . '/../../' . $request->getData('id') . '/Docs/' . $type . '/en';
$path = \realpath($basePath . '/' . $page . '.md');
}
if ($path === false) {
$path = \realpath($basePath . '/introduction.md');
}

3
Docs/Help/de/SUMMARY.md Normal file
View File

@ -0,0 +1,3 @@
# User Content
* [Documentation]({%}&page=Help/documentation)

View File

@ -0,0 +1,17 @@
# Documentation
A documentation can be added to every module by adding the `Docs/Help/{lang}` directory in the module. The language directory needs to be a 2 character ISO code. Inside of this directory you can add/find all the documentation files provided by the module.
Mandatory files are a `SUMMARY.md` file which contains the list of all documents and a `introduction.md` file which contains a general description of the module.
## SUMMARY.md example
```md
# Table of Contents
* [Link Name 1]({%}&page=Help/document_name_1)
* [Link Name 2]({%}&page=Help/document_name_2)
* [Link Name 3]({%}&page=Help/document_name_3)
```
![Directory Structure](Modules/Help/Docs/Help/img/directory_structure.png)

View File

@ -0,0 +1,11 @@
# Introduction
The **Help** module is one of the essential core modules that is always required. This module allows other modules to provide helpful documentation for users, administrators and developers.
## Target Group
The target group for this module is everyone.
# Setup
This module doesn't have any additional setup requirements since it is installed during the application install process. This module cannot be uninstalled if it is manually deleted from the hard drive please manually download the module from the page and put it into the `Modules/` directory.