mirror of
https://github.com/Karaka-Management/oms-Help.git
synced 2026-01-11 04:48:41 +00:00
more tests and some fixes
This commit is contained in:
parent
f820d00692
commit
59e7126b8d
9
.github/workflows/main.yml
vendored
9
.github/workflows/main.yml
vendored
|
|
@ -13,10 +13,15 @@ on:
|
|||
- cron: '0 0 1,15 * *'
|
||||
|
||||
jobs:
|
||||
general_module_workflow:
|
||||
general_module_workflow_php:
|
||||
uses: Karaka-Management/Karaka/.github/workflows/php_template.yml@develop
|
||||
secrets:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
general_module_workflow_js:
|
||||
uses: Karaka-Management/Karaka/.github/workflows/js_template.yml@develop
|
||||
secrets:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_PAT: ${{ secrets.GH_PAT }}
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
|
@ -72,6 +72,14 @@ final class BackendController extends Controller
|
|||
$head->addAsset(AssetType::JSLATE, 'Modules/Help/Controller/Controller.js?v=' . self::VERSION, ['nonce' => $nonce, 'type' => 'module']);
|
||||
}
|
||||
|
||||
private function loadMermaid(ResponseAbstract $response) : void
|
||||
{
|
||||
$head = $response->data['Content']->head;
|
||||
$nonce = $this->app->appSettings->getOption('script-nonce');
|
||||
|
||||
$head->addAsset(AssetType::JSLATE, 'Resources/mermaid/mermaid.min.js?v=' . $this->app->version, ['nonce' => $nonce]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Routing end-point for application behavior.
|
||||
*
|
||||
|
|
@ -274,10 +282,16 @@ final class BackendController extends Controller
|
|||
$toParse = \file_get_contents($path);
|
||||
$summary = \file_get_contents(__DIR__ . '/../../../Developer-Guide/SUMMARY.md');
|
||||
|
||||
$content = Markdown::parse($toParse === false ? '' : $toParse);
|
||||
if (\stripos($toParse, '```mermaid') !== false) {
|
||||
$this->loadMermaid($response);
|
||||
}
|
||||
|
||||
$markdown = new Markdown();
|
||||
|
||||
$content = $markdown->parse($toParse === false ? '' : $toParse);
|
||||
$navigation = Markdown::parse($summary === false ? '' : $summary);
|
||||
|
||||
$view->setTemplate('/Modules/Help/Theme/Backend/help-developer');
|
||||
$view->setTemplate('/Modules/Help/Theme/Backend/help-general');
|
||||
$view->data['content'] = $content;
|
||||
$view->data['navigation'] = $navigation;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { Autoloader } from '../../../jsOMS/Autoloader.js';
|
|||
|
||||
Autoloader.defineNamespace('omsApp.Modules');
|
||||
|
||||
/* global omsApp */
|
||||
omsApp.Modules.Help = class {
|
||||
/**
|
||||
* @constructor
|
||||
|
|
@ -13,17 +14,11 @@ omsApp.Modules.Help = class {
|
|||
this.app = app;
|
||||
};
|
||||
|
||||
bind (id)
|
||||
bind ()
|
||||
{
|
||||
const e = typeof id === 'undefined' ? document.getElementsByTagName('code') : [document.getElementById(id)],
|
||||
length = e.length;
|
||||
|
||||
/* global hljs */
|
||||
hljs.highlightAll();
|
||||
};
|
||||
|
||||
bindElement (code)
|
||||
{
|
||||
};
|
||||
};
|
||||
|
||||
window.omsApp.moduleManager.get('Help').bind();
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
<div class="row">
|
||||
<div class="col-xs-12 col-md-8 col-lg-9">
|
||||
<section class="portlet">
|
||||
<article>
|
||||
<?= $this->data['content']; ?>
|
||||
</article>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div class="col-xs-12 col-md-4 col-lg-3 pH">
|
||||
<section class="portlet">
|
||||
<article>
|
||||
<?= $this->data['navigation']; ?>
|
||||
</article>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -9,9 +9,9 @@
|
|||
|
||||
<div class="col-xs-12 col-md-4 col-lg-3 pH">
|
||||
<section class="portlet">
|
||||
<article>
|
||||
<nav class="content-side-nav">
|
||||
<?= $this->data['navigation']; ?>
|
||||
</article>
|
||||
</nav>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -18,17 +18,13 @@
|
|||
|
||||
<?php if (!empty($this->data['navigation'] ?? '')) : ?>
|
||||
<section class="portlet">
|
||||
<div class="portlet-body">
|
||||
<article><?= $this->data['navigation']; ?></article>
|
||||
</div>
|
||||
<nav class="content-side-nav"><?= $this->data['navigation']; ?></nav>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($this->data['devNavigation'] ?? '')) : ?>
|
||||
<section class="portlet">
|
||||
<div class="portlet-body">
|
||||
<article><?= $this->data['devNavigation']; ?></article>
|
||||
</div>
|
||||
<nav class="content-side-nav"><?= $this->data['devNavigation']; ?></nav>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user