Skip to content

Commit ba2f9ed

Browse files
committed
Fix non-exemplar template parity with cookiecutter output
Restructure template/README.md.jinja so the heading, badges, description, license, and usage sections are shared between exemplar and non-exemplar output, matching what cookiecutter produced. Previously the non-exemplar branch rendered only "TODO" with no heading or badges. Guard exemplar-specific paths in .gitattributes.jinja (template/, copier/) and .pre-commit-config.yaml.jinja exclude pattern so generated non-exemplar projects don't reference directories they don't contain. Fix extra blank line in CONTRIBUTING.md.jinja rendering and remove the include-path NOTE that main deliberately removed.
1 parent 9e1103f commit ba2f9ed

5 files changed

Lines changed: 34 additions & 20 deletions

File tree

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ What follows is an example of a Beman library README.
153153

154154
# beman.exemplar: A Beman Library Exemplar
155155

156+
<!--
157+
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
158+
-->
159+
156160
<!-- markdownlint-disable line-length -->
157161
[![Library Status](https://raw.githubusercontent.com/bemanproject/beman/refs/heads/main/images/badges/beman_badge-beman_library_under_development.svg)](https://github.com/bemanproject/beman/blob/main/docs/beman_library_maturity_model.md#the-beman-library-maturity-model)
158162
[![Continuous Integration Tests](https://github.com/bemanproject/exemplar/actions/workflows/ci_tests.yml/badge.svg)](https://github.com/bemanproject/exemplar/actions/workflows/ci_tests.yml)
@@ -359,9 +363,3 @@ include an appropriate `beman.exemplar` header from your source code.
359363
```c++
360364
#include <beman/exemplar/exemplar.hpp>
361365
```
362-
363-
> [!NOTE]
364-
>
365-
> `beman.exemplar` headers are to be included with the `beman/exemplar/` prefix.
366-
> Altering include search paths to spell the include target another way (e.g.
367-
> `#include <exemplar.hpp>`) is unsupported.

template/.gitattributes.jinja

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
infra/** linguist-vendored
2+
{% if generating_exemplar -%}
23
template/** linguist-vendored
34
copier/** linguist-vendored
5+
{% endif -%}
46
*.bib -linguist-detectable
57
*.tex -linguist-detectable
68
papers/* linguist-documentation

template/.pre-commit-config.yaml.jinja

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@ repos:
4848
- id: beman-tidy
4949

5050
{% endif %}
51+
{% if generating_exemplar -%}
5152
exclude: 'template/|copier/|infra/|port/'
53+
{% else -%}
54+
exclude: 'infra/|port/'
55+
{% endif -%}

template/CONTRIBUTING.md.jinja

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ ctest --test-dir build
105105

106106
The file `./lockfile.json` configures the list of dependencies and versions that will be
107107
acquired by FetchContent.
108+
{% if generating_exemplar %}
108109

109-
{% if generating_exemplar %}## Developing The Copier Template
110+
## Developing The Copier Template
110111

111112
This repository doubles as both the exemplar library and the Copier template used to stamp
112113
new Beman libraries.

template/README.md.jinja

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -152,31 +152,46 @@ The consistency check renders from a `.git`-free temporary snapshot of the repos
152152

153153
What follows is an example of a Beman library README.
154154

155-
# beman.exemplar: A Beman Library Exemplar
155+
{% endif %}
156+
# beman.{{project_name}}: {{description}}
157+
158+
<!--
159+
SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
160+
-->
156161

157162
<!-- markdownlint-disable line-length -->
158163
[![Library Status](https://raw.githubusercontent.com/bemanproject/beman/refs/heads/main/images/badges/beman_badge-beman_library_under_development.svg)](https://github.com/bemanproject/beman/blob/main/docs/beman_library_maturity_model.md#the-beman-library-maturity-model)
159-
[![Continuous Integration Tests](https://github.com/bemanproject/exemplar/actions/workflows/ci_tests.yml/badge.svg)](https://github.com/bemanproject/exemplar/actions/workflows/ci_tests.yml)
160-
[![Lint Check (pre-commit)](https://github.com/bemanproject/exemplar/actions/workflows/pre-commit-check.yml/badge.svg)](https://github.com/bemanproject/exemplar/actions/workflows/pre-commit-check.yml)
161-
[![Coverage](https://coveralls.io/repos/github/bemanproject/exemplar/badge.svg?branch=main)](https://coveralls.io/github/bemanproject/exemplar?branch=main)
164+
[![Continuous Integration Tests](https://github.com/{{owner}}/{{project_name}}/actions/workflows/ci_tests.yml/badge.svg)](https://github.com/{{owner}}/{{project_name}}/actions/workflows/ci_tests.yml)
165+
[![Lint Check (pre-commit)](https://github.com/{{owner}}/{{project_name}}/actions/workflows/pre-commit-check.yml/badge.svg)](https://github.com/{{owner}}/{{project_name}}/actions/workflows/pre-commit-check.yml)
166+
[![Coverage](https://coveralls.io/repos/github/{{owner}}/{{project_name}}/badge.svg?branch=main)](https://coveralls.io/github/{{owner}}/{{project_name}}?branch=main)
162167
![Standard Target](https://github.com/bemanproject/beman/blob/main/images/badges/cpp29.svg)
163-
[![Compiler Explorer Example](https://img.shields.io/badge/Try%20it%20on%20Compiler%20Explorer-grey?logo=compilerexplorer&logoColor=67c52a)](https://godbolt.org/z/4qEPK87va)
168+
{% if generating_exemplar %}[![Compiler Explorer Example](https://img.shields.io/badge/Try%20it%20on%20Compiler%20Explorer-grey?logo=compilerexplorer&logoColor=67c52a)](https://godbolt.org/z/4qEPK87va)
169+
{% endif %}
164170
<!-- markdownlint-restore -->
165171

172+
{% if generating_exemplar %}
166173
`beman.exemplar` is a minimal C++ library conforming to [The Beman Standard](https://github.com/bemanproject/beman/blob/main/docs/beman_standard.md).
167174
This can be used as a template for those intending to write Beman libraries.
168175
It may also find use as a minimal and modern C++ project structure.
176+
{% else %}
177+
`beman.{{project_name}}` is (... TODO: description).
178+
{% endif %}
169179

170-
**Implements**: `std::identity` proposed in [Standard Library Concepts (P0898R3)](https://wg21.link/P0898R3).
180+
{% if generating_exemplar %}
181+
**Implements**: `std::identity` proposed in [Standard Library Concepts ({{paper}})](https://wg21.link/{{paper}}).
182+
{% else %}
183+
**Implements**: `std::todo` proposed in [TODO ({{paper}})](https://wg21.link/{{paper}}).
184+
{% endif %}
171185

172186
**Status**: [Under development and not yet ready for production use.](https://github.com/bemanproject/beman/blob/main/docs/beman_library_maturity_model.md#under-development-and-not-yet-ready-for-production-use)
173187

174188
## License
175189

176-
`beman.exemplar` is licensed under the Apache License v2.0 with LLVM Exceptions.
190+
`beman.{{project_name}}` is licensed under the Apache License v2.0 with LLVM Exceptions.
177191

178192
## Usage
179193

194+
{% if generating_exemplar %}
180195
`std::identity` is a function object type whose `operator()` returns its argument unchanged.
181196
`std::identity` serves as the default projection in constrained algorithms.
182197
Its direct usage is usually not needed.
@@ -364,9 +379,3 @@ include an appropriate `beman.{{project_name}}` header from your source code.
364379
```c++
365380
#include <beman/{{project_name}}/{{project_name}}.hpp>
366381
```
367-
368-
> [!NOTE]
369-
>
370-
> `beman.{{project_name}}` headers are to be included with the `beman/{{project_name}}/` prefix.
371-
> Altering include search paths to spell the include target another way (e.g.
372-
> `#include <{{project_name}}.hpp>`) is unsupported.

0 commit comments

Comments
 (0)