Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'docs/exdoc')
-rw-r--r--docs/exdoc15
1 files changed, 13 insertions, 2 deletions
diff --git a/docs/exdoc b/docs/exdoc
index 38321c19c8b..38f1cc5e1b1 100644
--- a/docs/exdoc
+++ b/docs/exdoc
@@ -124,6 +124,7 @@ sub process_function {
my $body = '';
my $returns = '';
my $prototype = '';
+ my $codeblock = 'false';
while (<$file>) {
@@ -180,8 +181,16 @@ sub process_function {
chomp;
s/^ +\*//;
- # Replace blank lines with paragraph breaks.
- $_ = '<p>' if /^\s*$/;
+ if (/\s*\\code$/) {
+ $codeblock = 'true';
+ } elsif (/\s*\\endcode$/) {
+ $codeblock = 'false';
+ }
+
+ # Replace blank lines with paragraph breaks if we're not in a code block.
+ if (/^\s*$/) {
+ $_ = '<p>' if $codeblock eq 'false';
+ }
if ($section == $PARAMETER_SECTION) {
if (/\s*\\param +(\w+)(.*)/) {
@@ -249,6 +258,8 @@ sub process_formatting {
warn "$file_path:$current_line: Old-style monodoc notation '`code`' used\n"
if s{\`((?!api:)[:.\w\*]+)\`}{<code>$1</code>}g && $WARNINGS;
s{\\c +(\S+(?<![.,:;]))}{<code>$1</code>}g;
+ s{\\code}{<pre><code class="mapi-codeblock">}g;
+ s{\\endcode}{</code></pre>}g;
$$content = $_;
}