From 370d60df0c0ddc91438bc8c40979b7917377f06e Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Sun, 19 Aug 2018 22:18:30 -0400 Subject: [PATCH] Add check that pandoc-citeproc is installed too Ref: https://github.com/kaushalmodi/ox-hugo/issues/191#issuecomment-414129378 --- doc/ox-hugo-manual.org | 9 ++++++++- ox-hugo-pandoc-cite.el | 2 ++ test/site/content/posts/citations-with-captions/index.md | 6 +++--- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/doc/ox-hugo-manual.org b/doc/ox-hugo-manual.org index abf88c2..a88590d 100644 --- a/doc/ox-hugo-manual.org +++ b/doc/ox-hugo-manual.org @@ -2191,7 +2191,8 @@ citation is ~@foo~, that particular /foo/ reference much be present in one of the specified bibliography files. #+begin_note -Users need to have the ~pandoc~ executable present in their ~PATH~. +Users need to have the ~pandoc~ and ~pandoc-citeproc~ binaries[fn:7] present +in the ~PATH~. #+end_note When one or more citations are found by Pandoc, a top-level @@ -2354,6 +2355,12 @@ and /mark.js/. -- [[https://gist.github.com/eddiewebb/735feb48f50f0ddd65ae5606a1 #+include: "./ox-hugo-manual.org::#test" :only-contents t * Footnotes +[fn:7] The Pandoc Citations feature was last <2018-08-19 Sun> tested +with Pandoc version 2.2.2. If you are running an older version, the +quickest way to "install" might be to simply download the latest +release archive from [[https://github.com/jgm/pandoc/releases][~Pandoc releases]], extract it and put the ~pandoc~ +and ~pandoc-citeproc~ binaries in one of the directories in your PATH. + [fn:6] If you are still using a Hugo version older than 0.25, update now! -- Because that version added support for the awesome =--navigateToChanged= switch. diff --git a/ox-hugo-pandoc-cite.el b/ox-hugo-pandoc-cite.el index 58af1fe..a116df5 100644 --- a/ox-hugo-pandoc-cite.el +++ b/ox-hugo-pandoc-cite.el @@ -308,6 +308,8 @@ INFO is a plist used as a communication channel." (progn (unless (executable-find "pandoc") (user-error "[ox-hugo] pandoc executable not found in PATH")) + (unless (executable-find "pandoc-citeproc") + (user-error "[ox-hugo] pandoc-citeproc executable not found in PATH")) (org-hugo-pandoc-cite--parse-citations info orig-outfile)) (org-hugo-pandoc-cite--restore-fm-in-orig-outfile orig-outfile fm orig-outfile-contents)))) diff --git a/test/site/content/posts/citations-with-captions/index.md b/test/site/content/posts/citations-with-captions/index.md index 38b558d..ea08016 100644 --- a/test/site/content/posts/citations-with-captions/index.md +++ b/test/site/content/posts/citations-with-captions/index.md @@ -1,6 +1,6 @@ +++ title = "Citations with captions" -date = 2018-08-19T16:24:00-00:00 +date = 2018-08-19T16:24:00+00:00 tags = ["pandoc", "citations"] draft = false +++ @@ -17,11 +17,11 @@ an electronic notebook has to happen. ## Why use Org mode? -Check out the code block in [1](#org4bfd6da). +Check out the code block in [1](#org6cbbd55). ## Using code blocks - + ``` plantuml rectangle ", , etc." as a {