ReadOnlyMediaStorage

A storage of Media that can only be read. The main purpose is exporting media to the output files. For example, an image ![](img.png) references a local image. In this case, the HTML renderer would normally produce a <img src="img.png"> tag, but the image would not be found in the output directory. This means that the image must be copied to the output directory (not necessarily under the same name), and the tag must reference the copied image path instead.

See also

Inheritors

Properties

Link copied to clipboard
abstract val all: Set<StoredMedia>

All the stored entries.

Functions

Link copied to clipboard
abstract fun resolve(path: String): StoredMedia?

Resolves a media by its path.

Link copied to clipboard

Retrieves the media location of a media file, starting from the output directory. If the media file is not found in the local storage, a fallback location is returned, which is usually the original path.

Link copied to clipboard
abstract fun toResource(): OutputResource

Converts this storage to an OutputResource. This is used to export all media to the output directory. Ideally, this method returns an com.quarkdown.core.pipeline.output.OutputResourceGroup which contains all media inside of it.