<xs:element ref="theta" />
<xs:element ref="typeparamref" />
<xs:element ref="whitespace" />
+ <xs:element ref="img" />
</xs:choice>
</xs:complexType>
</xs:element>
+ <xs:element name="img">
+ <xs:complexType>
+ <xs:attribute name="href" type="xs:string" use="required" />
+ <xs:attribute name="class" type="xs:string" use="optional" />
+ </xs:complexType>
+ </xs:element>
+
<xs:element name="param">
<xs:complexType mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
return nsxml;
}
+ internal static string GetImageFile (string dir, string img)
+ {
+ string path = Path.Combine (dir, "_images", img);
+ return File.Exists (path) ? path : null;
+ }
+
public static string GetCref (XmlElement member)
{
string typeName = XmlDocUtils.ToEscapedTypeName (member.SelectSingleNode("/Type/@FullName").InnerText);
}
tree.HelpSource.PackXml ("mastersummary.xml", nsSummary, null);
AddExtensionMethods (tree);
+ AddImageFiles (hs, tree);
}
void AddExtensionMethods (Tree tree)
tree.HelpSource.PackXml ("ExtensionMethods.xml", extensions, "ExtensionMethods.xml");
}
}
-
+
+ void AddImageFiles (HelpSource hs, Tree tree)
+ {
+ foreach (string asm in asm_dirs) {
+ string path = Path.Combine (asm, "_images");
+ Console.WriteLine ("Loulou {0}", path);
+ if (!Directory.Exists (path))
+ return;
+
+ foreach (var img in Directory.EnumerateFiles (path)) {
+ Console.WriteLine ("adding {0}", img);
+ hs.PackFile (img, Path.GetFileName (img));
+ }
+ }
+ }
+
Hashtable/*<string, List<TypeInfo>>*/ class_summaries = new Hashtable ();
Hashtable/*<string, XmlNode>*/ namespace_summaries = new Hashtable ();
Hashtable/*<string, XmlNode>*/ namespace_remarks = new Hashtable ();
XsltArgumentList args = new XsltArgumentList();
args.AddExtensionObject("monodoc:///extensions", ExtObject);
+
+ args.AddParam ("source-id", "", SourceID.ToString ());
if (rest == "") {
args.AddParam("show", "", "typeoverview");
return node.URL[idx+1] + ":" + full + "." + node.Caption;
}
}
+
+ public override Stream GetImage (string url)
+ {
+ if (url.Contains ("/"))
+ url = url.Substring (url.LastIndexOf ('/') + 1);
+ return GetHelpStream (url);
+ }
//
// Populates the index.
doc.Load (id);
return doc;
}
+
+ public virtual Stream GetImage (string url)
+ {
+ string path = EcmaDoc.GetImageFile (basedir.FullName, url);
+ if (path == null)
+ return null;
+ return File.OpenRead (path);
+ }
class UncompiledResolver : XmlResolver {
public override Uri ResolveUri (Uri baseUri, string relativeUri)
<!-- TEMPLATE PARAMETERS -->
<xsl:param name="language" select="'C#'"/>
<xsl:param name="index" />
+ <xsl:param name="source-id"/>
<xsl:variable name="ThisType" select="/Type"/>
<xsl:with-param name="content" select="string(descendant-or-self::text())" />
</xsl:call-template>
</xsl:template>
+ <xsl:template match="img">
+ <p>
+ <img src="source-id:{$source-id}:{@href}">
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="count(@class)>0">
+ <xsl:value-of select="@class" />
+ </xsl:when>
+ <xsl:otherwise>picture</xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ </img>
+ </p>
+ </xsl:template>
<xsl:template match="onequarter">¼</xsl:template>
<xsl:template match="pi">π</xsl:template>