diff options
author | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2010-08-19 14:04:09 +0000 |
---|---|---|
committer | Gilles Dubochet <gilles.dubochet@epfl.ch> | 2010-08-19 14:04:09 +0000 |
commit | 16adcd1fa8abcdf8e5767d42f5b52409e3a5e294 (patch) | |
tree | 2a66cd04cadead8499281e102f04962eaf10785b /src/compiler/scala/tools/nsc/doc/DocFactory.scala | |
parent | 1ededc1ab0be9565ab75f971cba7604ce977803c (diff) | |
download | scala-16adcd1fa8abcdf8e5767d42f5b52409e3a5e294.tar.gz scala-16adcd1fa8abcdf8e5767d42f5b52409e3a5e294.tar.bz2 scala-16adcd1fa8abcdf8e5767d42f5b52409e3a5e294.zip |
[scaladoc] Merges Petr's change to Scaladoc fro...
[scaladoc] Merges Petr's change to Scaladoc from the Colladoc branch:
bugfixes, improvements and refactorings that make it possible to extends
Scaladoc into Colladoc.
- Layout of index uses jQuery UI panel instead of frameset.
- Search boxes have correct width on Firefox.
- Scaladoc models the original, untransformed source.
- Various internal bugfixes & refactorings.
Review by dubochet.
Diffstat (limited to 'src/compiler/scala/tools/nsc/doc/DocFactory.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/doc/DocFactory.scala | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/doc/DocFactory.scala b/src/compiler/scala/tools/nsc/doc/DocFactory.scala index d303d1e65a..8b800381b8 100644 --- a/src/compiler/scala/tools/nsc/doc/DocFactory.scala +++ b/src/compiler/scala/tools/nsc/doc/DocFactory.scala @@ -26,7 +26,7 @@ import reporters.Reporter class DocFactory(val reporter: Reporter, val settings: doc.Settings) { processor => /** The unique compiler instance used by this processor and constructed from its `settings`. */ - object compiler extends Global(settings, reporter) with interactive.RangePositions{ + object compiler extends Global(settings, reporter) with interactive.RangePositions { override protected def computeInternalPhases() { phasesSet += syntaxAnalyzer phasesSet += analyzer.namerFactory @@ -46,16 +46,21 @@ class DocFactory(val reporter: Reporter, val settings: doc.Settings) { processor /** Creates a scaladoc site for all symbols defined in this call's `files`, as well as those defined in `files` of * previous calls to the same processor. * @param files The list of paths (relative to the compiler's source path, or absolute) of files to document. */ - def document(files: List[String]): Unit = { + def universe(files: List[String]): Option[Universe] = { (new compiler.Run()) compile files compiler.addSourceless assert(settings.docformat.value == "html") if (!reporter.hasErrors) { val modelFactory = (new model.ModelFactory(compiler, settings) with model.comment.CommentFactory with model.TreeFactory) - val docModel = modelFactory.makeModel println("model contains " + modelFactory.templatesCount + " documentable templates") - (new html.HtmlFactory(docModel)).generate + Some(modelFactory.makeModel) } + else None } + /** Generate document(s) for all `files` containing scaladoc documenataion. + * @param files The list of paths (relative to the compiler's source path, or absolute) of files to document. */ + def document(files: List[String]): Unit = + universe(files) foreach { docModel => (new html.HtmlFactory(docModel)).generate } + } |