Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix Issue 9155 - Ddoc: code section should strip leading spaces
- Loading branch information
Showing
5 changed files
with
208 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// PERMUTE_ARGS: | ||
// REQUIRED_ARGS: -D -Ddtest_results/compilable -o- | ||
// POST_SCRIPT: compilable/extra-files/ddocAny-postscript.sh 9155 | ||
|
||
module ddoc9155; | ||
|
||
/++ | ||
+ Note: | ||
+ test document note | ||
+ 2nd line | ||
+ Example: | ||
+ --- | ||
+ import std.stdio; //& | ||
+ writeln("Hello world!"); | ||
+ if (test) { | ||
+ writefln("D programming language"); | ||
+ } | ||
+ | ||
+ algorithm; | ||
+ | ||
+ xxx; //comment | ||
+ yyy; | ||
+ /* test | ||
+ * comment | ||
+ */ | ||
+ | ||
+ // Create MIME Base64 with CRLF, per line 76. | ||
+File f = File("./text.txt", "r"); | ||
+uint line = 0; | ||
+ // The ElementType of data is not aggregation type | ||
+foreach (encoded; Base64.encoder(data)) | ||
+ --- | ||
+/ | ||
|
||
/** | ||
-------------------------------------------------------- | ||
wstring ws; | ||
transcode("hello world",ws); | ||
// transcode from UTF-8 to UTF-16 | ||
-------------------------------------------------------- | ||
*/ | ||
|
||
/** | ||
* Example: | ||
* --- | ||
* import std.stdio; //& | ||
* writeln("Hello world!"); | ||
* if (test) { | ||
* writefln("D programming language"); | ||
* } | ||
* | ||
* algorithm; | ||
* | ||
* xxx; //comment | ||
* yyy; | ||
* /+ test | ||
* + comment | ||
* +/ | ||
* --- | ||
*/ | ||
|
||
/** | ||
---- | ||
#!/usr/bin/env rdmd | ||
// Computes average line length for standard input. | ||
import std.stdio; | ||
---- | ||
*/ | ||
/** | ||
--- | ||
writefln(q"EOS | ||
This | ||
is a multi-line | ||
heredoc string | ||
EOS" | ||
); | ||
--- | ||
*/ | ||
|
||
void foo(){} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<html><head> | ||
<META http-equiv="content-type" content="text/html; charset=utf-8"> | ||
<title>ddoc9155</title> | ||
</head><body> | ||
<h1>ddoc9155</h1> | ||
<br><br> | ||
<dl><dt><big><a name="foo"></a>void <u>foo</u>(); | ||
</big></dt> | ||
<dd><b>Note:</b><br> | ||
test document note | ||
2nd line | ||
<br><br> | ||
<b>Example:</b><br> | ||
<pre class="d_code"><font color=blue>import</font> std.stdio; <font color=green>//& | ||
</font>writeln(<font color=red>"Hello world!"</font>); | ||
<font color=blue>if</font> (test) { | ||
writefln(<font color=red>"D programming language"</font>); | ||
} | ||
|
||
algorithm; | ||
|
||
xxx; <font color=green>//comment | ||
</font> yyy; | ||
<font color=green>/* test | ||
* comment | ||
*/</font> | ||
|
||
<font color=green>// Create MIME Base64 with CRLF, per line 76. | ||
</font>File f = File(<font color=red>"./text.txt"</font>, <font color=red>"r"</font>); | ||
<font color=blue>uint</font> line = 0; | ||
<font color=green>// The ElementType of data is not aggregation type | ||
</font><font color=blue>foreach</font> (encoded; Base64.encoder(data)) | ||
</pre> | ||
|
||
<br><br> | ||
|
||
<pre class="d_code">wstring ws; | ||
transcode(<font color=red>"hello world"</font>,ws); | ||
<font color=green>// transcode from UTF-8 to UTF-16 | ||
</font></pre> | ||
|
||
|
||
<br><br> | ||
<b>Example:</b><br> | ||
<pre class="d_code"><font color=blue>import</font> std.stdio; <font color=green>//& | ||
</font>writeln(<font color=red>"Hello world!"</font>); | ||
<font color=blue>if</font> (test) { | ||
writefln(<font color=red>"D programming language"</font>); | ||
} | ||
|
||
algorithm; | ||
|
||
xxx; <font color=green>//comment | ||
</font> yyy; | ||
<font color=green>/+ test | ||
+ comment | ||
+/</font> | ||
</pre> | ||
|
||
<br><br> | ||
|
||
<pre class="d_code">#!/usr/bin/env rdmd | ||
<font color=green>// Computes average line length for standard input. | ||
</font><font color=blue>import</font> std.stdio; | ||
</pre> | ||
<br><br> | ||
|
||
<pre class="d_code">writefln(<font color=red>q"EOS | ||
This | ||
is a multi-line | ||
heredoc string | ||
EOS"</font> | ||
); | ||
</pre> | ||
<br><br> | ||
|
||
</dd> | ||
</dl> | ||
|
||
<hr><small>Page generated by <a href="http://dlang.org/ddoc.html">Ddoc</a>. </small> | ||
</body></html> |