Skip to content

Commit 1e84ed7

Browse files
committed
README tweaks, add agpl-3
1 parent e8e5054 commit 1e84ed7

File tree

3 files changed

+91
-13
lines changed

3 files changed

+91
-13
lines changed

README.Rmd

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,17 @@ knitr::opts_chunk$set(
2121

2222
`filestamp` makes it easy to add and maintain consistent headers across all files in your project, regardless of programming language. Headers can include copyright notices, file descriptions, authorship information, and other metadata.
2323

24+
### What are file headers?
25+
26+
File headers are structured comments at the beginning of code files that contain important metadata. For example, a header might include:
27+
28+
```r
29+
# Copyright (c) Acme Corp 2025
30+
# Author: Jane Developer
31+
# License: MIT
32+
# Last updated: 2025-04-21
33+
```
34+
2435
## Installation
2536

2637
You can install the development version of `filestamp` from [GitHub][filestamp-gh] with:
@@ -95,6 +106,7 @@ The package comes with several built-in templates:
95106
- `default` - A simple header with copyright, author, and license information
96107
- `mit` - MIT License header
97108
- `gpl-3` - GNU General Public License header
109+
- `agpl-3` - GNU Affero General Public License header
98110

99111
List available templates:
100112

@@ -156,15 +168,21 @@ stamp_update("collaborative_script.R", list(
156168

157169
## Language Support
158170

159-
The package supports many programming languages out of the box:
171+
`filestamp` supports 15+ programming languages out of the box:
160172

161173
```{r}
162-
#| label: language-supported
174+
#| label: languages
163175
#| eval: false
164-
# List supported languages
176+
# List all supported languages
165177
languages()
178+
```
166179

167-
# Register a custom language
180+
Add support for additional languages:
181+
182+
```{r}
183+
#| label: custom-language
184+
#| eval: false
185+
# Register a new language
168186
language_register(
169187
"kotlin",
170188
extensions = c("kt", "kts"),
@@ -176,7 +194,7 @@ language_register(
176194

177195
## Variables
178196

179-
You can use variables in your templates to customize the header content. The package provides several built-in variables, and you can also define your own.
197+
Customize your headers with built-in and custom variables:
180198

181199
```{r}
182200
#| label: stamp-template-variables
@@ -187,10 +205,20 @@ stamp_variables_list()
187205
# Add a custom variable
188206
stamp_variables_add("team", "Data Science")
189207
190-
# Set company name
208+
# Set company name globally
191209
options(filestamp.company = "Acme Corp")
192210
```
193211

212+
Built-in variables include:
213+
214+
- `{{year}}` - Current year
215+
- `{{date}}` - Current date (YYYY-MM-DD)
216+
- `{{date_full}}` - Full timestamp
217+
- `{{user}}` - Current username
218+
- `{{company}}` - Company name from options
219+
- `{{filename}}` - Current file name
220+
- `{{file_ext}}` - File extension
221+
194222
## License
195223

196224
AGPL (>= 3)

README.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,18 @@ all files in your project, regardless of programming language. Headers
1313
can include copyright notices, file descriptions, authorship
1414
information, and other metadata.
1515

16+
### What are file headers?
17+
18+
File headers are structured comments at the beginning of code files that
19+
contain important metadata. For example, a header might include:
20+
21+
``` r
22+
# Copyright (c) Acme Corp 2025
23+
# Author: Jane Developer
24+
# License: MIT
25+
# Last updated: 2025-04-21
26+
```
27+
1628
## Installation
1729

1830
You can install the development version of `filestamp` from
@@ -88,6 +100,7 @@ The package comes with several built-in templates:
88100
information
89101
- `mit` - MIT License header
90102
- `gpl-3` - GNU General Public License header
103+
- `agpl-3` - GNU Affero General Public License header
91104

92105
List available templates:
93106

@@ -149,13 +162,17 @@ stamp_update("collaborative_script.R", list(
149162

150163
## Language Support
151164

152-
The package supports many programming languages out of the box:
165+
`filestamp` supports 15+ programming languages out of the box:
153166

154167
``` r
155-
# List supported languages
168+
# List all supported languages
156169
languages()
170+
```
171+
172+
Add support for additional languages:
157173

158-
# Register a custom language
174+
``` r
175+
# Register a new language
159176
language_register(
160177
"kotlin",
161178
extensions = c("kt", "kts"),
@@ -167,9 +184,7 @@ language_register(
167184

168185
## Variables
169186

170-
You can use variables in your templates to customize the header content.
171-
The package provides several built-in variables, and you can also define
172-
your own.
187+
Customize your headers with built-in and custom variables:
173188

174189
``` r
175190
# List available variables
@@ -178,10 +193,20 @@ stamp_variables_list()
178193
# Add a custom variable
179194
stamp_variables_add("team", "Data Science")
180195

181-
# Set company name
196+
# Set company name globally
182197
options(filestamp.company = "Acme Corp")
183198
```
184199

200+
Built-in variables include:
201+
202+
- `{{year}}` - Current year
203+
- `{{date}}` - Current date (YYYY-MM-DD)
204+
- `{{date_full}}` - Full timestamp
205+
- `{{user}}` - Current username
206+
- `{{company}}` - Company name from options
207+
- `{{filename}}` - Current file name
208+
- `{{file_ext}}` - File extension
209+
185210
## License
186211

187212
AGPL (\>= 3)

inst/templates/agpl-3.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: agpl-3
2+
fields:
3+
- name: copyright
4+
default: "{{company}} {{year}}"
5+
required: true
6+
- name: author
7+
default: "{{user}}"
8+
required: true
9+
content: |
10+
Copyright (c) {{copyright}}
11+
Author: {{author}}
12+
License: GNU Affero General Public License v3.0 or later
13+
14+
This program is free software: you can redistribute it and/or modify
15+
it under the terms of the GNU Affero General Public License as published
16+
by the Free Software Foundation, either version 3 of the License, or
17+
(at your option) any later version.
18+
19+
This program is distributed in the hope that it will be useful,
20+
but WITHOUT ANY WARRANTY; without even the implied warranty of
21+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22+
GNU Affero General Public License for more details.
23+
24+
You should have received a copy of the GNU Affero General Public License
25+
along with this program. If not, see <https://www.gnu.org/licenses/>.

0 commit comments

Comments
 (0)