Skip to content

Instantly share code, notes, and snippets.

@ignatov
Created July 4, 2011 22:01
Show Gist options
  • Save ignatov/1064000 to your computer and use it in GitHub Desktop.
Save ignatov/1064000 to your computer and use it in GitHub Desktop.
Export fix
Index: src/main/scala/scala/tools/colladoc/api/ExportService.scala
===================================================================
--- src/main/scala/scala/tools/colladoc/api/ExportService.scala (revision 3d8cdc01d382129af82be095e5712ac00d25d86b)
+++ src/main/scala/scala/tools/colladoc/api/ExportService.scala (revision )
@@ -89,20 +89,24 @@
protected def processTemplate(tpl: DocTemplateEntity): NodeSeq =
<xml:group>
- { if (tpl.comment.get.isUpdated) {
+ { tpl.comment match {
+ case Some(c) =>
+ if (c.isUpdated) {
- <item>
- <type>{ tpl match {
- case _ if tpl.isPackage => "package"
- case _ if tpl.isTrait => "trait"
- case _ if tpl.isClass => "class"
- case _ if tpl.isObject => "object"
- }}</type>
- <filename>{ entityToFileName(tpl) }</filename>
- <identifier>{ tpl.uniqueName }</identifier>
+ <item>
+ <type>{ tpl match {
+ case _ if tpl.isPackage => "package"
+ case _ if tpl.isTrait => "trait"
+ case _ if tpl.isClass => "class"
+ case _ if tpl.isObject => "object"
+ }}</type>
+ <filename>{ entityToFileName(tpl) }</filename>
+ <identifier>{ tpl.uniqueName }</identifier>
- <newcomment>{ tpl.comment.get.source.get }</newcomment>
+ <newcomment>{ c.source.get }</newcomment>
- </item>
- }
+ </item>
+ }
+ case None =>
- }
+ }
+ }
{ (tpl.values ++ tpl.abstractTypes ++ tpl.methods) map { processMember(_) } }
{ tpl.members collect { case t: DocTemplateEntity if rec => t } map { construct(_) } }
</xml:group>
Index: src/main/scala/scala/tools/colladoc/page/Template.scala
===================================================================
--- src/main/scala/scala/tools/colladoc/page/Template.scala (revision 3d8cdc01d382129af82be095e5712ac00d25d86b)
+++ src/main/scala/scala/tools/colladoc/page/Template.scala (revision )
@@ -328,7 +328,8 @@
case cmt: Comment => pars ::= "rev=%s" format(cmt.dateTime.is.getTime)
case _ =>
}
- val path = memberToPath(mbr, isSelf) + ".xml" + pars.mkString("?", "&", "")
+ val abs = "/" + mbr.uniqueName.replace(".", "/").replace("#", "$")
+ val path = abs + ".xml" + pars.mkString("?", "&", "")
JsRaw("window.open('%s', 'Export')" format (path))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment