astro-starlight-remark-asides
v0.0.7
Published
Use remark directives to get asides in .md/.mdx styled like starlight's asides
Downloads
232
Maintainers
Readme
Starlight's <Asides/>
s for Astro md/mdx
Add asides with remark directives npm package
- note
- tip
- caution
- danger
- success
:::note[Title]
text
:::
Dark and light theme
uses :root[data-theme="dark"]
by default, but this can be changed on line 21 of styles.css
Requirements
astro-starlight-remark-asides
requires the remark-directive
plugin to be added to your remark plugins before using.
Copy files and use
- the
.js
file here is a remark plugin, import it and add it to your remark plugins
import { defineConfig } from "astro/config";
import remarkDirective from "remark-directive";
import astroStarlightRemarkAsides from "./src/path/to/index.js";
// https://astro.build/config
export default defineConfig({
markdown: {
remarkPlugins: [remarkDirective, astroStarlightRemarkAsides],
},
});
- Import the .css file into whatever path is rendering the md/mdx
// src/[slug].astro
---
import "src/path/to/styles.css";
---
<!-- -->
Use as npm package
- import the remark plugin and add to remark plugins
import { defineConfig } from "astro/config";
import remarkDirective from "remark-directive";
import astroStarlightRemarkAsides from "astro-starlight-remark-asides";
// https://astro.build/config
export default defineConfig({
markdown: {
remarkPlugins: [remarkDirective, astroStarlightRemarkAsides],
},
});
- Import the .css file into whatever path is rendering the md/mdx
// src/[slug].astro
---
import "astro-starlight-remark-asides/styles.css";
---
<!-- -->