Structures

The following structures are available globally.

  • Rendering options for KituraMarkdown, allowing the generated HTML to be wrapped in a page template. The page template should contain <snippetInsertLocation></snippetInsertLocation>, which will be substituted with the generated HTML content.

    Note: If you do not wish to customize the page template, "default" can be specified.

    Usage Example:

    let markdownOptions = MarkdownOptions(pageTemplate: "<!DOCTYPE html><html lang=\"en\"><head><meta charset=\"UTF-8\"></head><body><div><snippetInsertLocation></snippetInsertLocation></div></body></html>")
    
    router.add(templateEngine: KituraMarkdown())
    
    router.get("/docs") { _, response, next in
        try response.render("Example.md", context: [String:Any](), options: markdownOptions)
        response.status(.OK)
        next()
    }
    
    See more

    Declaration

    Swift

    public struct MarkdownOptions : RenderingOptions