private static string WrapInHtmlDocument(string theme, string sourceFilePath, string html, string title, bool disableHeaderNumbering, string configurableParametersFileName, ref List <ProcessorError> errors) { var layout = ThemeProvider.GetContent(theme); IAfterConversionToHtmlStep[] steps = { new BodyPlaceholder(html), // should be the first step new CssPlaceholder(theme), new AfterConversionToHtml.TitlePlaceholder(title), new DatePlaceholder(), new AuthorLine(), new HeaderNumbering(!disableHeaderNumbering), new IconBlocks(), new IconLists(), new SetCorrectChaptersLinkTitle(sourceFilePath), new EmbedImages(sourceFilePath), new ConfigurablePlaceholders(sourceFilePath, configurableParametersFileName) }; var result = layout; foreach (var step in steps) { var stepResult = step.Apply(result); errors.AddRange(stepResult.Errors); result = stepResult.ResultingHtml; } return(result); }