MarkdownFormat
Assembly: ServiceStack.Razor.dll
View Source
Declaration
public class MarkdownFormat : IViewEngine, IPlugin
Properties
Instance
View Source
Declaration
public static MarkdownFormat Instance { get; }
MarkdownBaseType
View Source
Declaration
public Type MarkdownBaseType { get; set; }
MarkdownGlobalHelpers
View Source
Declaration
public Dictionary<string, Type> MarkdownGlobalHelpers { get; set; }
FindMarkdownPagesFn
View Source
Declaration
public Func<string, IEnumerable<MarkdownPage>> FindMarkdownPagesFn { get; set; }
AppHost
View Source
Declaration
public IAppHost AppHost { get; set; }
ReplaceTokens
View Source
Declaration
public Dictionary<string, string> ReplaceTokens { get; set; }
VirtualPathProvider
View Source
Declaration
public IVirtualPathProvider VirtualPathProvider { get; set; }
CheckLastModifiedForChanges
View Source
Declaration
public bool CheckLastModifiedForChanges { get; set; }
Fields
DefaultTemplateName
View Source
Declaration
public static string DefaultTemplateName
DefaultTemplate
View Source
Declaration
public static string DefaultTemplate
DefaultPage
View Source
Declaration
public static string DefaultPage
TemplatePlaceHolder
View Source
Declaration
public static string TemplatePlaceHolder
WebHostUrlPlaceHolder
View Source
Declaration
public static string WebHostUrlPlaceHolder
MarkdownExt
View Source
Declaration
public static string MarkdownExt
TemplateExt
View Source
Declaration
public static string TemplateExt
SharedDir
View Source
Declaration
public static string SharedDir
PageExts
View Source
Declaration
public static string[] PageExts
ViewPages
View Source
Declaration
public Dictionary<string, MarkdownPage> ViewPages
ViewSharedPages
View Source
Declaration
public Dictionary<string, MarkdownPage> ViewSharedPages
ContentPages
View Source
Declaration
public Dictionary<string, MarkdownPage> ContentPages
MasterPageTemplates
View Source
Declaration
public Dictionary<string, MarkdownTemplate> MasterPageTemplates
Methods
Register(IAppHost)
View Source
Declaration
public void Register(IAppHost appHost)
Parameters
Type | Name |
---|---|
ServiceStack.IAppHost | appHost |
FindByPathInfo(String)
View Source
Declaration
public MarkdownPage FindByPathInfo(string pathInfo)
Returns
ServiceStack.Support.Markdown.MarkdownPage
Parameters
Type | Name |
---|---|
System.String | pathInfo |
ProcessRequestAsync(IRequest, Object, Stream)
View Source
Declaration
public Task<bool> ProcessRequestAsync(IRequest req, object dto, Stream outputStream)
Returns
System.Threading.Tasks.Task<System.Boolean>
Parameters
Type | Name |
---|---|
IRequest | req |
System.Object | dto |
System.IO.Stream | outputStream |
HasView(String, IRequest)
View Source
Declaration
public bool HasView(string viewName, IRequest httpReq = null)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | viewName |
IRequest | httpReq |
RenderPartial(String, Object, Boolean, StreamWriter, IHtmlContext)
View Source
Declaration
public string RenderPartial(string pageName, object model, bool renderHtml, StreamWriter writer, IHtmlContext htmlHelper = null)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | pageName |
System.Object | model |
System.Boolean | renderHtml |
System.IO.StreamWriter | writer |
ServiceStack.Html.IHtmlContext | htmlHelper |
GetViewPage(String, IRequest)
View Source
Declaration
public MarkdownPage GetViewPage(string viewName, IRequest httpReq)
Returns
ServiceStack.Support.Markdown.MarkdownPage
Parameters
Type | Name |
---|---|
System.String | viewName |
IRequest | httpReq |
ProcessMarkdownPage(IRequest, MarkdownPage, Object, Stream)
View Source
Declaration
public bool ProcessMarkdownPage(IRequest httpReq, MarkdownPage markdownPage, object dto, Stream outputStream)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
IRequest | httpReq |
ServiceStack.Support.Markdown.MarkdownPage | markdownPage |
System.Object | dto |
System.IO.Stream | outputStream |
ReloadModifiedPageAndTemplates(MarkdownPage)
View Source
Declaration
public void ReloadModifiedPageAndTemplates(MarkdownPage markdownPage)
Parameters
Type | Name |
---|---|
ServiceStack.Support.Markdown.MarkdownPage | markdownPage |
SerializeToStreamAsync(IRequest, Object, Stream)
Render Markdown for text/markdown and text/plain ContentTypes
View Source
Declaration
public async Task SerializeToStreamAsync(IRequest request, object response, Stream stream)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
IRequest | request |
System.Object | response |
System.IO.Stream | stream |
GetPageName(Object, IRequest)
View Source
Declaration
public string GetPageName(object dto, IRequest req)
Returns
System.String
Parameters
Type | Name |
---|---|
System.Object | dto |
IRequest | req |
GetViewPageByResponse(Object, IRequest)
View Source
Declaration
public MarkdownPage GetViewPageByResponse(object dto, IRequest httpReq)
Returns
ServiceStack.Support.Markdown.MarkdownPage
Parameters
Type | Name |
---|---|
System.Object | dto |
IRequest | httpReq |
GetViewPage(String)
View Source
Declaration
public MarkdownPage GetViewPage(string pageName)
Returns
ServiceStack.Support.Markdown.MarkdownPage
Parameters
Type | Name |
---|---|
System.String | pageName |
GetContentPage(String)
View Source
Declaration
public MarkdownPage GetContentPage(string pageFilePath)
Returns
ServiceStack.Support.Markdown.MarkdownPage
Parameters
Type | Name |
---|---|
System.String | pageFilePath |
GetContentPage(String[])
View Source
Declaration
public MarkdownPage GetContentPage(params string[] pageFilePaths)
Returns
ServiceStack.Support.Markdown.MarkdownPage
Parameters
Type | Name |
---|---|
System.String[] | pageFilePaths |
RegisterMarkdownPages(String)
View Source
Declaration
public void RegisterMarkdownPages(string dirPath)
Parameters
Type | Name |
---|---|
System.String | dirPath |
FindMarkdownPages(String)
View Source
Declaration
public IEnumerable<MarkdownPage> FindMarkdownPages(string dirPath)
Returns
System.Collections.Generic.IEnumerable<ServiceStack.Support.Markdown.MarkdownPage>
Parameters
Type | Name |
---|---|
System.String | dirPath |
RegisterMarkdownPage(MarkdownPage)
View Source
Declaration
public void RegisterMarkdownPage(MarkdownPage markdownPage)
Parameters
Type | Name |
---|---|
ServiceStack.Support.Markdown.MarkdownPage | markdownPage |
RefreshPage(String)
View Source
Declaration
public MarkdownPage RefreshPage(string filePath)
Returns
ServiceStack.Support.Markdown.MarkdownPage
Parameters
Type | Name |
---|---|
System.String | filePath |
AddPage(MarkdownPage)
View Source
Declaration
public void AddPage(MarkdownPage page)
Parameters
Type | Name |
---|---|
ServiceStack.Support.Markdown.MarkdownPage | page |
AddTemplate(String, String)
View Source
Declaration
public MarkdownTemplate AddTemplate(string templatePath, string templateContents)
Returns
ServiceStack.Support.Markdown.MarkdownTemplate
Parameters
Type | Name |
---|---|
System.String | templatePath |
System.String | templateContents |
Transform(String)
View Source
Declaration
public string Transform(string template)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | template |
Transform(String, Boolean)
View Source
Declaration
public string Transform(string template, bool renderHtml)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | template |
System.Boolean | renderHtml |
RenderStaticPageHtml(String)
View Source
Declaration
public string RenderStaticPageHtml(string filePath)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | filePath |
RenderStaticPage(String, Boolean)
View Source
Declaration
public string RenderStaticPage(string filePath, bool renderHtml)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | filePath |
System.Boolean | renderHtml |
RenderDynamicPageHtml(String, Object)
View Source
Declaration
public string RenderDynamicPageHtml(string pageName, object model)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | pageName |
System.Object | model |
RenderDynamicPageHtml(String)
View Source
Declaration
public string RenderDynamicPageHtml(string pageName)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | pageName |
RenderDynamicPageHtml(String, Dictionary<String, Object>)
View Source
Declaration
public string RenderDynamicPageHtml(string pageName, Dictionary<string, object> scopeArgs)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | pageName |
System.Collections.Generic.Dictionary<System.String,System.Object> | scopeArgs |
RenderDynamicPage(String, Object, Boolean)
View Source
Declaration
public string RenderDynamicPage(string pageName, object model, bool renderHtml)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | pageName |
System.Object | model |
System.Boolean | renderHtml |
RenderDynamicPage(MarkdownPage, Dictionary<String, Object>, Boolean, Boolean, String)
View Source
Declaration
public string RenderDynamicPage(MarkdownPage markdownPage, Dictionary<string, object> scopeArgs, bool renderHtml, bool renderTemplate, string templatePath = null)
Returns
System.String
Parameters
Type | Name |
---|---|
ServiceStack.Support.Markdown.MarkdownPage | markdownPage |
System.Collections.Generic.Dictionary<System.String,System.Object> | scopeArgs |
System.Boolean | renderHtml |
System.Boolean | renderTemplate |
System.String | templatePath |