Represents a Syntax definition available in the current installation of Drafts.

Find and Assign a Syntax

let syntax = Syntax.find("builtIn", "Markdown");
draft.syntax = syntax;
draft.update();

Identification

installURL: string

URL which can be used to install this Syntax in another installation of Drafts. Useful for sharing and backups.

name: string

The name of the syntax definition.

The type (builtIn, custom, file) of the syntax definition.

Other

  • Search for a syntax definition matching the type and name passed and return it if found. Returns undefined if not found.

    Parameters

    Returns Syntax

  • Get list of all available syntaxes.

    Returns Syntax[]