private void CreateArticles(IEnumerable<SDArticle> articles)
        {
            foreach (var article in articles)
            {
                var articleHtmlFile = Path.Combine(StepInput.TmpPath, Helper.RemoveIllegalCharacters(article.Title.Replace(" ", "_")) + ".html");

                var template = new ArticleTemplate { SDArticle = article };
                File.WriteAllText(articleHtmlFile, template.TransformText());

                CreateArticles(article.Children);
            }
        }
Beispiel #2
0
        private void CreateArticles(IEnumerable<SDArticle> articles)
        {
            foreach (var article in articles)
            {
                var articleHtmlFile = Path.Combine(_tmpFilepath, Helper.RemoveIllegalCharacters(article.Title.Replace(" ", "_")) + ".html");

                if (string.IsNullOrEmpty(article.Content) || article.Content == "SDDoc")
                {
                    var template = new EmptyArticleTemplate { ProjectInfo = _repository.ProjectInfo, SDRepository = _repository, SDArticle = article, Strings = _strings };
                    File.WriteAllText(articleHtmlFile, template.TransformText());
                }
                else
                {
                    var template = new ArticleTemplate { ProjectInfo = _repository.ProjectInfo, Repository = _repository, SDArticle = article, Strings = _strings };
                    File.WriteAllText(articleHtmlFile, template.TransformText());
                }

                CreateArticles(article.Children);
            }
        }