From 3b9be92492cca7573f9ce79dff099b4d2fa3c56c Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sat, 13 Mar 2010 04:11:24 +0000 Subject: Use template variables for include-before/after. * These options now imply -s; previously they worked also in fragment mode. * Users can now adjust position of include-before and include-after text in the templates. * Default position of include-before moved back (as it originally was) before table of contents. * Resolves Issue #217. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1883 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/pandoc.hs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/pandoc.hs') diff --git a/src/pandoc.hs b/src/pandoc.hs index 659b091c8..5e2eec08a 100644 --- a/src/pandoc.hs +++ b/src/pandoc.hs @@ -399,9 +399,10 @@ options = (ReqArg (\arg opt -> do text <- readFile arg - let oldBefore = optBefore opt - -- add new text to end, so it is included in proper order - return opt { optBefore = oldBefore ++ [text] }) + -- add new ones to end, so they're included in order specified + let newvars = optVariables opt ++ [("include-before",text)] + return opt { optVariables = newvars, + optStandalone = True }) "FILENAME") "" -- "File to include before document body" @@ -409,9 +410,10 @@ options = (ReqArg (\arg opt -> do text <- readFile arg - let oldAfter = optAfter opt - -- add new text to end, so it is included in proper order - return opt { optAfter = oldAfter ++ [text]}) + -- add new ones to end, so they're included in order specified + let newvars = optVariables opt ++ [("include-after",text)] + return opt { optVariables = newvars, + optStandalone = True }) "FILENAME") "" -- "File to include after document body" -- cgit v1.2.3