Skip to content

1Writer ​

1Writer is a powerful Markdown text editor for iOS with Dropbox, Google Drive, and iCloud support. Protocol Launcher allows you to generate deep links to create, edit, and manage documents in 1Writer using the onewriter:// URL scheme with x-callback-url protocol.

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.

Create Document ​

Creates a new document.

On-Demand
ts
import { create } from 'protocol-launcher/1writer'

const url = create({
  path: 'Dropbox/Documents',
  name: 'Notes.txt',
  text: 'Hello world',
})

Replace Document ​

Replaces content of a document.

On-Demand
ts
import { replace } from 'protocol-launcher/1writer'

const url = replace({
  path: 'Dropbox/Documents/Notes.txt',
  text: 'Hello world',
})

Replace Selection ​

Replaces selected text in the current editing document.

On-Demand
ts
import { replaceSelection } from 'protocol-launcher/1writer'

const url = replaceSelection({
  text: 'New text',
})

Get Content ​

Returns content of a document.

On-Demand
ts
import { content } from 'protocol-launcher/1writer'

const url = content({
  path: 'Dropbox/Documents/Notes.txt',
})

Open Document ​

Opens an existing document.

On-Demand
ts
import { open } from 'protocol-launcher/1writer'

const url = open({
  path: 'Dropbox/Documents/Notes.txt',
})

Append Document ​

Appends content to an existing document.

On-Demand
ts
import { append } from 'protocol-launcher/1writer'

const url = append({
  path: 'Dropbox/Documents/Notes.txt',
  text: 'Hello world',
})

Prepend Document ​

Prepends content to an existing document.

On-Demand
ts
import { prepend } from 'protocol-launcher/1writer'

const url = prepend({
  path: 'Dropbox/Documents/Notes.txt',
  text: 'Hello world',
})