예제 #1
0
        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);
        }
예제 #2
0
        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));
        }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
 private bool IsTypeIncluded(Type type)
 {
     return(DocumentationGenerator.IsTypeIncluded(type, IncludedTypes, IncludedNamespaces));
 }