Download the PHP package sven/commonmark-dark-mode-images without Composer

On this page you can find all versions of the php package sven/commonmark-dark-mode-images. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package commonmark-dark-mode-images

CommonMark Dark Mode Images Extension

Latest Version on Packagist Total Downloads Build Status

⚠️ This package is abandoned. Use sven/commonmark-image-media-queries instead ⚠️

This CommonMark extension allows you to determine what images to show in dark- or light mode in Markdown converted using CommonMark.

Installation

Via composer:

Usage

To enable the extension, first make sure the Attributes extension that ships with CommonMark is enabled. Then, add the extension to the CommonMark environment:

You'll have to apply some classes to your Markdown images to indicate to this extension that they should be converted:

These {.light-image} and {.dark-image} tags are part of the Attributes extension. They apply classes to the converted <img> elements, which this extension uses to do its magic. The resulting HTML will look something like this:

And the result in the browser:

Click to reveal ![Side by side](https://github.com/svenluijten/commonmark-dark-mode-images/assets/11269635/b05f3a5d-ea14-463d-956a-43643166c45f) Or check out [the first blog post I used this on](https://svenluijten.com/posts/enable-intellisense-for-php-extensions-in-phpstorm).

Configuration

Fallback or original

This option allows you to select either 'light' or 'dark' as the "original" form of the picture you're embedding. This determines which picture will be used if the browser doesn't support the <picture> element.

Class on <picture> element

To change the class that is eventually applied to the rendered <picture> element, use the picture_class configuration option:

Light and dark classes

Use the dark_image_class and light_image_class configuration options to determine what classes to apply to your Markdown images to indicate which is for dark mode, and which is for light mode.

Note

It is not recommended to use this extension when converting to Markdown on-the-fly on every request. This is best suited for use in a static site generator like Jigsaw.

Contributing

All contributions (pull requests, issues and feature requests) are welcome. Make sure to read through the contributors page for all contributors.

License

sven/commonmark-dark-mode-images is licensed under the MIT License (MIT). Please see the license file for more information.


All versions of commonmark-dark-mode-images with dependencies

PHP Build Version
Package Version
Requires league/commonmark Version ^2.3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sven/commonmark-dark-mode-images contains the following files

Loading the files please wait ...