Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support mermaid #309

Merged
merged 6 commits into from Apr 13, 2023
Merged

feat: support mermaid #309

merged 6 commits into from Apr 13, 2023

Conversation

Innei
Copy link
Member

@Innei Innei commented Apr 10, 2023

WHAT

馃 Generated by Copilot at 5ad9213

Added support for mermaid diagrams in markdown articles. Used a remark plugin to convert mermaid code blocks to HTML divs and a custom hook to load and render the mermaid library. Created new files src/hooks/useMermaid.ts, src/lib/load-script.ts, and src/markdown/remark-mermaid.ts for these functionalities.

馃 Generated by Copilot at 5ad9213

We load the scripts of doom from the dark CDN
We use the hooks of power to render the mermaid
We transform the code blocks with the remark plugin
We unleash the diagrams of glory in the markdown

WHY

support mermaid

HOW

馃 Generated by Copilot at 5ad9213

  • Define and use useMermaid hook to render mermaid diagrams in markdown content (link, link, link, link, link)
  • Import and apply remarkMermaid plugin to transform mermaid code blocks into HTML divs (link, link, link)
  • Add empty line for formatting in src/markdown/index.ts (link)

Signed-off-by: Innei <tukon479@gmail.com>
Signed-off-by: Innei <tukon479@gmail.com>
@Innei Innei marked this pull request as ready for review April 12, 2023 15:24
@Innei
Copy link
Member Author

Innei commented Apr 12, 2023

closes #271.

image

@Innei Innei changed the title [WIP] feat: support mermaid feat: support mermaid Apr 12, 2023
@vercel
Copy link

vercel bot commented Apr 13, 2023

@Innei is attempting to deploy a commit to the RSS3 Team on Vercel.

A member of the Team first needs to authorize it.

Signed-off-by: Innei <tukon479@gmail.com>
@Innei
Copy link
Member Author

Innei commented Apr 13, 2023

image

image

@Innei
Copy link
Member Author

Innei commented Apr 13, 2023

Also support dark mode!

image

@Innei Innei requested a review from DIYgod April 13, 2023 14:49
@DIYgod DIYgod merged commit 0687ae1 into Crossbell-Box:dev Apr 13, 2023
1 of 2 checks passed
@DIYgod
Copy link
Member

DIYgod commented Apr 13, 2023

This is awesome, thank you for your excellent contribution.

Furthermore, I have fixed the issue of ID conflicts when dealing with multiple mermaids and made error handling in 6f43482

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants