public DocumentationType(Type type, DocumentationCategory category) { Type = type; Name = DocumentationGenerator.GetCleanName(type); RawName = type.Name; NiceName = DocumentationGenerator.GetNiceName(Name); Id = DocumentationGenerator.GetTypeId(type); Filename = GetFilename(category); Link = category.GetLink(type); }
private string GetTypeLink(Type type, DocumentationCategory category, string template) { var cleanName = DocumentationGenerator.GetCleanName(type); var niceName = DocumentationGenerator.GetNiceName(cleanName); var id = DocumentationGenerator.GetTypeId(type); return(template .Replace(DocumentationGenerator.CategoryNameTag, category?.Name) .Replace(DocumentationGenerator.CategoryNiceNameTag, category?.NiceName) .Replace(DocumentationGenerator.CategoryIdTag, category?.Id) .Replace(DocumentationGenerator.TypeIdTag, id) .Replace(DocumentationGenerator.TypeNameTag, cleanName) .Replace(DocumentationGenerator.TypeRawNameTag, type.Name) .Replace(DocumentationGenerator.TypeNiceNameTag, niceName) .Replace(DocumentationGenerator.TypeNamespaceTag, type.Namespace) .Replace('`', '-')); // this is specific to msdn but potentially makes sense for other scenarios as well }
public void Validate() { var types = TypeHelper.FindTypes(type => DocumentationGenerator.IsTypeIncluded(type, DocumentationTypeCategory.Asset | DocumentationTypeCategory.Behaviour, IncludedNamespaces)); foreach (var type in types) { var id = DocumentationGenerator.GetTypeId(type); var url = UrlRoot + id; var attribute = TypeHelper.GetAttribute <HelpURLAttribute>(type); if (attribute == null) { Debug.LogWarningFormat(_missingHelpUrlWarning, type.Name); } else if (attribute.URL != url) { Debug.LogWarningFormat(_invalidHelpUrlWarning, type.Name, attribute.URL, url); } } }