-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,64 @@ | ||
# Project and stage templates | ||
|
||
TODO | ||
DSO provides a templating engine that allows to quickly bootrstap a project (`dso init`), folder, or stages (`dso create`). | ||
Templates are based on [jinja2](https://jinja.palletsprojects.com/en/stable/templates/). | ||
|
||
## Available templates | ||
|
||
DSO currently comes with the following templates: | ||
|
||
Project templates: | ||
|
||
- [default](https://github.com/Boehringer-Ingelheim/dso/tree/main/src/dso/templates/init/default) - Default template, with | ||
integration of `git`, `dvc`, `uv`, `pre-commit`, and `editorconfig`. | ||
|
||
Folder templates: | ||
|
||
- [default](https://github.com/Boehringer-Ingelheim/dso/tree/main/src/dso/templates/folder/default) - This one is very minimal, just a folder with `dvc.yaml` and `params.in.yaml` files. | ||
|
||
Stage templates: | ||
|
||
- [quarto](https://github.com/Boehringer-Ingelheim/dso/tree/main/src/dso/templates/stage/quarto) - Template for quarto notebook in R | ||
- [bash](https://github.com/Boehringer-Ingelheim/dso/tree/main/src/dso/templates/stage/bash) - Template for executing a bash snippet | ||
|
||
The source code of the templates can be [inspected on GitHub](https://github.com/Boehringer-Ingelheim/dso/tree/main/src/dso/templates). | ||
Templates shipped with DSO are [licensed](https://github.com/Boehringer-Ingelheim/dso/blob/main/src/dso/templates/LICENSE) under the Creative Commons Zero v1.0 | ||
Universal license. | ||
|
||
## Using custom template libraries | ||
|
||
Currently, dso only supports the internal templates mentioned above. However, we plan to add support to custom | ||
stage templates soon. This enables some interesting use-cases: | ||
|
||
- Organization-specific templates: Use templates that make it easier to comply with internal processes or apply | ||
corporate design. | ||
- Best-practice codebases: Start off common analysis types off a predefined template. We believe that some analyses | ||
require more flexibility than predefined worflows such as nf-core, but can still benefit from a structured | ||
"base" document to get started with. | ||
|
||
## Writing templates | ||
|
||
Template directories are recursively copied to their destination and files are rendered with [jinja2](https://jinja.palletsprojects.com/en/stable/templates/). | ||
You can use all features of jinja2 such as `if/else` blocks or loops. Additionally, you have access to the | ||
following variables: | ||
|
||
Available variables for **project** templates: | ||
|
||
| variable | content | | ||
| ------------------- | ----------------------------------------------------- | | ||
| project_name | project/folder name as provided to the `dso init` CLI | | ||
| project_description | description as provided to the `dso init` CLI | | ||
|
||
Available variables for **folder** templates: | ||
|
||
| variable | content | | ||
| ----------- | ------------------------------------------------------ | | ||
| folder_name | folder name as provided to the `dso create folder` CLI | | ||
|
||
Available variables for **stage** templates: | ||
|
||
| variable | content | | ||
| ----------------- | ----------------------------------------------------- | | ||
| stage_name | folder name as provided to the `dso create stage` CLI | | ||
| stage_description | description as provided to the `dso create stage` CLI | | ||
| stage_path | Path to the stage relative to the project root | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters