Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pandoc#biblio#sources and data dir #456

Open
twsh opened this issue Oct 31, 2023 · 1 comment
Open

pandoc#biblio#sources and data dir #456

twsh opened this issue Oct 31, 2023 · 1 comment

Comments

@twsh
Copy link

twsh commented Oct 31, 2023

If 'l' is part of the flag for pandoc#biblio#sources, vim-pandoc will look for bibliographies in $HOME/.pandoc/ and %APPDATA%/pandoc/. The documentation describes these as Pandoc's data dir (for *nix and Windows, respectively). Pandoc now uses something else as its default data dir for *nix: https://github.com/jgm/pandoc/releases/tag/2.7

The new default for *nix is $HOME/.local/share/pandoc/. I think that vim-pandoc should look there as well as the directory it looks in now.

An enhancement would be to have vim-pandoc use whatever the data dir is, even if it is changed from the default.

The relevant code in vim-pandoc is here:

def pandoc_local_search():
"""
Search for bibliographies in the pandoc data dirs.
"""
if os.path.exists(os.path.expandvars("$HOME/.pandoc/")):
b = os.path.expandvars("$HOME/.pandoc/")
elif os.path.exists(os.path.expandvars("%APPDATA%/pandoc/")):
b = os.path.expandvars("%APPDATA%/pandoc/")
else:
return []
search_paths = [b + "default." + f for f in bib_extensions]
bibfiles = [os.path.abspath(f) for f in search_paths if os.path.exists(f)]
return bibfiles

Unless this turns out to be a mistake, I can do a PR for the simple version and think about the enhancement.

@twsh
Copy link
Author

twsh commented Nov 1, 2023

Having thought about it, I think that there is no need for the enhancement. The only use case I can think of would be satisfied by adding a path directly to the sources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant