maven site / javadoc integration
This commit is contained in:
@@ -250,6 +250,28 @@ public class TeXDoclet extends Doclet {
|
||||
static String introFile = null;
|
||||
static double tableWidthScale = 0.9;
|
||||
static boolean createPdf = false;
|
||||
static final String REPLACE_OUT = "_replace_data_";
|
||||
static final String REPLACE_TITLE = "_replace_title_";
|
||||
static final String HTML_PDF_WRAPPER = "<!DOCTYPE html><html lang=\"en\" xml:lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\"><head>"
|
||||
+ "<style>"
|
||||
+ "html {"
|
||||
+ " height: 100%;"
|
||||
+ "}"
|
||||
+ "body {"
|
||||
+ " margin: 0px;"
|
||||
+ " height: 100%;"
|
||||
+ " overflow: hidden;"
|
||||
+ "}"
|
||||
+ ".pdfDoc {"
|
||||
+ " height: 100%;"
|
||||
+ " width: 100%;"
|
||||
+ "}"
|
||||
+ "</style>"
|
||||
+ "<title>"
|
||||
+ REPLACE_TITLE
|
||||
+ "</title></head><body><object data=\""
|
||||
+ REPLACE_OUT
|
||||
+ "\" type=\"application/pdf\" class=\"pdfDoc\"></object></body></html>";
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
||||
@@ -2182,6 +2204,7 @@ public class TeXDoclet extends Doclet {
|
||||
|
||||
if (createPdf) {
|
||||
createPdf();
|
||||
createPdfHtmlWrapper();
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
@@ -2202,6 +2225,20 @@ public class TeXDoclet extends Doclet {
|
||||
|
||||
}
|
||||
|
||||
static void createPdfHtmlWrapper() throws IOException {
|
||||
|
||||
String wrapperContent = HTML_PDF_WRAPPER.replace(REPLACE_OUT,
|
||||
outfile.replace(".tex", ".pdf"));
|
||||
wrapperContent = wrapperContent.replace(REPLACE_TITLE,
|
||||
outfile.replace(".tex", ""));
|
||||
|
||||
FileWriter outFile = new FileWriter("index.html");
|
||||
PrintWriter out = new PrintWriter(outFile);
|
||||
out.println(wrapperContent);
|
||||
out.close();
|
||||
|
||||
}
|
||||
|
||||
static int execute(String cmd, String args[], boolean doOutput)
|
||||
throws IOException, InterruptedException {
|
||||
|
||||
|
||||
@@ -4,19 +4,21 @@
|
||||
<title>TeXDoclet</title>
|
||||
</properties>
|
||||
<body>
|
||||
(This is just a test page for the correct generation / integration of Java Doc PDF document)
|
||||
This is a sample maven site project documentation page that demonstrates the TeXDoclet maven integration.
|
||||
<section name="Java Doc - HTML">
|
||||
<ul>
|
||||
<li><a href="apidocs/index.html">link</a> to standard Javadoc
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
<section name="Java Doc - PDF">
|
||||
<ul>
|
||||
<li><a href="apidocs_tex/TeXDoclet.pdf">link to TeXDoclet.pdf</a>
|
||||
<li><a href="apidocs_tex/TeXDoclet.pdf">link</a> to documentation generated by TeXDoclet
|
||||
</li>
|
||||
<li>embedded PDF file generated by TeXDoclet :
|
||||
</li>
|
||||
</ul>
|
||||
<object data="apidocs_tex/TeXDoclet.pdf" type="application/pdf" width="800px" height="600px"></object>
|
||||
</section>
|
||||
<section name="Java Doc - HTML">
|
||||
<ul>
|
||||
<li><a href="apidocs_html/index.html">link to Html</a>
|
||||
</li>
|
||||
</ul>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
Reference in New Issue
Block a user