Change order of arguments to prepare for pipeline

This commit is contained in:
Willem van den Ende 2025-07-30 09:31:06 +02:00
parent a4011e73e4
commit a7db2a53df

View File

@ -36,7 +36,7 @@ data CompilationStrategy = CompilationStrategy
-- | Pandoc writer function
, csWriter :: WriterOptions -> Pandoc -> PandocIO Text
-- | Post-processing function for the generated content
, csProcessOutput :: Text -> String -> IO (Either DocsterError ())
, csProcessOutput :: String -> Text -> IO (Either DocsterError ())
-- | Success message formatter
, csSuccessMessage :: String -> Text
}
@ -60,8 +60,8 @@ htmlStrategy = CompilationStrategy
}
-- | Process PDF output: LaTeX template application and direct XeLaTeX compilation
processPDFOutput :: Text -> String -> IO (Either DocsterError ())
processPDFOutput latexOutput outputPath = do
processPDFOutput :: String -> Text -> IO (Either DocsterError ())
processPDFOutput outputPath latexOutput = do
let completeLatex = latexTemplate latexOutput
-- Use temporary directory for LaTeX compilation
@ -108,8 +108,8 @@ processPDFOutput latexOutput outputPath = do
T.pack stderr <> "\n\nLaTeX log:\n" <> logContent
-- | Process HTML output: file writing and browser opening
processHTMLOutput :: Text -> String -> IO (Either DocsterError ())
processHTMLOutput html outputPath = do
processHTMLOutput :: String -> Text -> IO (Either DocsterError ())
processHTMLOutput outputPath html = do
TIO.writeFile outputPath html
-- Open the generated HTML file in browser for verification
@ -144,7 +144,7 @@ compileWithStrategy strategy sourceDir (OutputPath inputPath) (OutputPath output
output <- liftEitherIO $ generateOutput strategy transformed
-- Step 5: Process output and write to file
liftEitherIO $ csProcessOutput strategy output outputPath
liftEitherIO $ csProcessOutput strategy outputPath output
-- Step 6: Print success message
liftIO $ putStrLn $ T.unpack $ csSuccessMessage strategy outputPath