Skip to content

Commit 66b977b

Browse files
committed
Added new parameters, adjusted the README.md, conftest.py and test_copier.py files
1 parent cd70a47 commit 66b977b

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

copier.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,20 @@ project_getting_started:
2020
type: str
2121
help: "A short description of how to get started with the project"
2222

23+
project_installation_instructions:
24+
type: str
25+
help: "A short description of how to install the package. It will be added to the README.md of this project"
26+
27+
add_reference_section:
28+
type: bool
29+
help: "Do you want to add a reference section to the README.md?"
30+
default: false
31+
32+
reference_section_description:
33+
when: "{{ add_reference_section }}"
34+
type: str
35+
help: "Enter the references for the reference section."
36+
2337
git_username:
2438
type: str
2539
help: "The GitHub username or organization name"

template/README.md.jinja

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ Use pip to install {{ project_slug }}
2323

2424
If the installation fails, please check out the [help section](https://pyfar-gallery.readthedocs.io/en/latest/help).
2525

26+
{{ project_installation_instructions }}
27+
2628
## Contributing
2729

2830
Check out the [contributing guidelines](https://{{ project_slug }}.readthedocs.io/en/stable/contributing.html) if you want to become part of pyfar.
31+
32+
{% if add_reference_section == true -%}
33+
## References
34+
35+
{{ reference_section_description }}
36+
37+
{%- endif %}

tests/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ def copier_project_defaults():
66
"project_slug": "my_project",
77
"project_long_description": "my_project_description",
88
"project_getting_started": "This is how to get started.",
9+
"add_reference_section": "Y",
10+
"project_installation_instructions": "Installation instructions.",
11+
"reference_section_description": "Reference section description.",
912
"git_username": "pyfar",
1013
"minimum_python_version": "3.11",
1114
"license": "MIT",

tests/test_copier.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ def test_generated_file_exists(default_project, file_name):
4848
"py/my_project.svg",
4949
"https://my_project.readthedocs.io/en/stable/contributing.html",
5050
"\nThis is how to get started.\n",
51+
"\nInstallation instructions.\n",
52+
"\n\n## References\n\nReference section description.",
5153
])
5254
def test_content_readme(default_project, desired):
5355
content = default_project.project_dir.joinpath("README.md").read_text()

0 commit comments

Comments
 (0)