public object Execute(IFileSystemObject input)
    {
        var fileContents = markdownFileParser.ReadFile(input.FullPath);

        var htmlFile = markdownConverter.Convert(fileContents);

        htmlFile.HtmlContent = templateFiller.FillSiteTemplate(htmlFile.HtmlContent);

        var inputRoot = fileSystem.Path.GetFullPath(options.PathToMarkdownFiles);

        var fileRelativeInputRoot = fileSystem.Path.GetRelativePath(inputRoot, input.FullPath);
        var outputFilePath        = fileSystem.Path.Combine(options.OutputLocation, fileRelativeInputRoot).Replace(".md", ".html");

        fileWriter.Write(outputFilePath, htmlFile.HtmlContent);

        return(null);
    }
Example #2
0
 public void Write(string filePath, string htmlString)
 {
     HtmlFileWriter.Write(filePath, htmlString);
 }