hexo-renderer-org
hexo-renderer-org copied to clipboard
references
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
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..
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.
nice work 👍
Hi, I've got into the same situation. Is there any plan to add this feature?
I'll add this feature in some days, pull&requests are also welcome.
@CodeFalling Thank you.