mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
Add markdown transformation in HTML output, fix Markdown formatter
This commit is contained in:
parent
a0a9170d1c
commit
3ec87522b2
@ -27,13 +27,8 @@ class MarkdownFormatter extends AbstractFormatter
|
|||||||
$markdown .= "\n\n";
|
$markdown .= "\n\n";
|
||||||
|
|
||||||
if (isset($data['documentation']) && !empty($data['documentation'])) {
|
if (isset($data['documentation']) && !empty($data['documentation'])) {
|
||||||
$markdown .= "#### Documentation ####\n\n";
|
$markdown .= $data['documentation'];
|
||||||
|
$markdown .= "\n\n";
|
||||||
foreach (explode("\n", $data['documentation']) as $line) {
|
|
||||||
$markdown .= " " . $line . "\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$markdown .= "\n";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($data['requirements']) && !empty($data['requirements'])) {
|
if (isset($data['requirements']) && !empty($data['requirements'])) {
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<div class="pane content selected">
|
<div class="pane content selected">
|
||||||
{% if data.documentation is defined and data.documentation is not empty %}
|
{% if data.documentation is defined and data.documentation is not empty %}
|
||||||
<h4>Documentation</h4>
|
<h4>Documentation</h4>
|
||||||
<pre>{{ data.documentation }}</pre>
|
<p>{{ data.documentation|markdown }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if data.requirements is defined and data.requirements is not empty %}
|
{% if data.requirements is defined and data.requirements is not empty %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user