Exemple #1
0
        public static void ClassInitialize(TestContext context)
        {
            // Create test folder and test images
            UnitTestImageUtils.CreateTestImages("./testFolder", 3);

            // Create repository
            filesystemRepository = new FilesystemRepository(UnitTestImageUtils.imagesFolder);
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Stopwatch watch   = Stopwatch.StartNew();
            var       program = new Program();

            var configuration = new Configuration(ReadPath, WritePath);

            var filesystemRepository = new FilesystemRepository();

            program.MutateTocInMdFiles(configuration, filesystemRepository);
            program.GenerateSite(configuration, filesystemRepository);

            Console.WriteLine($"Done in {watch.ElapsedMilliseconds} millis.");
        }
Exemple #3
0
        public void GenerateSite(Configuration configuration, FilesystemRepository filesystemRepository)
        {
            var contentGenerator     = new ContentGenerator();
            var extractor            = new TagsExtractor(filesystemRepository);
            var htmlTransformer      = new MarkdownToHtml();
            var expandTagsToMarkdown = new ExpandTagsToMarkdown(filesystemRepository);
            var readMdAndWriteHtml   = new ReadMdAndWriteHtml(filesystemRepository, contentGenerator, htmlTransformer, expandTagsToMarkdown);

            var siteGenerator = new SiteGenerator(
                contentGenerator,
                filesystemRepository,
                extractor,
                readMdAndWriteHtml,
                htmlTransformer);

            siteGenerator.Execute(configuration, baseUrl, editBaseUrl);
        }