Skip to content

Commit 3d6ceaa

Browse files
committed
add [!NOTE] type
1 parent cd17a13 commit 3d6ceaa

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

packages/site-kit/src/lib/components/Text.svelte

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,13 @@
409409
}
410410
}
411411
412+
&.note {
413+
background: none;
414+
margin-left: 0.2rem;
415+
padding: 0 0 0 3.8rem;
416+
border-left: 0.5rem solid var(--sk-back-5);
417+
}
418+
412419
em,
413420
i {
414421
font-style: normal;

packages/site-kit/src/lib/markdown/renderer.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,12 @@ export async function render_content_markdown(
279279
if (content.includes('[!LEGACY]')) {
280280
content = `<details class="legacy"><summary>Legacy mode</summary>${content.replace('[!LEGACY]', '')}</details>`;
281281
}
282-
return `<blockquote>${content}</blockquote>`;
282+
283+
// TODO get a shared understanding of what kinds of blockquotes we have and how to name them. [!TIP] ? [!WARNING] ? [!QUOTE] ?
284+
// Should the default be a generic blockquote that is just italic, without any icon?
285+
// Should we rely on consistent class names everywhere instead of styling blockquotes one way on blogs and another way in the docs?
286+
const klass = content.includes('[!NOTE]') ? ' class="note"' : '';
287+
return `<blockquote${klass}>${content.replace('[!NOTE]', '')}</blockquote>`;
283288
}
284289
});
285290
}

0 commit comments

Comments
 (0)