# `lektor.build_programs.``BuildProgram`

A build program is responsible for converting a Source Object into final build artifacts. Typically such a build program implements two methods: produce_artifacts and build_artifact.

The former should invoke declare_artifact for each artifact that should be created from the source. The builder will then invoke build_artifact for each of these declared artifacts if the builder determines that the artifact needs to be built.

For an example refer to the add_build_program documentation.

#### build_artifact()

Invoked to build a previously declared artifact.

#### declare_artifact()

Declares an artifact to build from this program.

#### iter_child_sources()

Optionally this method can be implemented to produce child sources.

#### produce_artifacts()

Method that needs to be overridden for the build to work.

#### source

A reference to the source object.

## Comments