added handling of HTML tags and HTML entities to PyDocConverter, updated tests

This commit is contained in:
Marko Klopcic 2013-02-12 22:58:50 +01:00
commit 560dedb6c0
5 changed files with 454 additions and 30 deletions

View file

@ -91,14 +91,31 @@ commentVerifier.check(doxygen_translate_all_tags.func04.__doc__,
r"""
Throws: SuperError
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}
This will only appear in hmtl
""")
""")
commentVerifier.check(doxygen_translate_all_tags.func05.__doc__,
r"""
@ -122,29 +139,68 @@ r"""
Image: testImage.bmp("Hello, world!")
Some text
describing invariant.
""")
""")
commentVerifier.check(doxygen_translate_all_tags.func06.__doc__,
r"""
Comment for __func06().__
This will only appear in LATeX
-Some unordered list
-With lots of items
-lots of lots of items
someMember Some description follows
someMember Some description follows
This will only appear in man
""")
""")
commentVerifier.check(doxygen_translate_all_tags.func07.__doc__,
r"""
Comment for __func07().__
Notes: Here
is the note!
@ -153,18 +209,28 @@ r"""
someword
Title: The paragraph title
The paragraph text.
Maybe even multiline
Arguments:
a (int) -- the first param
""")
""")
commentVerifier.check(doxygen_translate_all_tags.func08.__doc__,
r"""
Remarks:
Some remark text
Remarks: Some remark text
Another remarks section
@ -172,8 +238,9 @@ r"""
it
may return
""")
Returns: may return
""")
commentVerifier.check(doxygen_translate_all_tags.func09.__doc__,
r"""
@ -182,37 +249,67 @@ r"""
See also: someOtherMethod
function
Same as
brief description
Since: version 0.0.0.1
Throws: superException
RuntimeError
""")
Throw: superException
Throws: RuntimeError
""")
commentVerifier.check(doxygen_translate_all_tags.func10.__doc__,
r"""
TODO:
Some very important task
TODO: Some very important task
Arguments:
b (float) -- B is mentioned again...
very long
text with tags <sometag>
Version: 0.0.0.2
Warning: This is senseless!
This will only appear in XML
Here goes test of symbols:
$ @ \ & ~ < > # % " . ::
And here goes simple text
""")
""")

View file

@ -103,7 +103,7 @@ r"""
See also: someOtherMethod
function
See also: function
Since: version 0.0.0.1
@ -131,3 +131,120 @@ r"""
And here goes simple text
"""
)
commentVerifier.check(doxygen_translate.htmlFunction.__doc__,
r"""
Test for html tags. See Doxygen doc for list of tags recognized by Doxygen.
<a href = "http://acme.com/index.html">This is link</a>
<b>bold</b>
<BLOCKQUOTE>
Quotation block.
</BLOCKQUOTE>
<br>
<center>center</center>
<code>this is code</code>
<DD> Starts an item description.
<DFN> Starts a piece of text displayed in a typewriter font.
</DFN>
<DIV> Starts a section with a specific style (HTML only)
</DIV>
<DL> Starts a description list.
<DT> Starts an item title.</DT>
</DL>
<EM> Starts a piece of text displayed in an italic font.
</EM>
<FORM> 'Form' does not generate any output.
</FORM>
<HR>
<H1> Starts an unnumbered section.
</H1>
<H2> Starts an unnumbered subsection.
</H2>
<H3> Starts an unnumbered subsubsection.
</H3>
<I> Starts a piece of text displayed in an italic font.
<INPUT> Does not generate any output.
</I>
<IMG src="slika.png">
<META> Does not generate any output.
<MULTICOL> ignored by doxygen.
</MULTICOL> ignored by doxygen.
<OL> Starts a numbered item list.
<LI> Starts a new list item.
</LI>
</OL> Ends a numbered item list.
<P> Starts a new paragraph.
</P>
<PRE> Starts a preformatted fragment.
</PRE>
<SMALL> Starts a section of text displayed in a smaller font.
</SMALL>
<SPAN> Starts an inline text fragment with a specific style (HTML only)
</SPAN>
<STRONG> Starts a section of bold text.
</STRONG>
<SUB> Starts a piece of text displayed in subscript.
</SUB>
<SUP> Starts a piece of text displayed in superscript.
</SUP>
<table border = '1'>
<caption>Animals</caption>
<tr><th> cow </th><th> dog </th></tr>
<tr><td> cow </td><td> dog </td></tr>
<tr><td> cat </td><td> mouse </td></tr>
<tr><td> horse </td><td> parrot </td></tr>
</table>
<TT> Starts a piece of text displayed in a typewriter font.
</TT>
<KBD> Starts a piece of text displayed in a typewriter font.
</KBD>
<UL> Starts an unnumbered item list.
<LI> Starts a new list item 1.</LI>
<LI> Starts a new list item 2.</LI>
<LI> Starts a new list item 3.</LI>
</UL> Ends an unnumbered item list.
<VAR> Starts a piece of text displayed in an italic font.
</VAR>
\htmlonly
<u>underlined \b bold text - doxy commands are ignored inside 'htmlonly' section </u>
\endhtmlonly
<u>underlined text</u>
""")
commentVerifier.check(doxygen_translate.htmlEntitiesFunction.__doc__,
r"""
All entities are treated as commands (C); TM (R);
should work also<in text
>
&
'
"
'
'
"
"
-
--
x
-
.
~
<=
>=
<--
-->
Not an html entity - ignored by Doxygen.
Not an &text html entity - ampersand is replaced with entity.
""")