Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
quarto-dev
GitHub Repository: quarto-dev/quarto-cli
Path: blob/main/src/format/reveal/schemas.ts
6456 views
1
/*
2
* schemas.ts
3
*
4
* Copyright (C) 2022 Posit Software, PBC
5
*
6
*/
7
8
import {
9
anyOfSchema as anyOfS,
10
arraySchema as arrayS,
11
idSchema as withId,
12
objectSchema as objectS,
13
} from "../../core/lib/yaml-schema/common.ts";
14
15
import {
16
booleanSchema as booleanS,
17
stringSchema as stringS,
18
} from "../../core/lib/yaml-schema/constants.ts";
19
20
import { kSelfContained } from "../../config/constants.ts";
21
22
const scriptSchema = anyOfS(
23
stringS,
24
objectS({
25
properties: {
26
path: stringS,
27
"async": booleanS,
28
},
29
required: ["path"],
30
// FIXME is this an exhaustive schema?
31
}),
32
);
33
export const revealPluginSchema = withId(
34
objectS({
35
properties: {
36
path: stringS,
37
name: stringS,
38
register: booleanS,
39
script: anyOfS(scriptSchema, arrayS(scriptSchema)),
40
stylesheet: anyOfS(stringS, arrayS(stringS)),
41
// FIXME what's the schema for metadata?
42
[kSelfContained]: booleanS,
43
},
44
required: ["name"],
45
// FIXME is this an exhaustive schema?
46
}),
47
"plugin-reveal",
48
);
49
50