mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-17 10:53:57 +01:00
feat: see macro
This commit is contained in:
1 parent
824169fc25
commit
cef18d4f64
9 files changed
+67
-18
No files matched your search
@@ -4,12 +4,13 @@ import { MarkdownCustom } from "./MarkdownCustom";
|
||||
|
||||
interface Props {
|
||||
body: string;
|
||||
locale: string;
|
||||
}
|
||||
|
||||
const macroPattern = /@(\w+) (.+)/;
|
||||
const macros: Record<string, string> = {};
|
||||
|
||||
const { body: bodyOriginal } = Astro.props;
|
||||
const { body: bodyOriginal, locale } = Astro.props;
|
||||
let body = "";
|
||||
|
||||
for (const line of bodyOriginal.split("\n")) {
|
||||
@@ -53,6 +54,6 @@ for (const line of bodyOriginal.split("\n")) {
|
||||
<div class="gutter"></div>
|
||||
<div class="content">
|
||||
<MarkdownCustom {body} />
|
||||
{"see" in macros && <ApiMacroSee value={macros.see} />}
|
||||
{"see" in macros && <ApiMacroSee {locale} value={macros.see} />}
|
||||
</div>
|
||||
</div>
|
||||
Reference in new issue
Block a user