Skip to main content

Module localize_images

Module localize_images 

Source
Expand description

Markdown image localization module (R5).

Post-processing tool that:

  1. Reads markdown text
  2. Extracts all external image URLs
  3. Downloads images to local directory
  4. Updates markdown to reference local paths

Based on reference implementation from: https://github.com/link-foundation/meta-theory/blob/main/scripts/download-markdown-images.mjs

Structs§

ImageMetadata
Metadata about a localized image.
ImageReference
An image reference extracted from markdown.
ImageReplacement
A replacement to apply to markdown text.
LocalizeOptions
Options for localizing images.
LocalizeResult
Result of localizing images.

Functions§

extract_image_references
Extract image references from markdown text.
generate_local_filename
Generate local filename for a downloaded image.
get_extension_from_url
Get file extension from URL.
localize_images
Localize images in markdown text by downloading external images and replacing URLs with local paths.