diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2016-11-30 15:34:58 +0100 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2016-11-30 15:34:58 +0100 |
| commit | fb8a2540bdb91eee0ecf620b4e9d7acf3d78042f (patch) | |
| tree | 448a3c909200e8bbd45ecaa65f2f85d88bcc66c6 /src/Text/Pandoc/Writers/Native.hs | |
| parent | ac312caabd8c4e595e0b930154fd3033ba397ace (diff) | |
Options: Removed writerStandalone, made writerTemplate a Maybe.
Previously setting writerStandalone = True did nothing unless
a template was provided in writerTemplate. Now a fragment
will be generated if writerTemplate is Nothing; otherwise,
the specified template will be used and standalone output
generated. [API change]
Diffstat (limited to 'src/Text/Pandoc/Writers/Native.hs')
| -rw-r--r-- | src/Text/Pandoc/Writers/Native.hs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Writers/Native.hs b/src/Text/Pandoc/Writers/Native.hs index 2a9bc5138..87e23aeeb 100644 --- a/src/Text/Pandoc/Writers/Native.hs +++ b/src/Text/Pandoc/Writers/Native.hs @@ -27,10 +27,6 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Portability : portable Conversion of a 'Pandoc' document to a string representation. - -Note: If @writerStandalone@ is @False@, only the document body -is represented; otherwise, the full 'Pandoc' document, including the -metadata. -} module Text.Pandoc.Writers.Native ( writeNative ) where @@ -75,8 +71,8 @@ writeNative opts (Pandoc meta blocks) = let colwidth = if writerWrapText opts == WrapAuto then Just $ writerColumns opts else Nothing - withHead = if writerStandalone opts - then \bs -> text ("Pandoc (" ++ show meta ++ ")") $$ + withHead = case writerTemplate opts of + Just _ -> \bs -> text ("Pandoc (" ++ show meta ++ ")") $$ bs $$ cr - else id + Nothing -> id in render colwidth $ withHead $ prettyList $ map prettyBlock blocks |
