Types
Extension Types Module
Extension identification and reference types.
Defines types for extension IDs, version specifications, and references.
Interfaces
ExtensionId
Defined in: packages/core/src/types/extension.ts:14
Unique identifier for a Quarto extension. Supports both “owner/name” and name-only patterns.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
name |
string |
The name of the extension. | packages/core/src/types/extension.ts:18 |
owner |
string | null |
The owner (user or organisation) of the extension. | packages/core/src/types/extension.ts:16 |
ExtensionRef
Defined in: packages/core/src/types/extension.ts:34
Reference to an extension with optional version specification.
Properties
| Property | Type | Defined in |
|---|---|---|
id |
ExtensionId |
packages/core/src/types/extension.ts:35 |
version |
VersionSpec |
packages/core/src/types/extension.ts:36 |
Type Aliases
ExtensionType
TypeScript
type ExtensionType =
| "filter"
| "shortcode"
| "format"
| "project"
| "revealjs-plugin"
| "metadata";Defined in: packages/core/src/types/extension.ts:42
Types of contributions an extension can provide.
VersionSpec
TypeScript
type VersionSpec =
| {
type: "exact";
version: string;
}
| {
tag: string;
type: "tag";
}
| {
branch: string;
type: "branch";
}
| {
commit: string;
type: "commit";
}
| {
type: "latest";
};Defined in: packages/core/src/types/extension.ts:24
Version specification for extension references.
Functions
formatExtensionId()
TypeScript
function formatExtensionId(id): string;Defined in: packages/core/src/types/extension.ts:67
Format an ExtensionId object as a string.
Parameters
| Parameter | Type | Description |
|---|---|---|
id |
ExtensionId |
ExtensionId to format |
Returns
string
Formatted string (e.g., “quarto-ext/lightbox” or “lightbox”)
formatExtensionRef()
TypeScript
function formatExtensionRef(ref): string;Defined in: packages/core/src/types/extension.ts:132
Format an ExtensionRef object as a string.
Parameters
| Parameter | Type | Description |
|---|---|---|
ref |
ExtensionRef |
ExtensionRef to format |
Returns
string
Formatted string (e.g., “quarto-ext/lightbox@v1.0.0”)
parseExtensionId()
TypeScript
function parseExtensionId(input): ExtensionId;Defined in: packages/core/src/types/extension.ts:50
Parse an extension ID string into an ExtensionId object.
Parameters
| Parameter | Type | Description |
|---|---|---|
input |
string |
Extension ID string (e.g., “quarto-ext/lightbox” or “lightbox”) |
Returns
Parsed ExtensionId object
parseExtensionRef()
TypeScript
function parseExtensionRef(input): ExtensionRef;Defined in: packages/core/src/types/extension.ts:106
Parse an extension reference string into an ExtensionRef object.
Parameters
| Parameter | Type | Description |
|---|---|---|
input |
string |
Extension reference string (e.g., “quarto-ext/lightbox@v1.0.0”) |
Returns
Parsed ExtensionRef object
parseVersionSpec()
TypeScript
function parseVersionSpec(input): VersionSpec;Defined in: packages/core/src/types/extension.ts:79
Parse a version specification string.
Resolution order: tag > commit > branch
Parameters
| Parameter | Type | Description |
|---|---|---|
input |
string |
Version string (e.g., “v1.0.0”, “abc1234”, “main”, “latest”) |
Returns
Parsed VersionSpec
Manifest Types Module
Extension manifest types for parsing _extension.yml files.
Defines types for extension contributions and manifest structure.
Interfaces
Contributes
Defined in: packages/core/src/types/manifest.ts:16
Contributions an extension can provide to Quarto. Uses singular forms normalised from YAML plural keys.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
filter? |
string[] |
Lua filters provided by the extension. | packages/core/src/types/manifest.ts:18 |
format? |
Record<string, unknown> |
Custom formats provided by the extension. | packages/core/src/types/manifest.ts:22 |
metadata? |
unknown |
Metadata contributions. | packages/core/src/types/manifest.ts:28 |
project? |
unknown |
Project type contributions. | packages/core/src/types/manifest.ts:24 |
revealjsPlugin? |
string[] |
Reveal.js plugins provided by the extension. | packages/core/src/types/manifest.ts:26 |
shortcode? |
string[] |
Shortcodes provided by the extension. | packages/core/src/types/manifest.ts:20 |
ExtensionManifest
Defined in: packages/core/src/types/manifest.ts:34
Parsed extension manifest from _extension.yml.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
author |
string |
Author of the extension. | packages/core/src/types/manifest.ts:38 |
contributes |
Contributes |
Contributions provided by the extension. | packages/core/src/types/manifest.ts:44 |
quartoRequired? |
string |
Minimum required Quarto version. | packages/core/src/types/manifest.ts:42 |
source? |
string |
Source URL or reference (added during installation). | packages/core/src/types/manifest.ts:46 |
title |
string |
Display title of the extension. | packages/core/src/types/manifest.ts:36 |
version |
string |
Version string of the extension. | packages/core/src/types/manifest.ts:40 |
RawManifest
Defined in: packages/core/src/types/manifest.ts:53
Raw manifest data as parsed from YAML. This matches the structure of _extension.yml files.
Properties
| Property | Type | Defined in |
|---|---|---|
author? |
string |
packages/core/src/types/manifest.ts:55 |
contributes? |
object |
packages/core/src/types/manifest.ts:58 |
contributes.filters? |
string[] |
packages/core/src/types/manifest.ts:59 |
contributes.formats? |
Record<string, unknown> |
packages/core/src/types/manifest.ts:61 |
contributes.metadata? |
unknown |
packages/core/src/types/manifest.ts:64 |
contributes.project? |
unknown |
packages/core/src/types/manifest.ts:62 |
contributes.revealjs-plugins? |
string[] |
packages/core/src/types/manifest.ts:63 |
contributes.shortcodes? |
string[] |
packages/core/src/types/manifest.ts:60 |
quarto-required? |
string |
packages/core/src/types/manifest.ts:57 |
source? |
string |
packages/core/src/types/manifest.ts:66 |
title? |
string |
packages/core/src/types/manifest.ts:54 |
version? |
string | number |
packages/core/src/types/manifest.ts:56 |
Functions
getExtensionTypes()
TypeScript
function getExtensionTypes(manifest): ExtensionType[];Defined in: packages/core/src/types/manifest.ts:75
Get the extension types from a manifest based on its contributions.
Parameters
| Parameter | Type | Description |
|---|---|---|
manifest |
ExtensionManifest |
Extension manifest to analyse |
Returns
Array of extension types
normaliseManifest()
TypeScript
function normaliseManifest(raw): ExtensionManifest;Defined in: packages/core/src/types/manifest.ts:112
Convert a raw manifest from YAML to a normalised ExtensionManifest.
Parameters
| Parameter | Type | Description |
|---|---|---|
raw |
RawManifest |
Raw manifest data from YAML parsing |
Returns
Normalised ExtensionManifest
Registry Types Module
Registry types for the Quarto extensions registry.
Defines types for registry entries and the registry data structure.
Interfaces
RawRegistryEntry
Defined in: packages/core/src/types/registry.ts:82
Raw registry entry as returned from the JSON API.
This is the expected format for entries in custom registry JSON files. The registry JSON file should be an object mapping extension IDs (e.g., “owner/repo”) to RawRegistryEntry objects.
Example
JSON
{
"quarto-ext/lightbox": {
"owner": "quarto-ext",
"title": "Lightbox",
"nameWithOwner": "quarto-ext/lightbox",
"description": "Create lightbox treatments for images",
"repositoryTopics": ["quarto", "quarto-extension", "shortcode"],
"contributes": ["shortcode"],
"latestRelease": "v0.1.4",
"latestReleaseUrl": "https://github.com/quarto-ext/lightbox/releases/tag/v0.1.4",
"stargazerCount": 42,
"licenseInfo": "MIT",
"url": "https://github.com/quarto-ext/lightbox",
"template": false,
"defaultBranchRef": "main",
"latestCommit": "abc1234567890"
}
}Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
contributes? |
string[] |
What the extension contributes (e.g., “filter”, “shortcode”, “format”, “project”, “revealjs-plugin”, “metadata”). | packages/core/src/types/registry.ts:94 |
defaultBranchRef? |
string | null |
Default branch name (e.g., “main”, “master”). | packages/core/src/types/registry.ts:108 |
description? |
string | null |
Extension description. | packages/core/src/types/registry.ts:90 |
latestCommit? |
string | null |
SHA of the latest commit on the default branch. | packages/core/src/types/registry.ts:110 |
latestRelease? |
string | null |
Latest release tag (e.g., “v1.0.0”). | packages/core/src/types/registry.ts:96 |
latestReleaseUrl? |
string | null |
URL to the latest release page on GitHub. | packages/core/src/types/registry.ts:98 |
licenseInfo? |
string | null |
SPDX licence identifier (e.g., “MIT”, “GPL-3.0”). | packages/core/src/types/registry.ts:102 |
nameWithOwner |
string |
Full repository name in “owner/repo” format. Required. | packages/core/src/types/registry.ts:88 |
owner |
string |
Repository owner (GitHub username or organisation). Required. | packages/core/src/types/registry.ts:84 |
repositoryTopics? |
string[] |
GitHub repository topics/tags for categorisation. | packages/core/src/types/registry.ts:92 |
stargazerCount? |
number |
GitHub star count. | packages/core/src/types/registry.ts:100 |
template? |
boolean |
Whether this extension provides project templates. | packages/core/src/types/registry.ts:106 |
title |
string |
Display name/title of the extension. Required. | packages/core/src/types/registry.ts:86 |
url |
string |
GitHub repository URL. Required. | packages/core/src/types/registry.ts:104 |
RegistryEntry
Defined in: packages/core/src/types/registry.ts:13
Entry for an extension in the registry.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
contributes |
string[] |
What the extension contributes (e.g., filters, formats, shortcodes). | packages/core/src/types/registry.ts:27 |
defaultBranchRef |
string | null |
Default branch name (e.g., “main”, “master”). | packages/core/src/types/registry.ts:43 |
description |
string | null |
Extension description. | packages/core/src/types/registry.ts:23 |
fullName |
string |
The full repository name (owner/repo format). | packages/core/src/types/registry.ts:21 |
htmlUrl |
string |
GitHub repository URL. | packages/core/src/types/registry.ts:39 |
id |
string |
Unique key in the registry (usually owner/repo). | packages/core/src/types/registry.ts:15 |
latestCommit |
string | null |
SHA of the latest commit on the default branch. | packages/core/src/types/registry.ts:45 |
latestReleaseUrl |
string | null |
URL to the latest release page. | packages/core/src/types/registry.ts:33 |
latestTag |
string | null |
Latest release tag (with ‘v’ prefix if present). | packages/core/src/types/registry.ts:31 |
latestVersion |
string | null |
Latest version (without ‘v’ prefix). | packages/core/src/types/registry.ts:29 |
licence |
string | null |
Licence information. | packages/core/src/types/registry.ts:37 |
name |
string |
The display name/title. | packages/core/src/types/registry.ts:19 |
owner |
string |
The owner (user or organisation). | packages/core/src/types/registry.ts:17 |
stars |
number |
GitHub star count. | packages/core/src/types/registry.ts:35 |
template |
boolean |
Whether this extension provides templates. | packages/core/src/types/registry.ts:41 |
topics |
string[] |
Repository topics/tags. | packages/core/src/types/registry.ts:25 |
Type Aliases
Registry
TypeScript
type Registry = Record<string, RegistryEntry>;Defined in: packages/core/src/types/registry.ts:51
The full registry mapping extension IDs to their entries.
Functions
parseRegistry()
TypeScript
function parseRegistry(raw): Registry;Defined in: packages/core/src/types/registry.ts:150
Parse a raw registry object into a normalised Registry.
Parameters
| Parameter | Type | Description |
|---|---|---|
raw |
```{=html} |
Record<string, RawRegistryEntry>
````| Raw registry object from JSON |
Returns
Normalised Registry
parseRegistryEntry()
TypeScript
function parseRegistryEntry(key, raw): RegistryEntry;Defined in: packages/core/src/types/registry.ts:120
Parse a raw registry entry into a normalised RegistryEntry.
Parameters
| Parameter | Type | Description |
|---|---|---|
key |
string |
The registry key (usually owner/repo) |
raw |
RawRegistryEntry |
Raw entry from the JSON API |
Returns
Normalised RegistryEntry