Skip to content

Commit 63cf06b

Browse files
committed
Updated documentation generation.
1 parent a9f12d8 commit 63cf06b

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

src/doc/config/menu.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
{
1212
// Remove _xN, _mono, _stereo, _midi, _do, _ls, _ms postfixes from plugin name
1313
$page_id = preg_replace('/(?:_x\d+)?(?:_midi)?(?:_mono|_stereo|_do|_lr|_ms)?$/', '', $plugin['id']);
14-
def_menu_item('plugins', $plugin['id'], $plugin['description'] . ' - ' . $plugin['name'], $page_id);
14+
def_menu_item('plugins', $plugin['id'], $plugin['description'], $page_id);
1515
}
1616

1717
def_menu_item('', 'tutorials', 'Tutorials and Tips');

src/doc/inc/files.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ function file_emit_line(&$state, $line = '', $tag = null)
55
if (count($s) <= 0)
66
return;
77

8-
if ((!isset($tag)) || ($tag == null))
9-
$tag = $s;
8+
if (!isset($tag))
9+
$tag = end($s);
1010

11-
print('<' . end($tag) . '>');
11+
print('<' . $tag . '>');
1212
print(htmlspecialchars($state['line'] . $line));
1313
$state['line'] = '';
14-
print('</' . end($tag) . ">\n");
14+
print('</' . $tag . ">\n");
1515

1616
array_pop($s);
1717
}
@@ -79,13 +79,12 @@ function file_process_string(&$state, $line)
7979
}
8080
elseif ($last == 'pre-q')
8181
{
82-
if (!preg_match('/^```.*$/', $line, $match))
82+
if (preg_match('/^```.*$/', $line, $match))
8383
{
8484
file_emit_line($state, "", "pre");
85-
$state['unget'] = null;
8685
}
8786
else
88-
file_append_line($state, $match[1] . "\n");
87+
file_append_line($state, $line . "\n");
8988
}
9089
else
9190
{
@@ -122,7 +121,7 @@ function file_content($file, $section = null)
122121
else
123122
{
124123
$pattern = '/^\={1,}\s*' . $section . '\s*\={1,}\s*$/i';
125-
$pattern2 = '/^#{1,}\s*' . $section . '\s*$/i';
124+
$pattern2 = '/^\#{1,}\s*' . $section . '\s*$/i';
126125
$search = true;
127126
$state = array(
128127
'line' => '',
@@ -133,19 +132,20 @@ function file_content($file, $section = null)
133132
while ((isset($state['unget'])) || (!feof($fd)))
134133
{
135134
$line = isset($state['unget']) ? $state['unget'] : fgets($fd);
135+
$state['unget'] = null;
136+
136137
if ($search)
137138
{
138139
if (preg_match($pattern, $line))
139140
$search = false;
140-
elseif (preg_match($pattern, $line))
141+
elseif (preg_match($pattern2, $line))
141142
$search = false;
142143
}
143144
else
144145
{
145-
$state['unget'] = null;
146146
if (preg_match('/^\={1,}\s*.+\s*\={1,}\s*$/', $line))
147147
break;
148-
if (preg_match('/^#{1,}\s*.+$/', $line))
148+
if (preg_match('/^\#{1,}\s*.+$/', $line))
149149
break;
150150

151151
file_process_string($state, $line);

src/doc/inc/plugins.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ function sort_plugins()
1616

1717
function plugin_header()
1818
{
19-
global $PLUGINS, $PAGE, $DOCROOT;
19+
global $PACKAGE, $PLUGINS, $PAGE, $DOCROOT;
2020

2121
// Output plugin
2222
foreach ($PLUGINS as $plugin)
2323
{
2424
if ($plugin['id'] != $PAGE)
2525
continue;
2626

27-
echo "<h1>" . $plugin['name'] . "</h1>\n";
27+
echo "<h1>" . htmlspecialchars($plugin['description']) . "</h1>\n";
2828

2929
$fmt = array();
3030
if (isset($plugin['ladspa_label']) && ($plugin['ladspa_label'] > 0))
@@ -36,11 +36,14 @@ function plugin_header()
3636
if (isset($plugin['vst2_uid']) && (strlen($plugin['vst2_uid']) > 0))
3737
array_push($fmt, 'JACK');
3838

39+
$full_name = htmlspecialchars("{$PACKAGE['short']} {$plugin['description']} ({$plugin['acronym']})");
40+
$author = htmlspecialchars($plugin['author']);
41+
3942
echo "<img class=\"plugin\" src=\"${DOCROOT}img/plugins/{$plugin['id']}.png\" alt=\"{$plugin['name']}\">\n";
40-
echo "<p><b>Detailed:&nbsp;</b>LSP {$plugin['description']} - {$plugin['name']} ({$plugin['acronym']})</p>\n";
43+
echo "<p><b>Detailed:&nbsp;</b>{$full_name}</p>\n";
4144
echo "<p><b>Formats:&nbsp;</b>" . implode(',&nbsp;', $fmt) . "</p>\n";
4245
echo "<p><b>Categories:&nbsp;</b>" . implode(',&nbsp;', $plugin['groups']) . "</p>\n";
43-
echo "<p><b>Developer:&nbsp;</b>{$plugin['author']}</p>\n";
46+
echo "<p><b>Developer:&nbsp;</b>{$author}</p>\n";
4447
echo "<p><b>Description:&nbsp;</b></p>\n";
4548
break;
4649
}
@@ -54,12 +57,13 @@ function out_image($id, $alt)
5457

5558
function plugin_ref($id)
5659
{
57-
global $DOCROOT;
60+
global $DOCROOT, $PACKAGE;
5861
$page = find_menu_item($id);
5962
if (!isset($page))
6063
return;
6164

62-
print("<b><a href=\"${DOCROOT}html/plugins/${page['id']}.html\">LSP " . htmlspecialchars($page['text']) . "</a></b>");
65+
$header = htmlspecialchars("{$PACKAGE['short']} {$page['text']}");
66+
print("<b><a href=\"${DOCROOT}html/plugins/${page['id']}.html\">{$header}</a></b>");
6367
}
6468

6569
?>

0 commit comments

Comments
 (0)