electron / website

:electron: The Electron website
https://electronjs.org
Apache License 2.0
111 stars 127 forks source link

Transform GitHub alert blocks into Docusaurus admonitions #570

Open erickzhao opened 3 months ago

erickzhao commented 3 months ago

GitHub released a new "Alerts" syntax in GitHub-flavoured Markdown (GFM) for highlighting blocks in late 2022:

[!NOTE] This is an important note!

https://github.com/orgs/community/discussions/16925

These are a non-standard Markdown extension, and not natively supported by Docusaurus (ref https://github.com/facebook/docusaurus/issues/7471). However, Docusaurus has its own admonition syntax that serves approximately the same purpose:

:::note

This is an important note!

:::

One of our goals with Electron's documentation is to make the code readable in both GitHub.com and Docusaurus contexts. Ideally, we'd be able to transform the GitHub Alert syntax into Docusaurus admonitions to improve this interop.

There seems to be an open-source Remark plugin that we could try out to this end: https://github.com/incentro-dc/remark-github-admonitions-to-directives