Re: [O] Understand the source of "Unable to resolve link"
On Sun, Feb 4, 2018 at 11:31 AM Nicolas Goaziou wrote: > Note that you cannot simply copy "http" or "https" types. As default > type links, they are hard-coded in every export back-end. It means they > do not have to set any :export property. > > As a user, if you want to export a "gopher" link type, you need to > implement a function exporting it, and register it as the :export value. > Thank you. This works. (defun org-link-gopher-export-link (link desc format) "Create export version of LINK and DESC to FORMAT." (let ((link (concat "gopher:" link))) (cond ((eq format 'html) (format "%s" link desc)) ((eq format 'latex) (format "\\href{%s}{%s}" link desc)) (t ;`ascii', `md', `hugo', etc. (format "[%s](%s)" desc link) (org-link-set-parameters "gopher" :export #'org-link-gopher-export-link) -- Kaushal Modi
Re: [O] Understand the source of "Unable to resolve link"
Kaushal Modi writes: > Thanks. I'll ask the user to update that variable (or can that be updated > in the default value?). Note that you cannot simply copy "http" or "https" types. As default type links, they are hard-coded in every export back-end. It means they do not have to set any :export property. As a user, if you want to export a "gopher" link type, you need to implement a function exporting it, and register it as the :export value.
Re: [O] Understand the source of "Unable to resolve link"
On Sun, Feb 4, 2018 at 11:19 AM Nicolas Goaziou wrote: > Hello, > > I don't think Org defines gopher links. Where is it registered? In > particular, what is the export function associated to the link type Looks like[1], gopher: links can behave the same way as https:, http:, etc. If you don't tell Org what it a gopher link, e.g., within > `org-link-parameters', Org considers your example above as a fuzzy link, > hence the error. > Thanks. I'll ask the user to update that variable (or can that be updated in the default value?). [1]: https://github.com/kaushalmodi/ox-hugo/issues/132#issuecomment-362854410 -- Kaushal Modi
Re: [O] Understand the source of "Unable to resolve link"
Hello, Kaushal Modi writes: > A user needs to support having gopher links in Org document: > > [[gopher://some.gopher.site][Dummy gopher link]] > > But the export fails saying that it's unable to resolve the link. > > The behavior can be easily recreated by exporting a document containing > that dummy link using C-c C-e h H. > > I added "gopher" to the org-html-link function, but that obviously didn't > help. > > I traced the error to org-export-data in ox.el, but I cannot edebug that > function; I get: > > edebug-syntax-error: Invalid read syntax: "Failed matching", (&rest > (&define name (&rest arg) cl-declarations-or-string def-body)) > > (I'll open an emacs bug for that.) > > So what needs to be fixed in ox.el (or elsewhere?) so that gopher: protocol > links are allowed? I don't think Org defines gopher links. Where is it registered? In particular, what is the export function associated to the link type? If you don't tell Org what it a gopher link, e.g., within `org-link-parameters', Org considers your example above as a fuzzy link, hence the error. Regards, -- Nicolas Goaziou
[O] Understand the source of "Unable to resolve link"
Hello, A user needs to support having gopher links in Org document: [[gopher://some.gopher.site][Dummy gopher link]] But the export fails saying that it's unable to resolve the link. The behavior can be easily recreated by exporting a document containing that dummy link using C-c C-e h H. I added "gopher" to the org-html-link function, but that obviously didn't help. I traced the error to org-export-data in ox.el, but I cannot edebug that function; I get: edebug-syntax-error: Invalid read syntax: "Failed matching", (&rest (&define name (&rest arg) cl-declarations-or-string def-body)) (I'll open an emacs bug for that.) So what needs to be fixed in ox.el (or elsewhere?) so that gopher: protocol links are allowed? Thanks. -- Kaushal Modi