Blueprint reference

class nusex.api.blueprints.Blueprint(files: dict[str, bytes], project_name: str, project_slug: str, *, profile: Profile | None = None)

The base class for all blueprints.

Parameters
  • files (dict [str, bytes]) – The list of files built by the template.

  • project_name (str) – The project name the template is using.

  • project_slug (str) – The project slug the template is using.

Keyword Arguments

profile (Profile | None) – The profile to use. This should only be passed when you only want to replace data present in the profile. Not passing it will cause the blueprint to replace everything it would normally.

class nusex.api.blueprints.GenericBlueprint(files: dict[str, bytes], project_name: str, project_slug: str, *, profile: Profile | None = None)

A blueprint for building generic templates.

This should generally be used when you only want to include root files (such as the README) in the template, or when there is not a suitable blueprint for the language you are using.

modify_contributing(body: str) str

Modify all files starting with “CONTRIBUTING”.

Parameters

body (str) – The raw contents of the file.

Returns

The new file contents.

Return type

str

modify_docs_conf(body: str) str

Modify “docs/conf.py” and “docs/source/conf.py” files.

Parameters

body (str) – The raw contents of the file.

Returns

The new file contents.

Return type

str

modify_license(_: str) str

Modify all files starting with “COPYING”, “LICENCE”, or “LICENSE”.

Parameters

_ (str) – The raw contents of the file.

Returns

The new file contents.

Return type

str

modify_readme(body: str) str

Modify all files starting with “README”.

Parameters

body (str) – The raw contents of the file.

Returns

The new file contents.

Return type

str