diff options
author | Paul Phillips <paulp@improving.org> | 2011-09-20 16:21:23 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2011-09-20 16:21:23 +0000 |
commit | 47a131ac36c1d98686d15394b60447ae620765e7 (patch) | |
tree | b9f7ef98ee73591b8f238dcf81e220d8f7f18af2 /src | |
parent | 088094b1c82ee38b10d84c4826b740a4e0f5f0fe (diff) | |
download | scala-47a131ac36c1d98686d15394b60447ae620765e7.tar.gz scala-47a131ac36c1d98686d15394b60447ae620765e7.tar.bz2 scala-47a131ac36c1d98686d15394b60447ae620765e7.zip |
Two argument asserts please.
No review.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala | 134 |
1 files changed, 69 insertions, 65 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala b/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala index d629b73572..c21507ef45 100644 --- a/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/html/HtmlFactory.scala @@ -23,6 +23,68 @@ class HtmlFactory(val universe: doc.Universe, index: doc.Index) { def siteRoot: JFile = new JFile(universe.settings.outdir.value) + def libResources = List( + "index.js", + "jquery-ui.js", + "jquery.js", + "jquery.layout.js", + "scheduler.js", + "template.js", + "tools.tooltip.js", + + "index.css", + "ref-index.css", + "template.css", + + "class.png", + "class_big.png", + "object.png", + "object_big.png", + "package.png", + "package_big.png", + "trait.png", + "trait_big.png", + + "class_to_object_big.png", + "object_to_class_big.png", + "object_to_trait_big.png", + "trait_to_object_big.png", + + "arrow-down.png", + "arrow-right.png", + "filter_box_left.png", + "filter_box_left2.gif", + "filter_box_right.png", + "filterbg.gif", + "filterboxbarbg.gif", + "filterboxbg.gif", + + "constructorsbg.gif", + "defbg-blue.gif", + "defbg-green.gif", + "filterboxbarbg.png", + "fullcommenttopbg.gif", + "ownderbg2.gif", + "ownerbg.gif", + "ownerbg2.gif", + "packagesbg.gif", + "signaturebg.gif", + "signaturebg2.gif", + "typebg.gif", + "valuemembersbg.gif", + + "navigation-li-a.png", + "navigation-li.png", + "remove.png", + "selected-right.png", + "selected.png", + "selected2-right.png", + "selected2.png", + "unselected.png", + + "rootdoc.txt" + ) + /** Generates the Scaladoc site for a model into the site root. * A scaladoc site is a set of HTML and related files * that document a model extracted from a compiler run. @@ -31,8 +93,9 @@ class HtmlFactory(val universe: doc.Universe, index: doc.Index) { def copyResource(subPath: String) { val bytes = new Streamable.Bytes { - val inputStream = getClass.getResourceAsStream("/scala/tools/nsc/doc/html/resource/" + subPath) - assert(inputStream != null) + val p = "/scala/tools/nsc/doc/html/resource/" + subPath + val inputStream = getClass.getResourceAsStream(p) + assert(inputStream != null, p) }.toByteArray val dest = Directory(siteRoot) / subPath dest.parent.createDirectory() @@ -41,72 +104,14 @@ class HtmlFactory(val universe: doc.Universe, index: doc.Index) { finally out.close() } - copyResource("lib/jquery.js") - copyResource("lib/jquery-ui.js") - copyResource("lib/jquery.layout.js") - copyResource("lib/tools.tooltip.js") - copyResource("lib/scheduler.js") - copyResource("lib/index.js") - copyResource("lib/template.js") - - copyResource("lib/index.css") - copyResource("lib/ref-index.css") - copyResource("lib/template.css") - - copyResource("lib/class.png") - copyResource("lib/class_big.png") - copyResource("lib/object.png") - copyResource("lib/object_big.png") - copyResource("lib/trait.png") - copyResource("lib/trait_big.png") - copyResource("lib/package.png") - copyResource("lib/package_big.png") - - copyResource("lib/class_to_object_big.png") - copyResource("lib/object_to_class_big.png") - copyResource("lib/object_to_trait_big.png") - copyResource("lib/trait_to_object_big.png") - - copyResource("lib/arrow-down.png") - copyResource("lib/arrow-right.png") - copyResource("lib/filter_box_left.png") - copyResource("lib/filter_box_right.png") - copyResource("lib/filter_box_left2.gif") - copyResource("lib/filterbg.gif") - copyResource("lib/filterboxbarbg.gif") - copyResource("lib/filterboxbg.gif") - - copyResource("lib/constructorsbg.gif") - copyResource("lib/defbg-blue.gif") - copyResource("lib/defbg-green.gif") - copyResource("lib/fullcommenttopbg.gif") - copyResource("lib/ownderbg2.gif") - copyResource("lib/ownerbg.gif") - copyResource("lib/ownerbg2.gif") - copyResource("lib/signaturebg.gif") - copyResource("lib/signaturebg2.gif") - copyResource("lib/packagesbg.gif") - copyResource("lib/typebg.gif") - copyResource("lib/valuemembersbg.gif") - copyResource("lib/filterboxbarbg.png") - - copyResource("lib/remove.png") - copyResource("lib/navigation-li-a.png") - copyResource("lib/navigation-li.png") - copyResource("lib/selected-right.png") - copyResource("lib/selected.png") - copyResource("lib/selected2-right.png") - copyResource("lib/selected2.png") - copyResource("lib/unselected.png") - - copyResource("lib/rootdoc.txt") + libResources foreach (s => copyResource("lib/" + s)) new page.Index(universe, index) writeFor this new page.IndexScript(universe, index) writeFor this - writeTemplates(page => page.writeFor(this)) + writeTemplates(_ writeFor this) - for(letter <- index.firstLetterIndex) { + for (letter <- index.firstLetterIndex) { new html.page.ReferenceIndex(letter._1, index, universe) writeFor this } } @@ -118,11 +123,10 @@ class HtmlFactory(val universe: doc.Universe, index: doc.Index) { if (!(written contains tpl)) { writeForThis(new page.Template(tpl)) written += tpl - tpl.templates map (writeTemplate(_)) + tpl.templates map writeTemplate } } writeTemplate(universe.rootPackage) } - } |