Esempio n. 1
0
        public override void ProcessStep(HtmlExporter htmlExporter)
        {
            htmlExporter.ExecuteOnStepProgress(50);

            CreateHtml(htmlExporter, htmlExporter.Repository, htmlExporter.CurrentStrings, htmlExporter.CurrentLanguage, htmlExporter.OutputPath);

            htmlExporter.ExecuteOnStepProgress(100);
            htmlExporter.CurrentStep = null;
        }
Esempio n. 2
0
        public override void ProcessStep(HtmlExporter htmlExporter)
        {
            htmlExporter.ExecuteOnStepProgress(5);
            htmlExporter.ExecuteOnStepMessage(htmlExporter.HtmlStrings.CreatingNavigation);
            CreateIndexNav(htmlExporter.Repository, htmlExporter.CurrentStrings, htmlExporter.CurrentLanguage, htmlExporter.OutputPath);

            htmlExporter.ExecuteOnStepProgress(10);
            CreateNamespaceNavs(htmlExporter.Repository, htmlExporter.CurrentStrings, htmlExporter.OutputPath);

            htmlExporter.ExecuteOnStepProgress(15);
            CreateArticleNavs(htmlExporter.Repository, htmlExporter.CurrentStrings, htmlExporter.CurrentLanguage, htmlExporter.OutputPath);

            htmlExporter.CurrentStep = new CreateArticleStep();
        }
Esempio n. 3
0
        public override void ProcessStep(HtmlExporter htmlExporter)
        {
            htmlExporter.ExecuteOnStepProgress(40);

            CopyAssets(htmlExporter, Path.Combine(Path.GetDirectoryName(this.GetType().Assembly.Location), "assets"), htmlExporter.OutputPath);
            CopyImages(htmlExporter, htmlExporter.Repository.Images, htmlExporter.OutputPath);
            CopyImage(htmlExporter, htmlExporter.Repository.ProjectInfo.LogoPath, htmlExporter.OutputPath);

            htmlExporter.CurrentStep = new CreateHtmlStep();
        }
Esempio n. 4
0
        public override void ProcessStep(HtmlExporter htmlExporter)
        {
            htmlExporter.ExecuteOnStepProgress(0);
            htmlExporter.ExecuteOnStepMessage(htmlExporter.HtmlStrings.CreatingFolders);

            CreateFolder(htmlExporter.OutputPath, "namespace");
            CreateFolder(htmlExporter.OutputPath, "type");
            CreateFolder(htmlExporter.OutputPath, "constructor");
            CreateFolder(htmlExporter.OutputPath, "method");
            CreateFolder(htmlExporter.OutputPath, "field");
            CreateFolder(htmlExporter.OutputPath, "property");
            CreateFolder(htmlExporter.OutputPath, "event");
            CreateFolder(htmlExporter.OutputPath, "article");
            CreateFolder(htmlExporter.OutputPath, "nav");

            htmlExporter.CurrentStep = new CreateNavigationStep();
        }
Esempio n. 5
0
        public override void ProcessStep(HtmlExporter htmlExporter)
        {
            htmlExporter.ExecuteOnStepProgress(20);

            if (htmlExporter.Repository.Articles.Count > 0)
            {
                var articles = htmlExporter.Repository.Articles.ContainsKey(htmlExporter.CurrentLanguage)
                    ? htmlExporter.Repository.Articles[htmlExporter.CurrentLanguage]
                    : htmlExporter.Repository.Articles["default"];

                foreach (var article in articles)
                {
                    htmlExporter.ExecuteOnStepMessage(string.Format(htmlExporter.HtmlStrings.CreatingArticle,
                        article.Title));
                    CreateArticle(article, htmlExporter.Repository, htmlExporter.CurrentStrings, htmlExporter.OutputPath);
                }
            }

            htmlExporter.CurrentStep = new CopyStep();
        }
