electron / website

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

feat: tabbed CJS/ESM code blocks #488

Closed dsanders11 closed 9 months ago

dsanders11 commented 10 months ago

Combines back-to-back code blocks with language identifiers of CJS followed by MJS into tabbed code blocks. Code blocks can opt-out by adding no-combine to the meta string for the code block. Also optionally strips a preamble comment in the code blocks (making them more user-friendly in rendered Markdown not on the website).

No upstream usage in the docs yet. Will add linting on e/e to enforce certain things (like the preamble comments).

dsanders11 commented 9 months ago

Renamed files per suggestion and added a demo page (will remove before merge) at /docs/latest/tabbed-js-code-block/, here's the deployed preview.