mirror of
https://github.com/fmhy/edit.git
synced 2026-01-18 01:41:52 +11:00
🎉 New website!
This commit is contained in:
parent
28f602b9ad
commit
c97a0abf92
68 changed files with 8433 additions and 353 deletions
17
.vitepress/markdown/toggleStarred.ts
Normal file
17
.vitepress/markdown/toggleStarred.ts
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
import type { MarkdownRenderer } from "vitepress";
|
||||
|
||||
const excluded = ["Beginners Guide"];
|
||||
|
||||
export function toggleStarredPlugin(md: MarkdownRenderer) {
|
||||
md.renderer.rules.list_item_open = (tokens, index, options, env, self) => {
|
||||
const contentToken = tokens[index + 2];
|
||||
if (
|
||||
!excluded.includes(env.frontmatter.title) &&
|
||||
contentToken &&
|
||||
contentToken.content.startsWith("⭐")
|
||||
) {
|
||||
return `<li class="starred">`;
|
||||
}
|
||||
return self.renderToken(tokens, index, options);
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue