jgm / pandoc-citeproc

Library and executable for using citeproc with pandoc
BSD 3-Clause "New" or "Revised" License
291 stars 61 forks source link

Also use $XDG_DATA_HOME/pandoc for default.csl #434

Closed jpcirrus closed 3 years ago

jpcirrus commented 4 years ago

In Pandoc 2.7, released on 2019-03-03, the default user data directory was changed to $XDG_DATA_HOME/pandoc, with $HOME/.pandoc remaining for backwards compatibility. The location of default.csl however did not keep up with this change. This means that $HOME/.pandoc still has to be retained, for those who made the recommended Pandoc change, to manage this one file . It would be convenient if the location of default.csl reflected the location of the user data files.

jgm commented 4 years ago

Agreed.

the-solipsist commented 4 years ago

I believe the lines to be changed are here: https://github.com/jgm/pandoc-citeproc/blob/82833c1d162b19464d9aa2b5d4eb756443d726c9/src/Text/CSL/Pandoc.hs#L193-L200

Here are the changed lines from pandoc's App.hs https://github.com/jgm/pandoc/blob/0bed0ab5a308f5e72a01fa9bee76488556288862/src/Text/Pandoc/App.hs#L92-L102

Here's the commit that adds $XDG_DATA_HOME to pandoc: https://github.com/jgm/pandoc/commit/0bed0ab5a308f5e72a01fa9bee76488556288862

From what little I understood of that, getAppUserDataDirectory needs to be replaced with defaultUserDataDirs, but I'm not sure how one goes about doing that.