inital spike of a simple javadoc like tool for generating a HTML API summary from the kotlin model
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
package org.jetbrains.kotlin.doc
|
||||
|
||||
import std.template.*
|
||||
|
||||
import org.jetbrains.kotlin.doc.templates.*
|
||||
import org.jetbrains.kotlin.template.TextTemplate
|
||||
import org.jetbrains.kotlin.model.KModel
|
||||
|
||||
import java.io.File
|
||||
@@ -10,7 +9,27 @@ import java.io.File
|
||||
class KDocProcessor(val model: KModel, val outputDir: File) {
|
||||
|
||||
fun execute(): Unit {
|
||||
run("allclasses-frame.html", AllClassesFrameTemplate(model))
|
||||
run("allclasses-noframe.html", AllClassesFrameTemplate(model, " target=\"classFrame\""))
|
||||
// run("constant-values.html", ConstantValuesTemplate(model))
|
||||
// run("deprecated-list.html", DeprecatedListTemplate(model))
|
||||
run("help-doc.html", HelpDocTemplate(model))
|
||||
// run("index-all.html", IndexAllTemplate(model))
|
||||
run("index.html", IndexTemplate(model))
|
||||
run("overview-frame.html", OverviewFrameTemplate(model))
|
||||
run("overview-summary.html", OverviewSummaryTemplate(model))
|
||||
run("overview-tree.html", OverviewTreeTemplate(model))
|
||||
run("package-list", PackageListTemplate(model))
|
||||
// run("serialized-form.html", SerializedFormTemplate(model))
|
||||
/**
|
||||
TODO
|
||||
*/
|
||||
for (p in model.packages) {
|
||||
run("${p.nameAsPath}/package-frame.html", PackageFrameTemplate(model, p))
|
||||
run("${p.nameAsPath}/package-summary.html", PackageSummaryTemplate(model, p))
|
||||
//run("${p.nameAsPath}/package-tree.html", PackageTreeTemplate(model, p))
|
||||
//run("${p.nameAsPath}/package-use.html", PackageUseTemplate(model, p))
|
||||
}
|
||||
}
|
||||
|
||||
protected fun run(fileName: String, template: TextTemplate): Unit {
|
||||
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
package org.jetbrains.kotlin.doc.templates
|
||||
|
||||
import std.*
|
||||
import org.jetbrains.kotlin.template.*
|
||||
import std.io.*
|
||||
import std.util.*
|
||||
import java.util.*
|
||||
import org.jetbrains.kotlin.model.KModel
|
||||
|
||||
class AllClassesFrameTemplate(val model: KModel, val classAttributes: String = "") : TextTemplate() {
|
||||
override fun render() {
|
||||
// TODO could really do with templates in multi-line strings :)
|
||||
println("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>""")
|
||||
|
||||
println("<!-- Generated by kdoc (${model.version}) on ${Date()} -->")
|
||||
println("""<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<TITLE>""")
|
||||
println("All Classes (${model.title})")
|
||||
print("""</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2012-01-09">
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white">
|
||||
<FONT size="+1" CLASS="FrameHeadingFont">
|
||||
<B>All Classes</B></FONT>
|
||||
<BR>
|
||||
|
||||
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||
<TR>
|
||||
<TD NOWRAP><FONT CLASS="FrameItemFont">""")
|
||||
for (c in model.classes) {
|
||||
println("<A HREF=\"${c.nameAsPath}.html\" title=\"class in ${c.packageName}\"$classAttributes>${c.simpleName}</A>")
|
||||
println("<BR>")
|
||||
}
|
||||
println("""</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</BODY>
|
||||
</HTML>
|
||||
""")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,237 @@
|
||||
package org.jetbrains.kotlin.doc.templates
|
||||
|
||||
import std.*
|
||||
import org.jetbrains.kotlin.template.*
|
||||
import std.io.*
|
||||
import std.util.*
|
||||
import java.util.*
|
||||
import org.jetbrains.kotlin.model.KModel
|
||||
|
||||
class HelpDocTemplate(val model: KModel) : TextTemplate() {
|
||||
override fun render() {
|
||||
println("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc on Mon Jan 09 13:32:00 EST 2012-->
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<TITLE>""")
|
||||
println("API Help (${model.title})")
|
||||
println("""</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2012-01-09">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
if (location.href.indexOf('is-external=true') == -1) {""")
|
||||
println(" parent.document.title=\"API Help (${model.title})\";")
|
||||
println(""" }
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<CENTER>
|
||||
<H1>
|
||||
How This API Document Is Organized</H1>
|
||||
</CENTER>
|
||||
This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows.<H3>
|
||||
Overview</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
The <A HREF="overview-summary.html">Overview</A> page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages.</BLOCKQUOTE>
|
||||
<H3>
|
||||
Package</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories:<UL>
|
||||
<LI>Interfaces (italic)<LI>Classes<LI>Enums<LI>Exceptions<LI>Errors<LI>Annotation Types</UL>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Class/Interface</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions:<UL>
|
||||
<LI>Class inheritance diagram<LI>Direct Subclasses<LI>All Known Subinterfaces<LI>All Known Implementing Classes<LI>Class/interface declaration<LI>Class/interface description
|
||||
<P>
|
||||
<LI>Nested Class Summary<LI>Field Summary<LI>Constructor Summary<LI>Method Summary
|
||||
<P>
|
||||
<LI>Field Detail<LI>Constructor Detail<LI>Method Detail</UL>
|
||||
Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer.</BLOCKQUOTE>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Annotation Type</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
Each annotation type has its own separate page with the following sections:<UL>
|
||||
<LI>Annotation Type declaration<LI>Annotation Type description<LI>Required Element Summary<LI>Optional Element Summary<LI>Element Detail</UL>
|
||||
</BLOCKQUOTE>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Enum</H3>
|
||||
<BLOCKQUOTE>
|
||||
|
||||
<P>
|
||||
Each enum has its own separate page with the following sections:<UL>
|
||||
<LI>Enum declaration<LI>Enum description<LI>Enum Constant Summary<LI>Enum Constant Detail</UL>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Use</H3>
|
||||
<BLOCKQUOTE>
|
||||
Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar.</BLOCKQUOTE>
|
||||
<H3>
|
||||
Tree (Class Hierarchy)</H3>
|
||||
<BLOCKQUOTE>
|
||||
There is a <A HREF="overview-tree.html">Class Hierarchy</A> page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with <code>java.lang.Object</code>. The interfaces do not inherit from <code>java.lang.Object</code>.<UL>
|
||||
<LI>When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages.<LI>When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package.</UL>
|
||||
</BLOCKQUOTE>
|
||||
<H3>
|
||||
Deprecated API</H3>
|
||||
<BLOCKQUOTE>
|
||||
The <A HREF="deprecated-list.html">Deprecated API</A> page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations.</BLOCKQUOTE>
|
||||
<H3>
|
||||
Index</H3>
|
||||
<BLOCKQUOTE>
|
||||
The <A HREF="index-all.html">Index</A> contains an alphabetic list of all classes, interfaces, constructors, methods, and fields.</BLOCKQUOTE>
|
||||
<H3>
|
||||
Prev/Next</H3>
|
||||
These links take you to the next or previous class, interface, package, or related page.<H3>
|
||||
Frames/No Frames</H3>
|
||||
These links show and hide the HTML frames. All pages are available with or without frames.
|
||||
<P>
|
||||
<H3>
|
||||
Serialized Form</H3>
|
||||
Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description.
|
||||
<P>
|
||||
<H3>
|
||||
Constant Field Values</H3>
|
||||
The <a href="constant-values.html">Constant Field Values</a> page lists the static final fields and their values.
|
||||
<P>
|
||||
<FONT SIZE="-1">
|
||||
<EM>
|
||||
This help file applies to API documentation generated using the standard doclet.</EM>
|
||||
</FONT>
|
||||
<BR>
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Help</B></FONT> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?help-doc.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="help-doc.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
Copyright © 2012. All Rights Reserved.
|
||||
</BODY>
|
||||
</HTML>""")
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.jetbrains.kotlin.doc.templates
|
||||
|
||||
import std.*
|
||||
import std.template.*
|
||||
import org.jetbrains.kotlin.template.*
|
||||
import std.io.*
|
||||
import std.util.*
|
||||
import java.util.*
|
||||
@@ -10,47 +10,47 @@ import org.jetbrains.kotlin.model.KModel
|
||||
class IndexTemplate(val model: KModel) : TextTemplate() {
|
||||
override fun render() {
|
||||
print("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc on Mon Jan 09 13:32:00 EST 2012-->
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<TITLE>
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc on Mon Jan 09 13:32:00 EST 2012-->
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<TITLE>
|
||||
""")
|
||||
print(model.title)
|
||||
print(""")
|
||||
</TITLE>
|
||||
<SCRIPT type="text/javascript">
|
||||
targetPage = "" + window.location.search;
|
||||
print("""
|
||||
</TITLE>
|
||||
<SCRIPT type="text/javascript">
|
||||
targetPage = "" + window.location.search;
|
||||
if (targetPage != "" && targetPage != "undefined")
|
||||
targetPage = targetPage.substring(1);
|
||||
if (targetPage.indexOf(":") != -1)
|
||||
targetPage = "undefined";
|
||||
function loadFrames() {
|
||||
if (targetPage != "" && targetPage != "undefined")
|
||||
targetPage = targetPage.substring(1);
|
||||
if (targetPage.indexOf(":") != -1)
|
||||
targetPage = "undefined";
|
||||
function loadFrames() {
|
||||
if (targetPage != "" && targetPage != "undefined")
|
||||
top.classFrame.location = top.targetPage;
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
</HEAD>
|
||||
<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()">
|
||||
<FRAMESET rows="30%,70%" title="" onLoad="top.loadFrames()">
|
||||
<FRAME src="overview-frame.html" name="packageListFrame" title="All Packages">
|
||||
<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)">
|
||||
</FRAMESET>
|
||||
<FRAME src="overview-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes">
|
||||
<NOFRAMES>
|
||||
<H2>
|
||||
Frame Alert</H2>
|
||||
top.classFrame.location = top.targetPage;
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
</HEAD>
|
||||
<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()">
|
||||
<FRAMESET rows="30%,70%" title="" onLoad="top.loadFrames()">
|
||||
<FRAME src="overview-frame.html" name="packageListFrame" title="All Packages">
|
||||
<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)">
|
||||
</FRAMESET>
|
||||
<FRAME src="overview-summary.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes">
|
||||
<NOFRAMES>
|
||||
<H2>
|
||||
Frame Alert</H2>
|
||||
|
||||
<P>
|
||||
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
|
||||
<BR>
|
||||
Link to<A HREF="overview-summary.html">Non-frame version.</A>
|
||||
</NOFRAMES>
|
||||
</FRAMESET>
|
||||
</HTML>
|
||||
""")
|
||||
<P>
|
||||
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
|
||||
<BR>
|
||||
Link to<A HREF="overview-summary.html">Non-frame version.</A>
|
||||
</NOFRAMES>
|
||||
</FRAMESET>
|
||||
</HTML>
|
||||
""")
|
||||
}
|
||||
}
|
||||
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package org.jetbrains.kotlin.doc.templates
|
||||
|
||||
import std.*
|
||||
import org.jetbrains.kotlin.template.*
|
||||
import std.io.*
|
||||
import std.util.*
|
||||
import java.util.*
|
||||
import org.jetbrains.kotlin.model.KModel
|
||||
|
||||
class OverviewFrameTemplate(val model: KModel) : TextTemplate() {
|
||||
override fun render() {
|
||||
// TODO could really do with templates in multi-line strings :)
|
||||
println("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>""")
|
||||
println("<!-- Generated by kdoc (${model.version}) on ${Date()} -->")
|
||||
println("""<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<TITLE>""")
|
||||
println("Overview List (${model.title})")
|
||||
print("""</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2012-01-09">
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white">
|
||||
|
||||
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||
<TR>
|
||||
<TH ALIGN="left" NOWRAP><FONT size="+1" CLASS="FrameTitleFont">
|
||||
<B></B></FONT></TH>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||
<TR>
|
||||
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="allclasses-frame.html" target="packageFrame">All Classes</A></FONT>
|
||||
<P>
|
||||
<FONT size="+1" CLASS="FrameHeadingFont">
|
||||
Packages</FONT>
|
||||
<BR>""")
|
||||
for (p in model.packages) {
|
||||
println("<FONT CLASS=\"FrameItemFont\"><A HREF=\"${p.nameAsPath}/package-frame.html\" target=\"packageFrame\">${p.name}</A></FONT>")
|
||||
println("<BR>")
|
||||
}
|
||||
println("""</TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
|
||||
<P>
|
||||
|
||||
</BODY>
|
||||
</HTML>
|
||||
""")
|
||||
}
|
||||
}
|
||||
+172
@@ -0,0 +1,172 @@
|
||||
package org.jetbrains.kotlin.doc.templates
|
||||
|
||||
import std.*
|
||||
import org.jetbrains.kotlin.template.*
|
||||
import std.io.*
|
||||
import std.util.*
|
||||
import java.util.*
|
||||
import org.jetbrains.kotlin.model.KModel
|
||||
|
||||
class OverviewSummaryTemplate(val model: KModel) : TextTemplate() {
|
||||
override fun render() {
|
||||
println("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc on Mon Jan 09 13:32:00 EST 2012-->
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<TITLE>""")
|
||||
println("Overview (${model.title})")
|
||||
println("""</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2012-01-09">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
if (location.href.indexOf('is-external=true') == -1) {""")
|
||||
println(" parent.document.title=\"Overview (${model.title})\";")
|
||||
println(""" }
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Overview</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?overview-summary.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="overview-summary.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<CENTER>
|
||||
<H1>""")
|
||||
println(model.title)
|
||||
println("""</H1>
|
||||
</CENTER>
|
||||
|
||||
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
|
||||
<B>Packages</B></FONT></TH>
|
||||
</TR>""")
|
||||
for (p in model.packages) {
|
||||
println("<TR BGCOLOR=\"white\" CLASS=\"TableRowColor\">")
|
||||
println("<TD WIDTH=\"20%\"><B><A HREF=\"${p.nameAsPath}/package-summary.html\">${p.nameAsPath}</A></B></TD>")
|
||||
println("<TD>${p.description}</TD>")
|
||||
println("</TR>")
|
||||
}
|
||||
println("""</TABLE>
|
||||
|
||||
<P>
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Overview</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?overview-summary.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="overview-summary.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
Copyright © 2010-2012. All Rights Reserved.
|
||||
</BODY>
|
||||
</HTML>""")
|
||||
}
|
||||
}
|
||||
+195
@@ -0,0 +1,195 @@
|
||||
package org.jetbrains.kotlin.doc.templates
|
||||
|
||||
import std.*
|
||||
import org.jetbrains.kotlin.template.*
|
||||
import std.io.*
|
||||
import std.util.*
|
||||
import java.util.*
|
||||
import org.jetbrains.kotlin.model.KModel
|
||||
|
||||
class OverviewTreeTemplate(val model: KModel) : TextTemplate() {
|
||||
override fun render() {
|
||||
println("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<!-- Generated by javadoc on Mon Jan 09 13:32:00 EST 2012-->
|
||||
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<TITLE>""")
|
||||
println("Class Hierarchy (${model.title})")
|
||||
println("""</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2012-01-09">
|
||||
|
||||
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
|
||||
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
if (location.href.indexOf('is-external=true') == -1) {""")
|
||||
println(" parent.document.title=\"Class Hierarchy (${model.title})\";")
|
||||
println(""" }
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<CENTER>
|
||||
<H2>
|
||||
Hierarchy For All Packages</H2>
|
||||
</CENTER>
|
||||
<DL>
|
||||
<DT><B>Package Hierarchies:</B><DD>""")
|
||||
|
||||
var first = true
|
||||
for (p in model.packages) {
|
||||
if (first) {
|
||||
first = false
|
||||
} else {
|
||||
print(", ")
|
||||
print("<A HREF=\"${p.nameAsPath}/package-tree.html\">${p.nameAsPath}</A>")
|
||||
}
|
||||
}
|
||||
println("""</DL>
|
||||
<HR>
|
||||
<H2>
|
||||
Class Hierarchy
|
||||
</H2>""")
|
||||
|
||||
// TODO walk the hierarchy...
|
||||
/*
|
||||
<UL>
|
||||
<LI TYPE="circle">java.util.<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/AbstractQueue.html?is-external=true" title="class or interface in java.util"><B>AbstractQueue</B></A><E> (implements java.util.<A HREF="http://download.oracle.com/javase/1.5.0/docs/api/java/util/Queue.html?is-external=true" title="class or interface in java.util">Queue</A><E>)
|
||||
<UL>
|
||||
*/
|
||||
|
||||
println("""<H2>
|
||||
Interface Hierarchy
|
||||
</H2>""")
|
||||
|
||||
// TODO
|
||||
println("""<H2>
|
||||
Annotation Type Hierarchy
|
||||
</H2>""")
|
||||
|
||||
// TODO
|
||||
println("""<H2>
|
||||
Enum Hierarchy
|
||||
</H2>""")
|
||||
|
||||
println("""<HR>
|
||||
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Package</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Use</FONT> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Tree</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
PREV
|
||||
NEXT</FONT></TD>
|
||||
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
|
||||
<A HREF="index.html?overview-tree.html" target="_top"><B>FRAMES</B></A>
|
||||
<A HREF="overview-tree.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
Copyright © 2010-2012. All Rights Reserved.
|
||||
</BODY>
|
||||
</HTML>""")
|
||||
}
|
||||
}
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
package org.jetbrains.kotlin.doc.templates
|
||||
|
||||
import std.*
|
||||
import org.jetbrains.kotlin.template.*
|
||||
import std.io.*
|
||||
import std.util.*
|
||||
import java.util.*
|
||||
import org.jetbrains.kotlin.model.KModel
|
||||
import org.jetbrains.kotlin.model.KPackage
|
||||
|
||||
class PackageFrameTemplate(val model: KModel, val pkg: KPackage) : TextTemplate() {
|
||||
override fun render() {
|
||||
// TODO could really do with templates in multi-line strings :)
|
||||
println("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>""")
|
||||
println("<!-- Generated by kdoc (${model.version}) on ${Date()} -->")
|
||||
println("""<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<TITLE>""")
|
||||
println("${pkg.name} (${model.title})")
|
||||
println("""</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2012-01-09">""")
|
||||
println("<LINK REL =\"stylesheet\" TYPE=\"text/css\" HREF=\"${pkg.nameAsRelativePath}/stylesheet.css\" TITLE=\"Style\">")
|
||||
println("""
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white">
|
||||
<FONT size="+1" CLASS="FrameTitleFont">""")
|
||||
println("<A HREF=\"${pkg.nameAsRelativePath}/${pkg.nameAsPath}/package-summary.html\" target=\"classFrame\">${pkg.name}</A></FONT>")
|
||||
|
||||
printClasses("interface", "Interfaces")
|
||||
printClasses("class", "Classes")
|
||||
printClasses("enum", "Enums")
|
||||
printClasses("annotation", "Annotations")
|
||||
printClasses("exception", "Exceptions")
|
||||
|
||||
println("""</BODY>
|
||||
</HTML>""")
|
||||
}
|
||||
|
||||
protected fun printClasses(kind: String, description: String): Unit {
|
||||
val classes = pkg.classes.filter{ it.kind == kind }
|
||||
if (! classes.isEmpty()) {
|
||||
println("""<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
|
||||
<TR>
|
||||
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">""")
|
||||
print(description)
|
||||
println("""</FONT>
|
||||
<FONT CLASS="FrameItemFont">
|
||||
<BR>""")
|
||||
for (c in classes) {
|
||||
val formatted = if (kind == "interface") "<I>${c.simpleName}</I>" else c.simpleName
|
||||
println("<A HREF=\"${c.simpleName}\" title=\"$kind in ${pkg.name}\" target=\"classFrame\">$formatted</A>")
|
||||
println("<BR>")
|
||||
}
|
||||
println("""</TR>
|
||||
</TABLE>""")
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package org.jetbrains.kotlin.doc.templates
|
||||
|
||||
import std.*
|
||||
import org.jetbrains.kotlin.template.*
|
||||
import std.io.*
|
||||
import std.util.*
|
||||
import java.util.*
|
||||
import org.jetbrains.kotlin.model.KModel
|
||||
|
||||
class PackageListTemplate(val model: KModel) : TextTemplate() {
|
||||
override fun render() {
|
||||
for (p in model.packages) {
|
||||
println(p.name)
|
||||
}
|
||||
}
|
||||
}
|
||||
+256
@@ -0,0 +1,256 @@
|
||||
package org.jetbrains.kotlin.doc.templates
|
||||
|
||||
import std.*
|
||||
import org.jetbrains.kotlin.template.*
|
||||
import std.io.*
|
||||
import std.util.*
|
||||
import java.util.*
|
||||
import org.jetbrains.kotlin.model.KModel
|
||||
import org.jetbrains.kotlin.model.KPackage
|
||||
import org.jetbrains.kotlin.model.KClass
|
||||
|
||||
class PackageSummaryTemplate(val model: KModel, val pkg: KPackage) : TextTemplate() {
|
||||
override fun render() {
|
||||
// TODO could really do with templates in multi-line strings :)
|
||||
println("""<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<!--NewPage-->
|
||||
<HTML>
|
||||
<HEAD>""")
|
||||
println("<!-- Generated by kdoc (${model.version}) on ${Date()} -->")
|
||||
println("""<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<TITLE>""")
|
||||
println("${pkg.name} (${model.title})")
|
||||
println("""</TITLE>
|
||||
|
||||
<META NAME="date" CONTENT="2012-01-09">
|
||||
<META NAME="date" CONTENT="2012-01-09">""")
|
||||
println("<LINK REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"${pkg.nameAsRelativePath}/stylesheet.css\" TITLE=\"Style\">")
|
||||
println("""
|
||||
<SCRIPT type="text/javascript">
|
||||
function windowTitle()
|
||||
{
|
||||
if (location.href.indexOf('is-external=true') == -1) {""")
|
||||
println(" parent.document.title=\"${pkg.name} (${model.title})\";")
|
||||
println(""" }
|
||||
}
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
</NOSCRIPT>
|
||||
|
||||
</HEAD>
|
||||
|
||||
<BODY BGCOLOR="white" onload="windowTitle();">
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||
<A NAME="navbar_top"><!-- --></A>
|
||||
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_top_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">""")
|
||||
|
||||
println("<TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"${pkg.nameAsRelativePath}/overview-summary.html\"><FONT CLASS=\"NavBarFont1\"><B>Overview</B></FONT></A> </TD>")
|
||||
println("""<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>""")
|
||||
|
||||
println("<TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"${pkg.nameAsRelativePath}/deprecated-list.html\"><FONT CLASS=\"NavBarFont1\"><B>Deprecated</B></FONT></A> </TD>")
|
||||
println("<TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"${pkg.nameAsRelativePath}/index-all.html\"><FONT CLASS=\"NavBarFont1\"><B>Index</B></FONT></A> </TD>")
|
||||
println("<TD BGCOLOR=\"#EEEEFF\" CLASS=\"NavBarCell1\"> <A HREF=\"${pkg.nameAsRelativePath}/help-doc.html\"><FONT CLASS=\"NavBarFont1\"><B>Help</B></FONT></A> </TD>")
|
||||
println(""" </TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>""")
|
||||
|
||||
printNextPrevPackages()
|
||||
println("""<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">""")
|
||||
println(" <A HREF=\"${pkg.nameAsRelativePath}/index.html?${pkg.nameAsPath}/package-summary.html\" target=\"_top\"><B>FRAMES</B></A> ")
|
||||
println(""" <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {""")
|
||||
println(" document.writeln('<A HREF=\"${pkg.nameAsRelativePath}/allclasses-noframe.html\"><B>All Classes</B></A>');")
|
||||
println(""" }
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>""")
|
||||
println(" <A HREF=\"${pkg.nameAsRelativePath}/allclasses-noframe.html\"><B>All Classes</B></A>")
|
||||
println("""</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_top"></A>
|
||||
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||
|
||||
<HR>
|
||||
<FONT SIZE="-1">""")
|
||||
|
||||
for (a in pkg.annotations) {
|
||||
val url = a.url
|
||||
if (url != null) {
|
||||
println("<A HREF=\"$url?is-external=true\" title=\"class or interface in ${a.packageName}\">@${a.simpleName}</A>")
|
||||
}
|
||||
}
|
||||
println("</FONT><H2>")
|
||||
println("Package ${pkg.name}")
|
||||
println("</H2>")
|
||||
println(pkg.description)
|
||||
println("""<P>
|
||||
<B>See:</B>
|
||||
<BR>
|
||||
<A HREF="#package_description"><B>Description</B></A>
|
||||
<P>
|
||||
""")
|
||||
|
||||
printClasses("interface", "Interfaces")
|
||||
printClasses("class", "Classes")
|
||||
printClasses("enum", "Enums")
|
||||
printClasses("annotation", "Annotations")
|
||||
printClasses("exception", "Exceptions")
|
||||
|
||||
println("""<A NAME="package_description"><!-- --></A><H2>""")
|
||||
println("Package ${pkg.name} Description")
|
||||
println("""</H2>
|
||||
|
||||
<P>""")
|
||||
|
||||
println(pkg.detailedDescription)
|
||||
println("""
|
||||
|
||||
<h2>Contents</h2>
|
||||
|
||||
""")
|
||||
|
||||
val groupMap = pkg.groupClassMap()
|
||||
for (e in groupMap.entrySet()) {
|
||||
val group = e?.getKey() ?: "Other"
|
||||
val list = e?.getValue()
|
||||
if (list != null) {
|
||||
println(" <h3>$group</h3>")
|
||||
println("""
|
||||
<ul>""")
|
||||
for (c in list) {
|
||||
println(" <li><A HREF=\"${pkg.nameAsRelativePath}/${c.nameAsPath}.html\" title=\"class in ${pkg.name}\"><CODE>${c.simpleName}</CODE></A>")
|
||||
}
|
||||
println("""
|
||||
</ul>""")
|
||||
}
|
||||
}
|
||||
|
||||
println("""
|
||||
<P>
|
||||
|
||||
<P>
|
||||
<DL>
|
||||
</DL>
|
||||
<HR>
|
||||
|
||||
|
||||
<!-- ======= START OF BOTTOM NAVBAR ====== -->
|
||||
<A NAME="navbar_bottom"><!-- --></A>
|
||||
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
|
||||
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
|
||||
<TR>
|
||||
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
|
||||
<A NAME="navbar_bottom_firstrow"><!-- --></A>
|
||||
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
|
||||
<TR ALIGN="center" VALIGN="top">
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="${pkg.nameAsRelativePath}/overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Package</B></FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <FONT CLASS="NavBarFont1">Class</FONT> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-use.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="${pkg.nameAsRelativePath}/deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="${pkg.nameAsRelativePath}/index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
|
||||
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="${pkg.nameAsRelativePath}/help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TD>
|
||||
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
|
||||
</EM>
|
||||
</TD>
|
||||
</TR>
|
||||
|
||||
<TR>""")
|
||||
|
||||
printNextPrevPackages()
|
||||
|
||||
println("""<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">""")
|
||||
println(") <A HREF=\"${pkg.nameAsRelativePath}/index.html?${pkg.nameAsPath}/package-summary.html\" target=\"_top\"><B>FRAMES</B></A> ")
|
||||
println(""" <A HREF="package-summary.html" target="_top"><B>NO FRAMES</B></A>
|
||||
<SCRIPT type="text/javascript">
|
||||
<!--
|
||||
if(window==top) {
|
||||
document.writeln('<A HREF="${pkg.nameAsRelativePath}/allclasses-noframe.html"><B>All Classes</B></A>');
|
||||
}
|
||||
//-->
|
||||
</SCRIPT>
|
||||
<NOSCRIPT>
|
||||
<A HREF="${pkg.nameAsRelativePath}/allclasses-noframe.html"><B>All Classes</B></A>
|
||||
</NOSCRIPT>
|
||||
|
||||
|
||||
</FONT></TD>
|
||||
</TR>
|
||||
</TABLE>
|
||||
<A NAME="skip-navbar_bottom"></A>
|
||||
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
||||
|
||||
<HR>
|
||||
Copyright © 2010-2012. All Rights Reserved.
|
||||
</BODY>
|
||||
</HTML>""")
|
||||
}
|
||||
|
||||
|
||||
protected fun printClasses(kind: String, description: String): Unit {
|
||||
val classes = pkg.classes.filter{ it.kind == kind }
|
||||
if (! classes.isEmpty()) {
|
||||
print("""<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
|
||||
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
|
||||
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">""")
|
||||
|
||||
println("<B>$description Summary</B></FONT></TH>")
|
||||
println("""</TR>""")
|
||||
|
||||
for (c in classes) {
|
||||
println("""<TR BGCOLOR="white" CLASS="TableRowColor">""")
|
||||
println("<TD WIDTH=\"15%\"><B><A HREF=\"${pkg.nameAsRelativePath}/${c.nameAsPath}.html\" title=\"$kind in ${pkg.name}\">${c.simpleName}</A></B></TD>")
|
||||
println("<TD>${c.description}</TD>")
|
||||
println("</TR>")
|
||||
}
|
||||
println("""</TABLE>
|
||||
|
||||
|
||||
<P>
|
||||
""")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected fun printNextPrevPackages(): Unit {
|
||||
println("""<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">""")
|
||||
val prev = model.previous(pkg)
|
||||
if (prev != null) {
|
||||
println(" <A HREF=\"${prev.nameAsRelativePath}/${prev.nameAsPath}/package-summary.html\"><B>PREV PACKAGE</B></A> ")
|
||||
}
|
||||
val next = model.next(pkg)
|
||||
if (next != null) {
|
||||
println(" <A HREF=\"${next.nameAsRelativePath}/${next.nameAsPath}/package-summary.html\"><B>NEXT PACKAGE</B></A>")
|
||||
}
|
||||
println("""</FONT></TD>""")
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,13 +6,16 @@ import std.util.*
|
||||
|
||||
import java.util.*
|
||||
|
||||
class KModel(var title: String = "Documentation") {
|
||||
class KModel(var title: String = "Documentation", var version: String = "TODO") {
|
||||
// TODO generates java.lang.NoSuchMethodError: std.util.namespace.hashMap(Ljet/TypeInfo;Ljet/TypeInfo;)Ljava/util/HashMap;
|
||||
//val packages = sortedMap<String,KPackage>()
|
||||
public val packageMap: SortedMap<String,KPackage> = TreeMap<String,KPackage>()
|
||||
|
||||
public val packages: Collection<KPackage> = packageMap.values().sure()
|
||||
|
||||
public val classes: Collection<KClass>
|
||||
get() = packages.flatMap{ it.classes }
|
||||
|
||||
/* Returns the package for the given name, creating one if its not already been create yet */
|
||||
fun getPackage(name: String): KPackage {
|
||||
return packageMap.getOrPut(name){ KPackage(name) }
|
||||
@@ -27,21 +30,52 @@ class KModel(var title: String = "Documentation") {
|
||||
getPackage("").getClass(qualifiedName)
|
||||
}
|
||||
}
|
||||
|
||||
fun previous(pkg: KPackage): KPackage? {
|
||||
return null
|
||||
}
|
||||
|
||||
fun next(pkg: KPackage): KPackage? {
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
class KPackage(val name: String) : Comparable<KPackage> {
|
||||
class KPackage(val name: String, var description: String = "", var detailedDescription: String = "") : Comparable<KPackage> {
|
||||
override fun compareTo(other: KPackage): Int = name.compareTo(other.name)
|
||||
|
||||
fun equals(other: KPackage) = name == other.name
|
||||
|
||||
fun toString() = "KPackage($name)"
|
||||
|
||||
/** Returns the name as a directory using '/' instead of '.' */
|
||||
public val nameAsPath: String
|
||||
get() = name.replace('.', '/')
|
||||
|
||||
/** Returns a list of all the paths in the package name */
|
||||
public val namePaths: List<String>
|
||||
get() {
|
||||
val answer = ArrayList<String>()
|
||||
for (n in name.split("\\.")) {
|
||||
if (n != null) {
|
||||
answer.add(n)
|
||||
}
|
||||
}
|
||||
return answer;
|
||||
}
|
||||
|
||||
/** Returns a relative path like ../.. for each path in the name */
|
||||
public val nameAsRelativePath: String
|
||||
get() = namePaths.map{ ".." }.join("/")
|
||||
|
||||
// TODO generates java.lang.NoSuchMethodError: std.util.namespace.hashMap(Ljet/TypeInfo;Ljet/TypeInfo;)Ljava/util/HashMap;
|
||||
//val classes = sortedMap<String,KClass>()
|
||||
public val classMap: SortedMap<String,KClass> = TreeMap<String,KClass>()
|
||||
|
||||
public val classes: Collection<KClass> = classMap.values().sure()
|
||||
|
||||
public val annotations: Collection<KClass> = ArrayList<KClass>()
|
||||
|
||||
|
||||
/* Returns the class for the given name, creating one if its not already been create yet */
|
||||
fun getClass(simpleName: String): KClass {
|
||||
return classMap.getOrPut(simpleName){ KClass(this, simpleName) }
|
||||
@@ -55,16 +89,31 @@ class KPackage(val name: String) : Comparable<KPackage> {
|
||||
}
|
||||
}
|
||||
|
||||
fun groupClassMap(): Map<String,List<KClass>> {
|
||||
return classes.groupBy(TreeMap<String,List<KClass>>()){it.group}
|
||||
}
|
||||
}
|
||||
|
||||
class KClass(val kpackage: KPackage, val simpleName: String) : Comparable<KClass> {
|
||||
class KClass(val kpackage: KPackage, val simpleName: String,
|
||||
var kind: String = "class", var group: String = "Other", var description: String = "") : Comparable<KClass> {
|
||||
override fun compareTo(other: KClass): Int = name.compareTo(other.name)
|
||||
|
||||
fun equals(other: KClass) = name == other.name
|
||||
|
||||
fun toString() = "KClass($name)"
|
||||
fun toString() = "$kind($name)"
|
||||
|
||||
/** Link to the type which is relative if its a local type but could be a type in a different library or null if no link */
|
||||
public var url: String? = null
|
||||
get() {
|
||||
if ($url == null) $url = "${nameAsPath}.html"
|
||||
return $url
|
||||
}
|
||||
|
||||
public val name: String = kpackage.qualifiedName(simpleName)
|
||||
public val packageName: String = kpackage.name
|
||||
|
||||
/** Returns the name as a directory using '/' instead of '.' */
|
||||
public val nameAsPath: String
|
||||
get() = name.replace('.', '/')
|
||||
|
||||
}
|
||||
+24
-8
@@ -1,4 +1,4 @@
|
||||
package std.template
|
||||
package org.jetbrains.kotlin.template
|
||||
|
||||
import std.io.*
|
||||
import java.io.Writer
|
||||
@@ -16,7 +16,6 @@ import java.io.File
|
||||
* stuff
|
||||
*/
|
||||
trait Template {
|
||||
var printer: Printer
|
||||
|
||||
/** Renders the template to the output printer */
|
||||
fun render(): Unit
|
||||
@@ -32,10 +31,11 @@ trait Template {
|
||||
trait Printer {
|
||||
fun print(value: Any): Unit
|
||||
//fun print(text: String): Unit
|
||||
|
||||
}
|
||||
|
||||
|
||||
class NullPrinter() : Printer {
|
||||
//override fun print(text: String) = none()
|
||||
override fun print(value: Any) {
|
||||
throw UnsupportedOperationException("No Printer defined on the Template")
|
||||
}
|
||||
@@ -47,22 +47,26 @@ class NullPrinter() : Printer {
|
||||
abstract class TemplateSupport : Template {
|
||||
}
|
||||
|
||||
val newline: String = System.getProperty("line.separator") ?: "\n"
|
||||
|
||||
/**
|
||||
* Base class for templates generating text output
|
||||
* by printing values to some underlying Printer which
|
||||
* will typically output to a String, File, stream etc.
|
||||
*/
|
||||
abstract class TextTemplate() : TemplateSupport(), Printer {
|
||||
override var printer: Printer = NullPrinter()
|
||||
public var printer: Printer = NullPrinter()
|
||||
|
||||
fun String.plus(): Unit {
|
||||
printer.print(this)
|
||||
}
|
||||
|
||||
//override fun print(value: String) = printer.print(value)
|
||||
|
||||
override fun print(value: Any) = printer.print(value)
|
||||
|
||||
fun println(value: Any) {
|
||||
print(value)
|
||||
print(newline)
|
||||
}
|
||||
|
||||
fun renderToText(): String {
|
||||
val buffer = StringWriter()
|
||||
@@ -75,9 +79,21 @@ abstract class TextTemplate() : TemplateSupport(), Printer {
|
||||
this.render()
|
||||
}
|
||||
|
||||
fun renderTo(os: OutputStream): Unit = renderTo(OutputStreamWriter(os))
|
||||
fun renderTo(os: OutputStream): Unit {
|
||||
// TODO compiler error
|
||||
//OutputStreamWriter(os).foreach{ renderTo(it) }
|
||||
val s = OutputStreamWriter(os)
|
||||
renderTo(s)
|
||||
s.close()
|
||||
}
|
||||
|
||||
fun renderTo(file: File): Unit = renderTo(FileWriter(file))
|
||||
fun renderTo(file: File): Unit {
|
||||
// TODO compiler error
|
||||
//FileWriter(file).foreach{ s -> renderTo(s) }
|
||||
val s = FileWriter(file)
|
||||
renderTo(s)
|
||||
s.close()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -15,14 +15,14 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package org.jetbrains.kotlin.doc;
|
||||
package test.kotlin.doc;
|
||||
|
||||
import junit.framework.TestSuite;
|
||||
|
||||
/**
|
||||
*/
|
||||
public class TestAll {
|
||||
public class KDocTestAll {
|
||||
public static TestSuite suite() {
|
||||
return TestSuite(ModelTest.class);
|
||||
return new TestSuite("test.kotlin.doc.ModelTest");
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package test.model
|
||||
package test.kotlin.doc
|
||||
|
||||
import std.*
|
||||
import std.util.*
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
package test.org.jetbrains.kotlin.template
|
||||
package test.kotlin.template
|
||||
|
||||
import std.*
|
||||
import std.template.*
|
||||
import org.jetbrains.kotlin.template.*
|
||||
import std.io.*
|
||||
import std.util.*
|
||||
import java.util.*
|
||||
Reference in New Issue
Block a user