TargetBuilder

A builder for document targets.

class disseminate.builders.target_builders.target_builder.TargetBuilder(env, context, parameters=None, outfilepath=None, subbuilders=None, use_cache=None, **kwargs)

A builder for a document target, like html, tex or pdf

Parameters
env: :obj:`.builders.Environment`

The build environment

context: :obj:`.context.Context`

The context dict for the document being rendered.

parameters, argsTuple[pathlib.Path, str, tuple, list]

The input parameters (dependencies), including filepaths, for the build

outfilepathOptional[pathlib.Path]

If specified, the path for the output file.

subbuildersList[builders.Builder]

A list of subbuilders to add to this TargetBuilder.

Attributes
only_rootOptional[bool]

If True, only add the target builder for the root document.

add_parallel_builderOptional[bool]

If True (default), create a parallel builder for adding dependencies for a target.

add_render_builderOptional[bool]

If True (default), create a render builder to render the target.

add_build(parameters, outfilepath=None, context=None, use_cache=None, **kwargs)

Create and add a sub-builder to the composite builder.

build(complete=False)

Run the build.

Parameters
completeOptional[bool]

If True, run the build until it has completed If False, start the build in the background.

Returns
statusstr

The current status of the build.

Note

  • This function will run the sub-builders.

  • Each builder is atomic

  • When running a build, not all of the builders might be called in the first build–for example, subsequent builders may rely on the results of previous builds. For this reason, builders should be used in conjunction with an environment to make sure a set of builds are completed or the build complete=True should be used.

chain_subbuilders()

Chain the parameters and outfilepath of the subbuilders to follow each other

property outfilepath

The output filename and path