hexo-renderer-org icon indicating copy to clipboard operation
hexo-renderer-org copied to clipboard

references

Open apsoftwaredev opened this issue 9 years ago • 6 comments

Hi, how would I insert a citation and bibliography using org-ref? It doesn't seem to export it. Or how would I hack the code to add the capability. Thanks

apsoftwaredev avatar May 13 '16 01:05 apsoftwaredev

hexo-renderer-org use emacs -q to export, so there is no org-ref by default. Maybe we should provide a option to inject emacs lisp to require org-ref..

xcodebuild avatar May 13 '16 02:05 xcodebuild

That's what I did. I created a minimal init.el file with the load paths to the folders I needed to run org-ref and the require statements. then added a config entry for the path to the minimal init.el the _config.yml. added emacs_init: "/.emacs.d-minimal/init.el" in the _config.yml file added`(load-file "${config.org.emacs_init})`` to line 155 in renderer.js

renderer.js function convert ....

var emacs_lisp =
  // org-html-export-as-html (&optional async subtreep visible-only body-only ext-plist)
  // http://orgmode.org/worg/doc.html
  // '+=+=output_begin=+=+' is a flag to split stderr and stdout
 `
(progn
(load-file "${config.org.emacs_init}")
  (setq org-export-allow-bind-keywords t)
  (goto-line 0)
  (insert "${config.org.common}\n")
  ;; reload org setting https://lists.gnu.org/archive/html/emacs-orgmode/2014-01/msg00648.html
  (normal-mode)
  (unless (derived-mode-p "org-mode")
  (org-mode))
  (org-html-export-as-html nil nil nil nil nil)
  (message "${flag}%s${flag}" (buffer-string)))
  `;

....

_config.yml

org:
   emacs: '/Applications/Emacs.app/Contents/MacOS/Emacs' 
   emacs_init: "~/.emacs.d-minimal/init.el"
     common: |
               #+OPTIONS: toc:nil num:nil

and it worked. Might be something easy and useful to add.

apsoftwaredev avatar May 15 '16 18:05 apsoftwaredev

nice work 👍

xcodebuild avatar May 16 '16 01:05 xcodebuild

Hi, I've got into the same situation. Is there any plan to add this feature?

heartnheart avatar Jun 28 '16 16:06 heartnheart

I'll add this feature in some days, pull&requests are also welcome.

xcodebuild avatar Jun 29 '16 02:06 xcodebuild

@CodeFalling Thank you.

heartnheart avatar Jun 29 '16 08:06 heartnheart