private static bool HaveDocsFor(TypeReference t) { if (!t.Namespace.StartsWith("Unity")) { return(false); } return(UnityDocumentation.MemDocFor(t) != null); }
private IEnumerable <Tuple <string, bool> > GetParentNamespaces(string namespaze) { var accumulated = ""; bool first = true; foreach (string s in namespaze.Split('.')) { if (!first) { accumulated += "."; } accumulated += s; yield return(new Tuple <string, bool>(accumulated, UnityDocumentation.IsDocumentedNamespace(s))); first = false; } }
public string GeneratePageFor(string namespaze, AssemblyDefinition[] assemblyDefinitions) { var types = assemblyDefinitions.Select(a => a.MainModule).SelectMany(m => m.Types).Where( t => t.Namespace == namespaze && UnityDocumentation.IsDocumentedType(t)); var sb = new StringBuilder(); sb.Append(PageHeader()); sb.AppendFormat(@" <div class='text'> <article>"); sb.Append("<h1>"); var htmlbuilder = new HtmlBuilder(); htmlbuilder.AddKeyword("namespace"); htmlbuilder.Add(" "); htmlbuilder.AddNamespaceReference(namespaze, HtmlBuilder.NamespaceHyperlinkMode.LinkOnlyParentNamespaces); sb.Append(htmlbuilder); sb.Append("</h1>"); sb.Append("<ul>"); foreach (var type in types) { sb.Append("<li>"); var memdoc = UnityDocumentation.MemDocFor(type); var html = new HtmlBuilder(); html.AddTypeReference(type, true); sb.Append(html); sb.Append(" "); if (memdoc != null) { sb.Append(memdoc.Summary); } sb.Append("<br>"); sb.Append("</li>"); } sb.Append("</ul>"); sb.AppendFormat(@" </div></article>"); return(sb.ToString()); }
private object UrlFor(MemberReference memberReference) { var arrayType = memberReference as ArrayType; if (arrayType != null) { return(UrlFor(arrayType.GetElementType())); } if (memberReference is TypeDefinition) { return(UnityDocumentation.HtmlNameFor((TypeDefinition)memberReference)); } var declaringType = memberReference.DeclaringType; if (declaringType == null) { return("nourl"); } return(UrlFor(declaringType) + "#" + memberReference.Name); }
public string OutputFileNameForType(TypeDefinition t) { return(ScriptApiOutputDirectory + "/" + UnityDocumentation.HtmlNameFor(t)); }
private string UrlForNamespace(string namespaze) { return(UnityDocumentation.HtmlNameFor(namespaze)); }