Ejemplo n.º 1
0
        static string MutateAllTagsLine(string fileContent, TagCollection tags, string baseUrl, ContentGenerator contentGenerator)
        {
            var content = AllTagsEx.Replace(
                fileContent,
                z => string.Join(" ", tags
                                 .Select(x => x.Key)
                                 .OrderBy(x => x.Value)
                                 .Select(x => contentGenerator.GenerateCategoryLink(x, baseUrl))));

            return(content);
        }
Ejemplo n.º 2
0
        static string MutateCategoryTags(string fileContent, string baseUrl, ContentGenerator contentGenerator)
        {
            var content = TagsExtractor.CategoryEx.Replace(
                fileContent,
                x =>
            {
                var parsedTags = TagsExtractor.ExtractTags(x.Groups["tags"].Value);
                var links      = parsedTags.Select(tag => contentGenerator.GenerateCategoryLink(tag, baseUrl));
                return(string.Join("\r\n", links) + "\r\n");
            });

            return(content);
        }