Moved odt-styles -> odt. Changed ODT module to look at user data first.

So if the user has an odt-styles directory in ~/.pandoc, it
will be used instead of the default.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1694 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2009-12-31 01:11:49 +00:00
parent fad620c004
commit b80de325b7
8 changed files with 13 additions and 7 deletions

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -43,12 +43,12 @@ Data-Files:
templates/rst.template, templates/s5.template,
templates/mediawiki.template, templates/rtf.template,
-- data for ODT writer
data/odt-styles/meta.xml,
data/odt-styles/settings.xml,
data/odt-styles/META-INF/manifest.xml,
data/odt-styles/Thumbnails/thumbnail.png,
data/odt-styles/styles.xml,
data/odt-styles/mimetype,
data/odt/meta.xml,
data/odt/settings.xml,
data/odt/META-INF/manifest.xml,
data/odt/Thumbnails/thumbnail.png,
data/odt/styles.xml,
data/odt/mimetype,
-- data for LaTeXMathML writer
data/LaTeXMathML.js.comment,
data/LaTeXMathML.js.packed,

View file

@ -39,6 +39,7 @@ import Text.ParserCombinators.Parsec
import System.Time
import Text.Pandoc.Shared ( inDirectory )
import Paths_pandoc ( getDataFileName )
import System.Directory
-- | Produce an ODT file from OpenDocument XML.
saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
@ -46,7 +47,12 @@ saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
-> String -- ^ OpenDocument XML contents.
-> IO ()
saveOpenDocumentAsODT destinationODTPath sourceDirRelative xml = do
refArchivePath <- getDataFileName $ "data" </> "odt-styles"
userDir <- getAppUserDataDirectory "pandoc"
userOdtExists <- doesFileExist $
userDir </> "data" </> "odt" </> "styles.xml"
refArchivePath <- if userOdtExists
then return $ userDir </> "data" </> "odt"
else getDataFileName $ "data" </> "odt"
refArchive <- inDirectory refArchivePath $
addFilesToArchive [OptRecursive] emptyArchive ["."]
-- handle pictures