git.iko.soy/typeable/pandoc
on master help sign in
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

commitb80de325b75671fe923aac8834caedbe0c795b63 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateThu 31 Dec 2009, 01:11 (17 years ago) parentfad620c
8 files changed+13−7
data/odt-styles/META-INF/manifest.xml → data/odt/META-INF/manifest.xml data/odt-styles/Thumbnails/thumbnail.png → data/odt/Thumbnails/thumbnail.png data/odt-styles/meta.xml → data/odt/meta.xml data/odt-styles/mimetype → data/odt/mimetype data/odt-styles/settings.xml → data/odt/settings.xml data/odt-styles/styles.xml → data/odt/styles.xml pandoc.cabal+6−6 src/Text/Pandoc/ODT.hs+7−1
data/odt-styles/META-INF/manifest.xml → data/odt/META-INF/manifest.xmlrenamed

The content is the same.

data/odt-styles/Thumbnails/thumbnail.png → data/odt/Thumbnails/thumbnail.pngrenamed

Binary file not shown.

data/odt-styles/meta.xml → data/odt/meta.xmlrenamed

The content is the same.

data/odt-styles/mimetype → data/odt/mimetyperenamed

The content is the same.

data/odt-styles/settings.xml → data/odt/settings.xmlrenamed

The content is the same.

data/odt-styles/styles.xml → data/odt/styles.xmlrenamed

The content is the same.

pandoc.cabal+6−6
@@ -43,12 +43,12 @@ Data-Files:
4343 templates/rst.template, templates/s5.template,
4444 templates/mediawiki.template, templates/rtf.template,
4545 -- data for ODT writer
46− data/odt-styles/meta.xml,
47− data/odt-styles/settings.xml,
48− data/odt-styles/META-INF/manifest.xml,
49− data/odt-styles/Thumbnails/thumbnail.png,
50− data/odt-styles/styles.xml,
51− data/odt-styles/mimetype,
46+ data/odt/meta.xml,
47+ data/odt/settings.xml,
48+ data/odt/META-INF/manifest.xml,
49+ data/odt/Thumbnails/thumbnail.png,
50+ data/odt/styles.xml,
51+ data/odt/mimetype,
5252 -- data for LaTeXMathML writer
5353 data/LaTeXMathML.js.comment,
5454 data/LaTeXMathML.js.packed,
src/Text/Pandoc/ODT.hs+7−1
@@ -39,6 +39,7 @@ import Text.ParserCombinators.Parsec
3939import System.Time
4040import Text.Pandoc.Shared ( inDirectory )
4141import Paths_pandoc ( getDataFileName )
42+import System.Directory
4243
4344-- | Produce an ODT file from OpenDocument XML.
4445saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
@@ -46,7 +47,12 @@ saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
4647 -> String -- ^ OpenDocument XML contents.
4748 -> IO ()
4849saveOpenDocumentAsODT destinationODTPath sourceDirRelative xml = do
49− refArchivePath <- getDataFileName $ "data" </> "odt-styles"
50+ userDir <- getAppUserDataDirectory "pandoc"
51+ userOdtExists <- doesFileExist $
52+ userDir </> "data" </> "odt" </> "styles.xml"
53+ refArchivePath <- if userOdtExists
54+ then return $ userDir </> "data" </> "odt"
55+ else getDataFileName $ "data" </> "odt"
5056 refArchive <- inDirectory refArchivePath $
5157 addFilesToArchive [OptRecursive] emptyArchive ["."]
5258 -- handle pictures