Skip to content

Commit

Permalink
Fix Issue 17536 - dlangspec.pdf: Unittests documentation uses HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
andralex committed Dec 15, 2017
1 parent 75dda79 commit 58b09c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions latex.ddoc
Expand Up @@ -240,6 +240,7 @@ PERCENT=\%
PHOBOS=$(LINK2 phobos/std_$1.html\#$2, $3)
_=

RAWHTML=\begin{lstlisting}[language=html,breaklines=true,breakatwhitespace=true]$0\end{lstlisting}
RCURL=$\}$
RED={\color{red}$0}
REF=$(D $2$(DOT_PREFIXED_SKIP $+).$1)
Expand Down
1 change: 1 addition & 0 deletions spec/spec.ddoc
Expand Up @@ -105,4 +105,5 @@ SPEC_NEXT=<div style="float: right">$1 $(FA_ICON angle-right)</div>
SPEC_PREV=<div style="float: left">$(FA_ICON angle-left) $1</div>

CLEAR=<div style="clear:both"></div>
RAWHTML=$0
_=
13 changes: 6 additions & 7 deletions spec/unittest.dd
Expand Up @@ -121,14 +121,13 @@ unittest

$(P The above will generate the following documentation:)

$(RAWHTML
<dl><dt><big><a name="Math"></a>class <u>Math</u>;

</big></dt>
<dd><u>Math</u> class<br><br>
<b>Example:</b><pre class="d$(UNDERSCORE)code"><font color="blue">auto</font> math = <font color="blue">new</font> <u>Math</u>;
<b>Example:</b><pre class="d_code"><font color="blue">auto</font> math = <font color="blue">new</font> <u>Math</u>;
<font color="blue">auto</font> result = math.add(2, 2);
</pre><br>

<dl><dt><big><a name="Math.add"></a>int <u>add</u>(int <i>x</i>, int <i>y</i>);
</big></dt>
<dd><u>add</u> function<br><br>
Expand All @@ -138,6 +137,7 @@ $(P The above will generate the following documentation:)
</dl>
</dd>
</dl>
)

$(P A unittest which is not documented, or is marked as private will not be
used to generate code samples.)
Expand Down Expand Up @@ -176,25 +176,24 @@ unittest

$(P The above will generate the following documentation:)

$(RAWHTML
<dl><dt><big><a name="add"></a>int <u>add</u>(int <i>x</i>, int <i>y</i>);

</big></dt>
<dd><u>add</u> function<br><br>
<b>Examples:</b><br>
code sample generated
<pre class="d$(UNDERSCORE)code">
<pre class="d_code">
<font color="blue">assert</font>(<u>add</u>(1, 1) == 2);
</pre>
<br><br><b>Examples:</b><br>
code sample generated, even if it is empty or only includes comments

<pre class="d$(UNDERSCORE)code">
<font color="green">/** assert(add(4, 4) == 8); */</font>
</pre>
<br><br>
</dd>
</dl>

)

$(H2 $(LNAME2 versioning, Versioning))

Expand Down

0 comments on commit 58b09c5

Please sign in to comment.