Exemple #1
0
        /// <summary>Renders the dynamic page.</summary>
        ///
        /// <param name="markdownPage">  The markdown page.</param>
        /// <param name="scopeArgs">     The scope arguments.</param>
        /// <param name="renderHtml">    true to render HTML.</param>
        /// <param name="renderTemplate">true to render template.</param>
        /// <param name="templatePath">  Full pathname of the template file.</param>
        ///
        /// <returns>A string.</returns>
        public string RenderDynamicPage(MarkdownPage markdownPage, Dictionary<string, object> scopeArgs,
            bool renderHtml, bool renderTemplate, string templatePath = null)
        {
            scopeArgs = scopeArgs ?? new Dictionary<string, object>();
            var htmlPage = markdownPage.RenderToString(scopeArgs, renderHtml);
            if (!renderTemplate) return htmlPage;

            var html = RenderInTemplateIfAny(
                markdownPage, scopeArgs, htmlPage, templatePath);

            return html;
        }