Skip to contents

Stamp files and directories

Add a header to a single file or to every file in a directory.

stamp()
Stamp a file or directory with a header
stamp_file()
Stamp a single file with a header
stamp_dir()
Stamp all files in a directory with a header

Update existing headers

Revise a header that is already in a file, changing only the fields you name.

stamp_update()
Update an existing file header
stamp_bump_year()
Bump the copyright year in a file header
stamp_add_author()
Add an author to a file header
stamp_edits()
Bundle header edits for reuse
year_extend()
Build a copyright-year updater
author_add()
Build an author-add updater

Templates

Choose a built-in license template or build your own.

stamp_templates()
List available templates
stamp_template_default()
Get default template
stamp_template_load()
Load template from YAML
stamp_template_create()
Create a new template
stamp_template_describe()
Define template fields
stamp_template_field()
Define individual field
stamp_template_content()
Create template content with multiline support

Variables

The values that fill a template’s {{...}} placeholders.

stamp_variables()
Get built-in variables
stamp_variables_add()
Add custom variable
stamp_variables_list()
List all available variables

Languages

Detect a file’s comment style and register new languages.

languages()
List all registered languages
detect_language()
Detect language based on file extension
language_register()
Register a new language
language_get()
Get registered language

Inspecting files

has_header()
Check if file has a header
is_file()
Check if path is a file
backup_file()
Create backup of file
print(<stamp_dir_results>)
Print method for directory results
print(<stamp_edits>)
Print method for header edits
print(<stamp_file_info>)
Print method for file info
print(<stamp_language>)
Print method for language
print(<stamp_preview>)
Print method for stamp preview
print(<stamp_template>)
Print method for templates
print(<stamp_update_preview>)
Print method for update preview