Skip to content

Commit

Permalink
Pre-process the buffer with org-ref before exporting
Browse files Browse the repository at this point in the history
  • Loading branch information
kaushalmodi committed Feb 12, 2022
1 parent 940cd7e commit eca91a3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 30 deletions.
2 changes: 1 addition & 1 deletion test/setup-ox-hugo.el
Expand Up @@ -110,7 +110,7 @@ Emacs installation. If Emacs is installed using
(when ox-hugo-test-setup-verbose
(message "ox-hugo-tmp-dir: %s" ox-hugo-tmp-dir))

(defvar ox-hugo-packages '(toc-org citeproc))
(defvar ox-hugo-packages '(toc-org citeproc org-ref))
(when ox-hugo-install-org-from-elpa
;; Fri Sep 22 18:24:19 EDT 2017 - kmodi
;; Install the packages in the specified order. We do not want
Expand Down
29 changes: 4 additions & 25 deletions test/site/content-org/citation-org-ref.org
Expand Up @@ -8,9 +8,6 @@
#+csl-style: cite/csl/apa.csl
#+csl-locale: en-US

- [[https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/cite/csl/apa.csl][.csl location]]
- [[https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/cite/bib/orgcite.bib][.bib location]]

* First Heading
This should be a title citation: [[citetitle:&OrgCitations]].
** Second Heading
Expand All @@ -20,25 +17,7 @@ This should be a usual citation without parentheses:

bibliography:cite/bib/orgcite.bib

* Meta :noexport:
** Install ~org-ref~
#+begin_src emacs-lisp :results none
(use-package org-ref
:ensure t)
#+end_src
** For debug only
Preprocess current buffer to HTML.
#+begin_src emacs-lisp :results none
(org-ref-process-buffer 'html)
#+end_src
** Export current buffer using ~ox-hugo~ after pre-processing using ~org-ref~
#+begin_src emacs-lisp :results none
(let ((org-export-before-parsing-hook
'(lambda (_)
(org-ref-process-buffer 'html))))
(org-hugo-export-wim-to-md))
#+end_src

#+begin_src emacs-lisp
(use-package org-ref)
#+end_src
#+bind: org-export-before-parsing-hook (lambda (_) (org-ref-process-buffer 'html))
# Local Variables:
# org-export-allow-bind-keywords: t
# End:
4 changes: 0 additions & 4 deletions test/site/content/posts/citation-org-ref.md
Expand Up @@ -4,10 +4,6 @@ tags = ["org-ref", "csl", "citations", "bibliography"]
draft = false
+++

- [.csl location](https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/cite/csl/apa.csl)
- [.bib location](https://github.com/kaushalmodi/ox-hugo/blob/main/test/site/content-org/cite/bib/orgcite.bib)


## First Heading {#first-heading}

This should be a title citation: <a href="#citeproc_bib_item_1">2021</a>.
Expand Down

0 comments on commit eca91a3

Please sign in to comment.