Socket
Socket
Sign inDemoInstall

carta-plugin-imsize

Package Overview
Dependencies
24
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    carta-plugin-imsize

This plugin adds ability to render images to specific sizes


Version published
Weekly downloads
171
decreased by-16.99%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

carta-plugin-imsize

carta-plugin-imsize

This plugin adds ability to render images in specific sizes to Carta.

Installation

npm i carta-plugin-imsize

Setup

Styles

For custom styles, this is an example of the generated HTML:

<div class="image-container">
	<img
		src="path/to/image"
		alt="image alt"
		title="image title"
		width="300"
		height="200"
		style="object-fit: contain;"
	/>
</div>

The images are shrunk to fit its container by default.

Extension

<script>
	import { Carta, CartaEditor } from 'carta-md';
	import { imsize } from 'carta-plugin-imsize';

	const carta = new Carta({
		extensions: [imsize()],
	});
</script>

<CartaEditor {carta} />

Usage

Image title, width and height are optional

With all parameters:
![image alt](/path/to/image "image title" =200x300)

With only with and height:
![image alt](/path/to/image =200x300)

With only height:
![image alt](/path/to/image =x300)

With only width:
![image alt](/path/to/image =200x)

With no parameters:
![image alt](/path/to/image =x)
![image alt](/path/to/image)

Check the example here for more detail.

Keywords

FAQs

Last updated on 22 Jan 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc