Skip to content

Commit b1a17f1

Browse files
Merge branch 'main' into patch-1
2 parents 8ec4ceb + 67b9457 commit b1a17f1

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

_components/Admonition.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
type AdmonitionType =
22
| "note"
3+
| "info"
4+
| "tip"
35
| "caution"
4-
| "tip";
6+
| "warning";
57

68
export default function Admonition(
79
props: { type: AdmonitionType; children: any },

markdown-it/admonition.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ export default function admonitionPlugin(md: any) {
66
for (let i = 0; i < tokens.length; i++) {
77
if (
88
tokens[i].type === "inline" &&
9-
tokens[i].content.match(/^:::(note|info|tip|caution)(\s+(.*))?/)
9+
tokens[i].content.match(/^:::(note|info|tip|caution|warning)(\s+(.*))?/)
1010
) {
1111
const match = tokens[i].content.match(
12-
/^:::(note|info|tip|caution)(\s+(.*))?/,
12+
/^:::(note|info|tip|caution|warning)(\s+(.*))?/,
1313
);
1414
const type = match[1];
1515
const title = match[3] || type.charAt(0).toUpperCase() + type.slice(1);

styleguide/writing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,13 @@ Use admonitions sparingly to highlight important information:
130130
```markdown
131131
:::note Important supplementary information. :::
132132

133+
:::info Informational content (styled like note). :::
134+
133135
:::tip Helpful advice for better usage. :::
134136

135137
:::caution Warn about potential issues or gotchas. :::
138+
139+
:::warning Critical warnings that require immediate attention. :::
136140
```
137141

138142
### Tables

styles.css

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,8 @@
737737
@apply bg-runtime-50 dark:bg-runtime-950/30 dark:border
738738
dark:border-runtime-950 border-runtime-200;
739739
}
740-
&.caution {
740+
&.caution,
741+
&.warning {
741742
@apply bg-yellow-100 dark:bg-yellow-950/75 dark:border
742743
dark:border-yellow-400 border-yellow-200;
743744

0 commit comments

Comments
 (0)