public void Generate(string outputFolder) { var types = TypeHelper.FindTypes(type => !type.IsEnum && DocumentationGenerator.IsTypeIncluded(type, IncludedTypes, IncludedNamespaces)); var warnings = GenerateLogDescriptions(types, _warningFieldSuffix, MessageTemplate); var errors = GenerateLogDescriptions(types, _errorFieldSuffix, MessageTemplate); var content = DocumentTemplate .Replace(_logWarningsTag, warnings) .Replace(_logErrorsTag, errors); DocumentationGenerator.WriteFile(outputFolder, OutputFile, content); }
private string GetTypeLink(Type type) { if (DocumentationGenerator.IsTypeIncluded(type, IncludedNamespaces)) { return(GetTypeLink(type, this, Templates.InternalLink)); } foreach (var external in ExternalNamespaces) { if (DocumentationGenerator.IsTypeIncluded(type, new List <string> { external.Namespace })) { return(GetTypeLink(type, this, external.LinkTemplate)); } } return(GetTypeLink(type, null, Templates.UnknownLink)); }
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); } } }
private bool IsTypeIncluded(Type type) { return(DocumentationGenerator.IsTypeIncluded(type, IncludedTypes, IncludedNamespaces)); }