This is a really great idea. Having the help indexed is nice. I got tired of manually copying it and indexing it though. I found a way that I prefer.
Use the help bundle directly from DEVONthink
There is value in simply using the help bundle
directly. To do this easily, the help bundle
would need to be altered slightly. I will explain later. (See Why would the help bundle need to be modified?)
Without changing the help bundle
we can still call into Apple help using its URL schema, shown here.
Here is how I use it
I added the following markdown links in my DEVONthink database. They work fine on my system, with the default help bundle
(the help installed with DEVONthink).
NOTE: The links do not appear to work from the discourse page so to test them you will have to copy them locally.
Link to the DEVEONthink help
DEVONthink Help
[ DEVONthink Help](help:openbook=DEVONthink%20Help)
The URL looks like this.
help:openbook=DEVONthink%20Help
The result looks like this.
Link to search DEVONthink help
We will search for the words search prefix
in the DEVONthink help.
Search for “search prefix” in DEVONthink Help
[Search for "search prefix" in DEVONthink Help](help:search='search%20prefix'%20bookID='DEVONthink%20Help')
The URL looks like this.
help:search='search%20prefix'%20bookID='DEVONthink%20Help'
The result looks like this.
Link directly to the search prefixes page in the appendix
The Search Prefixes appendix page
[The _Search Prefixes_ appendix page](help:anchor='appendix-searchprefixes'%20bookID='DEVONthink%20Help')
The URL looks like this.
help:anchor='appendix-searchprefixes'%20bookID='DEVONthink%20Help'
The result looks like this.
Why would the help bundle need to be modified?
The last link is the kind of thing that I find the most valuable. I want to link to a particular page. Often I want to link to a particular part of a page. The way this is done is with anchor links. Anchor links need to be defined, and used, in the help. The best that I can tell, they are not (yet). See the explanation from Apple here.
So if anchors are not defined, how did the last link work? I did a little investigation and made a lucky guess.
The last URL looks like.
help:anchor='appendix-searchprefixes'%20bookID='DEVONthink%20Help'`
If I capture the search prefixes link from the find page of the help I get this URL.
file:///Applications/DEVONthink%203.app/Contents/Resources/DEVONthink.help/Contents/Resources/pgs/appendix-searchprefixes.html
This is not what I want because it is path dependent. The anchor link does not depend on the path because it uses the help book identifier, registered with macOS, and the page identifier rather than the page file name. DEVONthink’s help registration id, DEVONthink Help
, would likely be more stable and static across editions and versions than the path.
To get the URL I opened the page with the link in the macOS help viewer. (Click help in DEVONthink)
Then I right clicked on the link and selected Copy Link
.
When I opened the help bundle, with view package contents, I could see the layout of the help. Looking in the sources I did not seen any anchors I could use. Perhaps the index provides anchors for each page? The page I wanted was in the pgs
path. That can be seen both by examining the package contents and be deconstructing the file-path link copied above.
...Contents/Resources/pgs/appendix-searchprefixes.html
So I just put the of the file as the anchor
...anchor='appendix-searchprefixes'
Proposal
In-page anchors
Please add in-page anchors to the DEVONthink help bundle and change the existing link URLs to use them. This way when we copy the links in the help we get anchor links rather than path-dependent links. This also permits us to deep link into particular parts of pages rather than just the page.