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 not finding custom writer #2625

Closed
noamross opened this issue Jan 6, 2016 · 2 comments
Closed

Pandoc not finding custom writer #2625

noamross opened this issue Jan 6, 2016 · 2 comments

Comments

@noamross
Copy link

noamross commented Jan 6, 2016

Running pandoc (via rmarkdown in R) with a custom writer like so:

usr/local/bin/pandoc +RTS -K512m -RTS test.utf8.md --to /Users/noamross/Library/R/3.2/library/ehastyle/outbreak.lua --from markdown+autolink_bare_uris+ascii_identifiers+tex_math_single_backslash --output test.html --smart --email-obfuscation none --css /Users/noamross/Library/R/3.2/library/ehastyle/outbreak-template.css

I get the following error:

pandoc: Could not find data file /usr/local/Cellar/pandoc/1.16/share/x86_64-osx-ghc-7.10.3/pandoc-1.16/data/templates/default./users/noamross/library/r/3.2/library/ehastyle/outbreak.lua

I can confirm that /Users/noamross/Library/R/3.2/library/ehastyle/outbreak.lua exists. The long path to the pandoc directory is due to the installation being via homebrew, but it's the right path. Pandoc seems to not find the writer file and try to find it in the default directory instead.

I get the error when running pandoc directly in the command line, as well. Sometimes I _don't_ get this error when I remove some of the other arguments, though I haven't been able to figure out exactly which combination does this.

@technocrat
Copy link

Does the data file directory

pandoc: Could not find data file /usr/local/Cellar/pandoc/1.16/share/x86_64-osx-ghc-7.10.3/pandoc-1.16/data/templates/default./users/noamross/library/r/3.2/library/ehastyle/outbreak.lua

actually contain ..templates/default./ ... with the period after default?

@jgm
Copy link
Owner

jgm commented Jan 6, 2016

There is no default template for custom lua writers.
(How could there be?)

So you need to specify the template using --template

What's happening is this. When you do 'pandoc -t latex -s',
it will look for a template called default.latex. Now,
you did 'pandoc -t /path/to/lua/script', so it looks for
a template called 'default./path/to/lua/script'.

This isn't such good behavior; I will change it so that
it gives a more helpful message in this case.

+++ Noam Ross [Jan 06 16 14:19 ]:

Running pandoc (via rmarkdown in R) with a custom writer like so:
usr/local/bin/pandoc +RTS -K512m -RTS test.utf8.md --to /Users/noamross/Library/
R/3.2/library/ehastyle/outbreak.lua --from markdown+autolink_bare_uris+ascii_ide
ntifiers+tex_math_single_backslash --output test.html --smart --email-obfuscatio
n none --css /Users/noamross/Library/R/3.2/library/ehastyle/outbreak-template.cs
s

I get the following error:
pandoc: Could not find data file /usr/local/Cellar/pandoc/1.16/share/x86_64-osx-
ghc-7.10.3/pandoc-1.16/data/templates/default./users/noamross/library/r/3.2/libr
ary/ehastyle/outbreak.lua

I can confirm that
/Users/noamross/Library/R/3.2/library/ehastyle/outbreak.lua exists.

I get the error when running pandoc directly in the command line, as
well. Sometimes I don't get this error when I remove some of the other
arguments, though I haven't been able to figure out exactly which
combination does this.


Reply to this email directly or [1]view it on GitHub.

References

  1. Pandoc not finding custom writer #2625

@jgm jgm closed this as completed in a5efd2a Jan 6, 2016
c-forster pushed a commit to c-forster/pandoc that referenced this issue Jan 13, 2016
Previously, if you tried to do `pandoc -s -t /path/to/lua/script.lua`,
pandoc would look for the template in
`~/.pandoc/templates/default./path/to/lua/script.lua`.
With this change it will look in the more reasonable
`~/.pandoc/templates/default.script.lua`.

This makes it possible to store default templates for custom
writers.

Closes jgm#2625.
c-forster pushed a commit to c-forster/pandoc that referenced this issue Mar 4, 2016
Previously, if you tried to do `pandoc -s -t /path/to/lua/script.lua`,
pandoc would look for the template in
`~/.pandoc/templates/default./path/to/lua/script.lua`.
With this change it will look in the more reasonable
`~/.pandoc/templates/default.script.lua`.

This makes it possible to store default templates for custom
writers.

Closes jgm#2625.
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

3 participants