nf-core / nf-core/tools

Add option for custom child-template repo

Open
#2,898 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

command line tools Stale
Dominant language
Python
Stars
322
Forks
255
Avg merge
2d 3h
Merged PRs (30d)
5

Description

In some cases, people want to use the nf-core template and associated best practices (and updates), but constantly need to apply the same set of modifications when creating new pipelines. In this situation, it would be nice to be able to supply a "child template" that overwrites specific desired template files, and/or adds additional ones.

Template overrides are a pretty standard mechanism, see examples such as mkdocs, MultiQC and more.

Workflow should be:

  1. Create a new repository for the custom template. Add any files that you want to overwrite.
    • For example, if you want a custom readme but everything else the same, create just a README.md file and nothing else
  2. Run nf-core create --template https://github.com/myorg/mytemplate
  3. The create command generates a pipeline as normal. It then renders the custom repo template afterwards, and copies these generated files on top of the vanilla pipeline output.
  4. The template git repo is noted in .nf-core.yml so that the same process can be repeated for pipeline syncs (and even linting?)

Will need additional docs to describe the various template variables that are available for use, such as {{ name }} etc.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the nf-core create command's template-rendering path and how .nf-core.yml is read during pipeline syncs. Check whether linting also consumes that configuration. Done means a child template repository can overlay or add generated files, is recorded in .nf-core.yml, and the behavior is documented with available template variables.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github, python
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.