From 20765f41e2a5054710973f97409ddc0c774a6607 Mon Sep 17 00:00:00 2001 From: William Rusnack Date: Sun, 18 Dec 2022 10:26:12 -0500 Subject: Add Wrapper type documentation to Text.Pandoc.Templates (#8490) Added more information on the wrappers from the commit https://github.com/renjianxiongqi/pandoc/commit/f36b5b8a5db8479bcf98827c267840304403bdf0 Co-authored-by: William Rusnack --- src/Text/Pandoc/Templates.hs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Text/Pandoc/Templates.hs b/src/Text/Pandoc/Templates.hs index 469401c97..690fde85a 100644 --- a/src/Text/Pandoc/Templates.hs +++ b/src/Text/Pandoc/Templates.hs @@ -12,6 +12,22 @@ Portability : portable Utility functions for working with pandoc templates. + +'WithDefaultPartials' and 'WithPartials' are Monad wrappers. Wrapping +these around an instance of 'PandocMonad' gives different instances of +'TemplateMonad', with different search behaviors when retrieving +partials. + +To compile a template and limit partial search to pandoc’s data files, +use @runWithDefaultPartials (compileTemplate ...)@. + +To compile a template and allow partials to be found locally (either on +the file system or via HTTP, in the event that the main template has an +absolute URL), ue @runWithPartials (compileTemplate ...)@. + +'getTemplate' seeks a template locally, or via HTTP if the template has +an absolute URL, falling back to the data files if not found. + -} module Text.Pandoc.Templates ( Template -- cgit v1.2.3