Esempio n. 6
0
        private void CreateHtml(HtmlExporter htmlExporter, SDRepository repository, IStrings strings, string docLanguage, string outputPath)
        {
            var indexTemplate = new IndexTemplate { Repository = repository, Strings = strings, CurrentLanguage = docLanguage };
            File.WriteAllText(Path.Combine(outputPath, "index.html"), indexTemplate.TransformText());

            var namespaceCount = 0d;
            var namespaceTotal = repository.GetAllNamespaces().Count;
            foreach (var nameSpace in repository.GetAllNamespaces())
            {
                htmlExporter.ExecuteOnStepProgress(Convert.ToInt16((namespaceCount / namespaceTotal) * 50) + 50);
                htmlExporter.ExecuteOnStepMessage(htmlExporter.HtmlStrings.CreateFilesForNamespace + ": " + nameSpace.Fullname);
                namespaceCount++;

                var namespaceTemplate = new NamespaceTemplate { Strings = strings, CurrentLanguage = docLanguage, Namespace = nameSpace, Repository = repository };
                File.WriteAllText(Path.Combine(outputPath, "namespace", nameSpace.Guid + ".html"), namespaceTemplate.TransformText());

                foreach (var type in nameSpace.Types)
                {
                    type.SortMembers();
                    var typeTemplate = new TypeTemplate
                    {
                        Strings = strings,
                        CurrentLanguage = type.Documentation.ContainsKey(docLanguage) ? docLanguage : "default",
                        SDType = type,
                        Repository = repository
                    };
                    File.WriteAllText(Path.Combine(outputPath, "type", type.Guid + ".html"), typeTemplate.TransformText());

                    foreach (var constructor in type.Constructors)
                    {
                        var memberTemplate = new MemberTemplate
                        {
                            Strings = strings,
                            CurrentLanguage = constructor.Documentation.ContainsKey(docLanguage) ? docLanguage : "default",
                            SDType = type,
                            SDMember = constructor,
                            Repository = repository
                        };
                        File.WriteAllText(Path.Combine(outputPath, "constructor", constructor.Guid + ".html"), memberTemplate.TransformText());
                    }
                    foreach (var method in type.Methods)
                    {
                        var memberTemplate = new MemberTemplate
                        {
                            Strings = strings,
                            CurrentLanguage = method.Documentation.ContainsKey(docLanguage) ? docLanguage : "default",
                            SDType = type,
                            SDMember = method,
                            Repository = repository
                        };
                        File.WriteAllText(Path.Combine(outputPath, "method", method.Guid + ".html"), memberTemplate.TransformText());
                    }
                    foreach (var field in type.Fields)
                    {
                        var memberTemplate = new MemberTemplate
                        {
                            Strings = strings,
                            CurrentLanguage = field.Documentation.ContainsKey(docLanguage) ? docLanguage : "default",
                            SDType = type,
                            SDMember = field,
                            Repository = repository
                        };
                        File.WriteAllText(Path.Combine(outputPath, "field", field.Guid + ".html"), memberTemplate.TransformText());
                    }
                    foreach (var property in type.Properties)
                    {
                        var memberTemplate = new MemberTemplate
                        {
                            Strings = strings,
                            CurrentLanguage = property.Documentation.ContainsKey(docLanguage) ? docLanguage : "default",
                            SDType = type,
                            SDMember = property,
                            Repository = repository
                        };
                        File.WriteAllText(Path.Combine(outputPath, "property", property.Guid + ".html"), memberTemplate.TransformText());
                    }
                    foreach (var eve in type.Events)
                    {
                        var memberTemplate = new MemberTemplate
                        {
                            Strings = strings,
                            CurrentLanguage = eve.Documentation.ContainsKey(docLanguage) ? docLanguage : "default",
                            SDType = type,
                            SDMember = eve,
                            Repository = repository
                        };
                        File.WriteAllText(Path.Combine(outputPath, "event", eve.Guid + ".html"), memberTemplate.TransformText());
                    }
                }
            }
        }