Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

add-png.py - Append PNG images from a directory to REPLICATION.md

Description

This script appends all PNG files found in a given directory to REPLICATION.md as markdown image links, sorted by filename. It is a pure-Python equivalent of the retired add-png.sh, so it can also be run via the 7-add-png Bitbucket pipeline without requiring bash, Python, or any tooling on the user’s own machine.

Usage

python3 tools/add-png.py <directory>

Parameters

Output

For each *.png file found directly in <directory> (non-recursive), appends a block like the following to REPLICATION.md at the repository root:


**filename.png**

![](relative/path/to/filename.png)

Image paths are written relative to the repository root.

Examples

# Append PNGs from the generated graphics directory
python3 tools/add-png.py generated/graphs

Errors

See Also