Skip to content

Commit 26a075c

Browse files
committed
chore: fix rendering of GitHub-like notes
1 parent 95ede3d commit 26a075c

3 files changed

Lines changed: 74 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,21 @@ make test-valid
5959
make test-invalid
6060
```
6161

62+
## Previewing the documentation site
63+
64+
Generate the documentation from the model and templates, then serve it locally:
65+
66+
```sh
67+
make serve-docs
68+
```
69+
70+
This regenerates the Markdown files in `docs/` and starts a local server at `http://localhost:8000`.
71+
To regenerate without serving:
72+
73+
```sh
74+
make generate-docs
75+
```
76+
6277
## Pull requests
6378

6479
All pull requests are validated in CI, which runs:

Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: check resolve test test-valid test-invalid
1+
.PHONY: check resolve test test-valid test-invalid generate-docs serve-docs
22

33
## Validate the registry model.
44
check:
@@ -18,3 +18,12 @@ test-valid:
1818
## Run invalid live-check tests (each file must be rejected).
1919
test-invalid:
2020
@.github/scripts/run-live-check-tests.sh invalid
21+
22+
## Generate the documentation site from the model and templates.
23+
generate-docs:
24+
@scripts/generate-docs.sh
25+
26+
## Serve the documentation site locally on port 8000.
27+
serve-docs: generate-docs
28+
@echo "Serving docs at http://localhost:8000"
29+
@cd docs && python3 -m http.server 8000

templates/registry/markdown/index.html.j2

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,53 @@
216216
color: var(--fg-secondary);
217217
}
218218
219+
/* GitHub-style alerts (via marked-alert) */
220+
main .markdown-alert {
221+
border-left: 3px solid;
222+
padding: 0.75rem 1rem;
223+
margin: 1rem 0;
224+
border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
225+
color: var(--fg-secondary);
226+
}
227+
main .markdown-alert .markdown-alert-title {
228+
display: flex;
229+
align-items: center;
230+
gap: 0.4rem;
231+
font-weight: 600;
232+
margin-bottom: 0.25rem;
233+
}
234+
main .markdown-alert .markdown-alert-title svg {
235+
width: 16px;
236+
height: 16px;
237+
flex-shrink: 0;
238+
fill: currentColor;
239+
}
240+
main .markdown-alert-note {
241+
border-left-color: #478be6;
242+
background: rgba(71, 139, 230, 0.1);
243+
}
244+
main .markdown-alert-note .markdown-alert-title { color: #478be6; }
245+
main .markdown-alert-tip {
246+
border-left-color: #3fb950;
247+
background: rgba(63, 185, 80, 0.1);
248+
}
249+
main .markdown-alert-tip .markdown-alert-title { color: #3fb950; }
250+
main .markdown-alert-important {
251+
border-left-color: #a371f7;
252+
background: rgba(163, 113, 247, 0.1);
253+
}
254+
main .markdown-alert-important .markdown-alert-title { color: #a371f7; }
255+
main .markdown-alert-warning {
256+
border-left-color: #d29922;
257+
background: rgba(210, 153, 34, 0.1);
258+
}
259+
main .markdown-alert-warning .markdown-alert-title { color: #d29922; }
260+
main .markdown-alert-caution {
261+
border-left-color: #f85149;
262+
background: rgba(248, 81, 73, 0.1);
263+
}
264+
main .markdown-alert-caution .markdown-alert-title { color: #f85149; }
265+
219266
/* Lists */
220267
main ul, main ol { margin: 0.6rem 0 0.6rem 1.5rem; color: var(--fg-secondary); }
221268
main li { margin: 0.3rem 0; line-height: 1.7; }
@@ -274,7 +321,9 @@
274321
<div id="content"><p id="loading">Loading...</p></div>
275322
</main>
276323
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
324+
<script src="https://cdn.jsdelivr.net/npm/marked-alert/dist/index.umd.js"></script>
277325
<script>
326+
marked.use(markedAlert());
278327
(function() {
279328
const content = document.getElementById('content');
280329

0 commit comments

Comments
 (0)