Dash
Dash is a macOS documentation browser and code snippet manager. Protocol Launcher allows you to generate URLs for searching Dash and working with Dash docsets.
Usage
There are two ways to use this library:
- On-Demand import from subpaths enables tree-shaking and keeps bundles small.
- Full Import from the root package is convenient but includes all app modules.
Pick On-Demand for production builds; Full Import is fine for quick scripts or demos.
Select Installation Method
URL Methods
Dash's official documentation lists dash://?query=... search URLs, dash-plugin://... plugin URLs, dash-feed://... feed subscription URLs, and dash-install://... docset install URLs. This module exposes only those documented forms.
Search
Generate the documented URL that initiates a Dash search.
import { search } from 'protocol-launcher/dash'
const url = search({
query: 'string',
})Search Docsets
Generate the documented dash:// URL with a Dash docset keyword or Search Profile keyword trigger.
import { searchDocsets } from 'protocol-launcher/dash'
const url = searchDocsets({
keyword: 'php',
query: 'printf',
})Plugin Search
Generate the documented plugin URL for sending comma-separated docset keywords and an optional query to Dash.
import { pluginSearch } from 'protocol-launcher/dash'
const url = pluginSearch({
keys: 'python,django',
query: 'string',
})Subscribe Feed
Generate the documented dash-feed:// URL for subscribing Dash to a docset feed. The feed URL is percent-encoded as required by the Dash docset guide.
import { subscribeFeed } from 'protocol-launcher/dash'
const url = subscribeFeed({
url: 'http://kapeli.com/feeds/NodeJS.xml',
})Install Docset
Generate the documented dash-install:// URL for installing a docset from a Dash downloads repo entry.
import { installDocset } from 'protocol-launcher/dash'
const url = installDocset({
repoName: 'Ruby Docsets',
entryName: 'cheatset',
version: '1.3.3',
})Generated URLs
search({ query: 'string' })
// => 'dash://?query=string'
searchDocsets({ keyword: 'php', query: 'printf' })
// => 'dash://?query=php:printf'
pluginSearch({ keys: 'python,django', query: 'string' })
// => 'dash-plugin://keys=python,django&query=string'
pluginSearch({ keys: 'python,django' })
// => 'dash-plugin://keys=python,django'
pluginSearch({ query: 'string' })
// => 'dash-plugin://query=string'
subscribeFeed({ url: 'http://kapeli.com/feeds/NodeJS.xml' })
// => 'dash-feed://http%3A%2F%2Fkapeli.com%2Ffeeds%2FNodeJS.xml'
installDocset({ repoName: 'Ruby Docsets', entryName: 'cheatset', version: '1.3.3' })
// => 'dash-install://repo_name=Ruby Docsets&entry_name=cheatset&version=1.3.3'