Customising the template for your needs
Once you’ve created a new repository from the template, you can begin customising it to meet your specific needs.
Renaming the project¶
Open the entire directory in VS Code.
Search for
template_projectin the entire codebase and replace it withnew_project_name, i.e., a concise version of your project’s name (often called a “slug”).Rename the folder
src/template_projecttosrc/new_project_name.
Running the project¶
Prior to modifying anything but the slug, confirm that the template can be executed on your system. This step is essential to ensure that any subsequent issues can be attributed to changes you make rather than the original template.
Open a terminal and navigate to the project root
$ cd /to/root/of/template_projectInstall the pre-commit hooks
$ pixi run prek installInstall the node.js dependencies for the slides
$ pixi run npm installRun the project
$ pixi run pytaskAll programs used within this project template need to be found on your path, see above (Preparing your system and getting the template and the FAQ).
If all went well, you are now ready to adapt the template to your project.
Customising the template¶
Removing auxiliary files¶
Before proceeding, delete the following items as they correspond to the meta project and not the template itself.
docs_templatefolder.githubfolderCHANGES_template.mdfiletests/test_template.pyfile
Find and replace placeholders¶
Now, search for and replace the following placeholders in the entire codebase.
| Placeholder | Replacement |
|---|---|
| JANE DOE | Your full name |
| EXAMPLE PROJECT | Your project’s name |
| EXAMPLE UNIVERSITY | Your university’s name |
| DOE2024 | Your project’s citation identifier |
| https:// | The GitHub repo URL corresponding to your project |
Review and update project details¶
Once you are done with the replacement of placeholders, you can update the contents of the following files.
| File | What to do |
|---|---|
README.md | Remove the entire content and replace it with a README for your project |
pyproject.toml | Update the project description and add any dependencies you will need |
LICENSE | Update the year and name with the current year and your name |
.gitignore | 1. Remove the part that is not relevant to your project, that includes all lines that start with docs_template2. Add any files you need to be ignored by git. |
Changing tool options¶
Finally, you can update options of the included tools. The hooks (specified in
.pre-commit-config.yaml) may require adjustments to align with your project’s needs.
Refer to the Pre-Commit Hooks section for more details.
Next steps¶
Depending on what your needs are, move on with the section on Starting a new project from scratch or on Porting an existing project.