Skip to content

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

On-Demand
Recommended. Optimized for production.
Full Import
Convenient. Good for quick scripts.

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.

Generate the documented URL that initiates a Dash search.

On-Demand
ts
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.

On-Demand
ts
import { searchDocsets } from 'protocol-launcher/dash'

const url = searchDocsets({
  keyword: 'php',
  query: 'printf',
})

Generate the documented plugin URL for sending comma-separated docset keywords and an optional query to Dash.

On-Demand
ts
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.

On-Demand
ts
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.

On-Demand
ts
import { installDocset } from 'protocol-launcher/dash'

const url = installDocset({
  repoName: 'Ruby Docsets',
  entryName: 'cheatset',
  version: '1.3.3',
})

Generated URLs

ts
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'

Official Documentation