Thanks for this, will try this for my Emacs config.
Juan Manuel Macías writes:
> If you want to pass the class or id 'manually' to each link, and thus
> have more control, you can evaluate this other version, where the class
> or id would be added at the end of the link description, after (for
> example) "!style":
PS: Sorry, this is the correct code:
(org-link-set-parameters "button"
:face '(:foreground "green4" :underline t)
:follow (lambda (path) (browse-url path))
:export (lambda (path desc backend)
(when (eq backend 'html)
(let ((style (if (string-match "\\(!style\\)\\(.+\\)" desc)
(match-string 2 desc)
""))
(desc (replace-regexp-in-string "\\(!style .+\\)" "" desc)))
(format "<form><button %s
formaction=\"%s\">%s</button></form>" style
path desc)))))
Example:
== HTML ==>
<p>
</p>