Skip to content

Commit

Permalink
Fixed ODT/PDF export for files in subdirectories.
Browse files Browse the repository at this point in the history
Resolves Issue #81.
  • Loading branch information
jgm committed Apr 4, 2010
1 parent dd5d77d commit 5d09b11
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Network/Gitit/Export.hs
Expand Up @@ -124,7 +124,7 @@ respondODT cfg page old_doc = fixURLs old_doc >>= \doc -> do
doc
conf <- getConfig
contents <- liftIO $ withTempDir "gitit-temp-odt" $ \tempdir -> do
let tempfile = tempdir </> page <.> "odt"
let tempfile = tempdir </> "export" <.> "odt"
saveOpenDocumentAsODT (pandocUserData cfg)
tempfile (repositoryPath conf) Nothing openDoc
L.readFile tempfile
Expand Down Expand Up @@ -162,7 +162,7 @@ respondPDF page old_pndc = fixURLs old_pndc >>= \pndc -> do
let toc = tableOfContents cfg
let latex = writeLaTeX defaultRespOptions{writerTemplate = template
,writerTableOfContents = toc} pndc
let tempfile = page <.> "tex"
let tempfile = "export" <.> "tex"
curdir <- getCurrentDirectory
setCurrentDirectory tempdir
writeFile tempfile latex
Expand All @@ -177,9 +177,9 @@ respondPDF page old_pndc = fixURLs old_pndc >>= \pndc -> do
canary <- runShellCommand tempdir env cmd opts
setCurrentDirectory curdir -- restore original location
case canary of
ExitSuccess -> do pdfBS <- L.readFile (tempdir </> page <.> "pdf")
ExitSuccess -> do pdfBS <- L.readFile (tempdir </> "export" <.> "pdf")
return $ Right (useCache cfg, pdfBS)
ExitFailure n -> do l <- readFileUTF8 (tempdir </> page <.> "log")
ExitFailure n -> do l <- readFileUTF8 (tempdir </> "export" <.> "log")
return $ Left (n, l)
case pdf' of
Left (n,logOutput) -> simpleErrorHandler ("PDF creation failed with code: " ++
Expand Down

0 comments on commit 5d09b11

Please sign in to comment.