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

org html link export #12

Open
pierwill opened this issue Apr 12, 2017 · 5 comments
Open

org html link export #12

pierwill opened this issue Apr 12, 2017 · 5 comments

Comments

@pierwill
Copy link

So I use the following code so that zotero:// links will show up in my html exports from org

  ; zotero link type
  ; this so that zotxt links will show up in export
  ; based on `https://lists.gnu.org/archive/html/emacs-orgmode/2015-01/msg00647.html'
  (org-add-link-type "zotero"
                     (lambda (rest)
                       (zotxt-select-key (substring rest 15)))
                     (lambda (path desc format)
                           (format "%s" desc)))

This is in my init file. I must confess my elisp is not good enough to see exactly what's going on here. But the strange thing is that unless I explicitly eval this block with C-x C-e, the link is exported as a zotero://, instead of the preferred text of the reference itself.

Could the proper export behavior be worked into zotxt-emacs? Am I missing something here? Is this just my config being goofy?

@egh
Copy link
Owner

egh commented Apr 13, 2017

@pierwill Which version of org-mode are you using? I believe this has changed in recent versions. See this change: 69d8779

@pierwill
Copy link
Author

i'm on 9.0.5

@egh
Copy link
Owner

egh commented Apr 16, 2017

In that case, try the new link format for 9.x org mode:

(org-link-set-parameters "zotero"
  :follow #'org-zotxt--link-follow
  :export (lambda (path desc format)
            (format "%s" desc)))

I think that should work.

@pierwill
Copy link
Author

Thanks. That code works, but unfortunately it only works when I explicitly evaluate that code. Having it in my init, or where it is, does not seem to be cutting it...

@egh
Copy link
Owner

egh commented Apr 17, 2017

Probably the issue is that this code is loaded before org-zotxt,, and is then overridden by the default export. Try:

(eval-after-load "org-zotxt"
  (org-link-set-parameters "zotero"
    :follow #'org-zotxt--link-follow
    :export (lambda (path desc format)
              (format "%s" desc))))

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

2 participants