Socket
Book a DemoInstallSign in
Socket

astro-starlight-remark-asides

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

astro-starlight-remark-asides

Use remark directives to get asides in .md/.mdx styled like starlight's asides

latest
Source
npmnpm
Version
0.0.7
Version published
Weekly downloads
56
36.59%
Maintainers
1
Weekly downloads
 
Created
Source

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

light theme example dark theme example

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";
---
<!--  -->

Keywords

remark

FAQs

Package last updated on 06 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts