On Wed, Jun 21, 2017, at 12:01 PM, Mario Martelli wrote:
>
> I have shared a proposal to move org-protocol documentation to core
> documentation.
> It’s mainly copied together from the old one and 9.0 NEWS.
>
> The important part regarding the new syntax could be found here:
>
> https://github.com/mgmart/org-mode/blob/documentation/org-protocol/contrib/orgmanual.org#L7347-L7364
>
> Would that help or is there still something to add?
Thanks, Mario.
Your documentation refers to the new-style links, but the examples still
use the old style I think? My javascript is very basic, but from some
experimenting here, I think the old style links are what you've used:
javascript:location.href='org-protocol://sub-protocol://'+
encodeURIComponent(location.href)+'/'+
encodeURIComponent(document.title)+'/'+
encodeURIComponent(window.getSelection())
whereas the new-style key-value links would be:
javascript:location.href='org-protocol://sub-protocol?url='+
encodeURIComponent(location.href)+'&title='+
encodeURIComponent(document.title)+'&selection='+
encodeURIComponent(window.getSelection())
(I'm not actually sure what the name corresponding to `getSelection()`
is)
This is based on the following link style for store-link, which works
for me with Firefox 45.9 and Org 9.0 on Emacs 26.0.50:
javascript:location.href='org-protocol://store-link?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)
Also, I think your example for store-link should include the
document.title element?
javascript:location.href='org-protocol://store-link://'+encodeURIComponent(location.href)
It's true that old style links are still supported, but if they produce
a warning error when you use them, it would make sense to suggest the
new style syntax as the default for use by us newbies.
Best,
Tyler
--
plantarum.ca