Merge branch 'doxy/space'
* doxy/space: Ensure empty line before code and math blocks in doxygen pydoc Remove extra newline before code block in doxygen python output Clarify python doxygen code block indentation handling Cleanup of pydoc translator newline trimming Correction to recently added doxygen python test case Adjust expected python output for doxygen style2 test Adding test for second doxygen comment style Fix bug in doxygen python code block indent Eliminate extra newlines around doxygen python block math Eliminate extra newlines in doxygen python \verbatim blocks Remove extra newline from end of doxygen python \code command Remove extra newline in beginning of doxygen python \code command Fix python doxygen indentation for inline \code command
This commit is contained in:
commit
1204297a1b
11 changed files with 400 additions and 30 deletions
|
|
@ -0,0 +1,99 @@
|
|||
|
||||
import doxygen_basic_translate_style2.*;
|
||||
import com.sun.javadoc.*;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class doxygen_basic_translate_style2_runme {
|
||||
static {
|
||||
try {
|
||||
System.loadLibrary("doxygen_basic_translate_style2");
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
System.err.println("Native code library failed to load. See the chapter on Dynamic Linking Problems in the SWIG Java documentation for help.\n" + e);
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String argv[])
|
||||
{
|
||||
/*
|
||||
Here we are using internal javadoc tool, it accepts the name of the class as paramterer,
|
||||
and calls the start() method of that class with parsed information.
|
||||
*/
|
||||
CommentParser parser = new CommentParser();
|
||||
com.sun.tools.javadoc.Main.execute("doxygen_basic_translate_style2 runtime test",
|
||||
"CommentParser",
|
||||
new String[]{"-quiet", "doxygen_basic_translate_style2"});
|
||||
|
||||
HashMap<String, String> wantedComments = new HashMap<String, String>();
|
||||
|
||||
wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function()",
|
||||
" \n" +
|
||||
" Brief description.\n" +
|
||||
" \n" +
|
||||
" The comment text.\n" +
|
||||
" @author Some author\n" +
|
||||
" @return Some number\n" +
|
||||
" @see function2\n" +
|
||||
" \n" +
|
||||
"");
|
||||
wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function2()",
|
||||
" A test of a very very very very very very very very very very very very very very very very \n" +
|
||||
" very very very very very long comment string. \n" +
|
||||
" \n" +
|
||||
"");
|
||||
wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function4()",
|
||||
" A test of some mixed tag usage \n" +
|
||||
" If: CONDITION {\n" +
|
||||
" This <i>code </i>fragment shows us something . \n" +
|
||||
" <p alt=\"Minuses: \">\n" +
|
||||
" <li>it's senseless \n" +
|
||||
" </li><li>it's stupid \n" +
|
||||
" </li><li>it's null \n" +
|
||||
" \n" +
|
||||
" </li></p>Warning: This may not work as expected \n" +
|
||||
" \n" +
|
||||
" {@code \n" +
|
||||
"int main() { while(true); } \n" +
|
||||
" }\n" +
|
||||
" }\n" +
|
||||
" \n" +
|
||||
"");
|
||||
wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function3(int)",
|
||||
" A test for overloaded functions \n" +
|
||||
" This is function <b>one </b>\n" +
|
||||
" \n" +
|
||||
"");
|
||||
wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function5(int)",
|
||||
" This is a post comment. \n" +
|
||||
"");
|
||||
wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function6(int)",
|
||||
" Test for default args \n" +
|
||||
" @param a Some parameter, default is 42" +
|
||||
" \n" +
|
||||
"");
|
||||
wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function6()",
|
||||
" Test for default args \n" +
|
||||
" \n" +
|
||||
"");
|
||||
wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function7(doxygen_basic_translate_style2.SWIGTYPE_p_p_p_Shape)",
|
||||
" Test for a parameter with difficult type \n" +
|
||||
" (mostly for python) \n" +
|
||||
" @param a Very strange param \n" +
|
||||
"");
|
||||
wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.function3(int, int)",
|
||||
" A test for overloaded functions \n" +
|
||||
" This is function <b>two </b>\n" +
|
||||
" \n" +
|
||||
"");
|
||||
wantedComments.put("doxygen_basic_translate_style2.doxygen_basic_translate_style2.Atan2(double, double)",
|
||||
" Multiple parameters test.\n" +
|
||||
" \n" +
|
||||
" @param y Vertical coordinate.\n" +
|
||||
" @param x Horizontal coordinate.\n" +
|
||||
" @return Arc tangent of <code>y/x</code>.\n" +
|
||||
"");
|
||||
|
||||
// and ask the parser to check comments for us
|
||||
System.exit(parser.check(wantedComments));
|
||||
}
|
||||
}
|
||||
|
|
@ -40,7 +40,10 @@ public class doxygen_translate_all_tags_runme {
|
|||
" Not everything works right now...\n" +
|
||||
" <code>codeword</code>\n\n\n\n\n\n" +
|
||||
" <i>citationword</i>\n" +
|
||||
" {@code some test code }\n");
|
||||
" {@code some test code }\n\n" +
|
||||
" Code immediately following text. Pydoc translation must add an\n" +
|
||||
" empty line before:\n" +
|
||||
" {@code more test code }");
|
||||
|
||||
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func02(int)",
|
||||
" Conditional comment: SOMECONDITION \n" +
|
||||
|
|
@ -63,8 +66,11 @@ public class doxygen_translate_all_tags_runme {
|
|||
" @exception SuperError \n" +
|
||||
" \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \n" +
|
||||
" \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \n" +
|
||||
" \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \n" +
|
||||
" This will only appear in hmtl \n");
|
||||
" \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \n\n" +
|
||||
"Math immediately following text. Pydoc translation must add an\n" +
|
||||
"empty line before:\n\n" +
|
||||
" \\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}\n" +
|
||||
" This will only appear in hmtl \n");
|
||||
|
||||
wantedComments.put("doxygen_translate_all_tags.doxygen_translate_all_tags.func05(int)",
|
||||
" If: ANOTHERCONDITION {\n" +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue