You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be reasonable to allow users to create their own functions to transform org link types into markdown links? For instance, if the user (or a package that the user uses) creates their own org link type, this feature would allow the user to control what ox-hugo does with the link.
In my case, I use Denote. Denote defines denote links, which are links between denote files. I use a per-file workflow and would like denote links between org files (which are exported as pages to my site) to be exported as relative web page links on the site. Right now, I do this by overriding org-hugo-link and handling denote links specially.
Taking a look at org-hugo-link, I think it would be possible to iterate through user-defined functions that take type and raw-path as arguments and returns the link (as a string). This would be similar to org-hugo-tag-processing-functions; we can call this proposed, user-exposed variable org-hugo-link-processing-functions. If I'm not mistaken, this could be done at the beginning of the cond in org-hugo-link, prior to org-hugo's default processing.
This feature gives the user flexibility for interpreting their own link types as well as existing link types, meaning users do not have to override the entire function in order to change how one type of link is transformed. Take my use case described above: I can simply convert my existing code into a function and add it to org-hugo-link-processing-functions. Finally, this proposed feature will not affect existing configurations.
If this sounds appealing, I can go ahead and draft a pull request for it.
The text was updated successfully, but these errors were encountered:
I'm not a maintainer, but this is appealing. I came here looking exactly for this functionality. Even a copy of what you're doing with org-hugo-link would be nice.
Would it be reasonable to allow users to create their own functions to transform org link types into markdown links? For instance, if the user (or a package that the user uses) creates their own org link type, this feature would allow the user to control what ox-hugo does with the link.
In my case, I use Denote. Denote defines
denote
links, which are links between denote files. I use a per-file workflow and would likedenote
links between org files (which are exported as pages to my site) to be exported as relative web page links on the site. Right now, I do this by overridingorg-hugo-link
and handlingdenote
links specially.Taking a look at
org-hugo-link
, I think it would be possible to iterate through user-defined functions that taketype
andraw-path
as arguments and returns the link (as a string). This would be similar toorg-hugo-tag-processing-functions
; we can call this proposed, user-exposed variableorg-hugo-link-processing-functions.
If I'm not mistaken, this could be done at the beginning of the cond inorg-hugo-link
, prior to org-hugo's default processing.This feature gives the user flexibility for interpreting their own link types as well as existing link types, meaning users do not have to override the entire function in order to change how one type of link is transformed. Take my use case described above: I can simply convert my existing code into a function and add it to
org-hugo-link-processing-functions
. Finally, this proposed feature will not affect existing configurations.If this sounds appealing, I can go ahead and draft a pull request for it.
The text was updated successfully, but these errors were encountered: