New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@altano/remark-astrojs-image

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@altano/remark-astrojs-image

A remark preset that enhances images in your .mdx files to use @astrojs/image components

  • 0.0.1-alpha.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

⚠️ HIGHLY EXPERIMENTAL: Everything about this package is subject to change, including the name.

remark-astrojs-image

This is a remark preset that enhances images in your .mdx files to use @astrojs/image components. While this preset (and accompanying remark plugins) are not astro specific, if you're not using mdx in an astro site you probably shouldn't be here.

Functionality

FeatureBeforeAfter
Inline import conversion<Image src="./image.jpg" /><Image src={import("./image.jpg")} />
img conversion<img /><Image />
picture conversion<picture /><Picture />
Markdown conversion![]("./image.png")<Image src={import("./image.jpg")} />
Preserve attributes<img width={500} height={500} alt="Alt Text"><Image width={500} height={500} alt="Alt Text" />
![Alt Text]("./image.png")<Image alt="Alt Text" src={import("./image.jpg")} />
Component auto importimport {Image} from "@astrojs/image/components";

Installation

NOTE: This plugin is mdx and esm only. Using components (such as the @astrojs/image component) from vanilla Markdown (.md files) has been deprecated in astro. This plugin, and astro's release candidate, require you to use mdx if you want to use components.

Install this remark preset:

# Using NPM
npm install @altano/remark-astrojs-image
# Using Yarn
yarn add @altano/remark-astrojs-image

Edit your astro.config.mjs to add this remark preset:

...
import remarkAstrojsImage from "@altano/remark-astrojs-image";

export default defineConfig({
  integrations: [
    // You should already have the @astrojs/image integration
    image(),
    // and the @astrojs/mdx integration
    mdx({
      remarkPlugins: {
        // so just add this preset as a remark plugin:
        extends: [remarkAstrojsImage],
      },
    }),
  ],
});

Keywords

FAQs

Package last updated on 06 Aug 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc