Skip to content

Commit 16bd296

Browse files
Merge pull request modelcontextprotocol#921 from jonathanhefner/add-schema-reference-page
Add schema reference page
2 parents 889cc19 + 80e9f2d commit 16bd296

File tree

12 files changed

+1042
-11
lines changed

12 files changed

+1042
-11
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
package-lock.json linguist-generated=true
22
schema/*/schema.json linguist-generated=true
3+
docs/specification/*/schema.md linguist-generated=true
4+
docs/specification/*/schema.mdx linguist-generated=true

.github/workflows/main.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,8 @@ jobs:
2121
- name: Check TypeScript definitions
2222
run: npm run check:schema:ts
2323

24-
- name: Verify that `npm run generate:json` did not change outputs (if it did, please re-run it and re-commit!)
24+
- name: Check schema.json files are up to date
2525
run: npm run check:schema:json
26+
27+
- name: Check schema.mdx files are up to date
28+
run: npm run check:schema:md

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
docs/specification/*/schema.md
2+
docs/specification/*/schema.mdx

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ git checkout -b feature/your-feature-name
4747

4848
```bash
4949
npm run check:schema:ts
50-
npm run generate:json
50+
npm run generate:schema
5151
```
5252

5353
4. Validate documentation changes and apply formatting:

docs/docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,8 @@
473473
]
474474
}
475475
]
476-
}
476+
},
477+
"specification/draft/schema"
477478
]
478479
},
479480
{

docs/specification/draft/schema.mdx

Lines changed: 454 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/style.css

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#content-area {
2+
--font-mono: var(--font-jetbrains-mono), ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; /* via Mintlify theme */
3+
24
h5 {
35
font-weight: 500;
46
}
@@ -16,6 +18,7 @@
1618
min-width: 800px;
1719
}
1820

21+
1922
/*** Add automatic section numbers to headings and table of contents items ***/
2023

2124
#enable-section-numbers {
@@ -84,3 +87,107 @@ body:has(#enable-section-numbers) {
8487
"." counter(h5-counter) "." counter(h6-counter) " ";
8588
}
8689
}
90+
91+
92+
/*** Page: schema reference ***/
93+
94+
#schema-reference {
95+
display: none;
96+
}
97+
98+
body:has(#schema-reference) {
99+
.tsd-comment {
100+
:is(p, ul, ol):first-child {
101+
margin-top: 0;
102+
}
103+
104+
:is(p, ul, ol):last-child {
105+
margin-bottom: 0;
106+
}
107+
}
108+
109+
.tsd-signature {
110+
font-family: var(--font-mono);
111+
font-size: 0.875rem;
112+
line-height: 1.5rem;
113+
114+
/* Based on code blocks rendered by Mintlify **on the production site**. */
115+
margin: 1.25rem 0;
116+
border: 1px solid;
117+
border-color: light-dark(rgb(var(--gray-950)/.1), rgba(255, 255, 255, 0.1));
118+
border-radius: 1rem;
119+
padding: 1rem 0.875rem;
120+
121+
a {
122+
font-weight: normal;
123+
border-bottom: none;
124+
text-decoration: underline;
125+
126+
&:hover {
127+
text-decoration-thickness: 2px;
128+
}
129+
}
130+
131+
a[href="#"] {
132+
pointer-events: none;
133+
color: inherit;
134+
text-decoration: none;
135+
}
136+
137+
.tsd-signature-keyword {
138+
color: light-dark(rgb(207, 34, 46), #9CDCFE);
139+
}
140+
141+
:is(.tsd-kind-interface, .tsd-kind-type-alias):not(.tsd-signature-type) {
142+
color: light-dark(rgb(149, 56, 0), #4EC9B0);
143+
}
144+
145+
.tsd-signature-type:not(.tsd-kind-interface, .tsd-kind-type-alias) {
146+
color: light-dark(rgb(5, 80, 174), #DCDCAA);
147+
}
148+
}
149+
150+
.tsd-member {
151+
margin: 1.25rem 0;
152+
153+
[data-typedoc-h="3"] {
154+
margin: 0.5rem 0;
155+
156+
font-family: var(--font-mono);
157+
font-weight: 700;
158+
159+
scroll-margin-top: 5rem;
160+
}
161+
162+
& > .tsd-comment {
163+
margin-left: 1.25rem;
164+
}
165+
166+
.tsd-type-declaration {
167+
[data-typedoc-h="4"] {
168+
display: none;
169+
}
170+
171+
[data-typedoc-h="4"] + ul {
172+
margin-top: 0;
173+
}
174+
175+
[data-typedoc-h="5"] {
176+
font-family: var(--font-mono);
177+
font-size: 0.875rem;
178+
font-weight: 500;
179+
180+
width: fit-content;
181+
padding: 0.125em 0.5em;
182+
background-color: light-dark(rgb(var(--gray-100)/.5), rgb(255 255 255/.05));
183+
}
184+
}
185+
186+
.tsd-anchor-icon,
187+
.tsd-tag,
188+
.tsd-signature,
189+
.tsd-sources {
190+
display: none;
191+
}
192+
}
193+
}

0 commit comments

Comments
 (0)