Skip to content

Commit 900f773

Browse files
committed
Improve configOption
1 parent d45eb41 commit 900f773

File tree

6 files changed

+142
-107
lines changed

6 files changed

+142
-107
lines changed

content/api/cli.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,50 +14,50 @@ In these commands:
1414

1515
## Tracking terms
1616

17-
{{< configOption name="ota track" description="Track the current terms of services according to provided declarations. The declarations, snapshots and versions paths are defined in the configuration." example="`npx ota track`" >}}
17+
{{< configOption name="ota track" description="Track the current terms of services according to provided declarations. The declarations, snapshots and versions paths are defined in the configuration." example="`npx ota track`" />}}
1818

1919
> Note that the snapshots and versions will be recorded at the moment the command is executed, on top of the existing local history. If a shared history already exists and the goal is to add on top of it, that history has to be downloaded before executing that command.
2020
21-
{{< configOption name="ota track --help" description="Show help and available options for track command" example="`npx ota track --help`" >}}
21+
{{< configOption name="ota track --help" description="Show help and available options for track command" example="`npx ota track --help`" />}}
2222

23-
{{< configOption name="ota track [--services <service_id>...]" description="Track terms of specific services only" example="`npx ota track --services \"Facebook\" \"LinkedIn\"`" >}}
23+
{{< configOption name="ota track [--services <service_id>...]" description="Track terms of specific services only" example="`npx ota track --services \"Facebook\" \"LinkedIn\"`" />}}
2424

25-
{{< configOption name="ota track [--services <service_id>...] [--types <terms_type>...]" description="Track specific terms types of specific services only" example="`npx ota track --services \"Facebook\" \"LinkedIn\" --types \"Privacy Policy\" \"Terms of Service\"`" >}}
25+
{{< configOption name="ota track [--services <service_id>...] [--types <terms_type>...]" description="Track specific terms types of specific services only" example="`npx ota track --services \"Facebook\" \"LinkedIn\" --types \"Privacy Policy\" \"Terms of Service\"`" />}}
2626

27-
{{< configOption name="ota track --schedule [--services <service_id>...] [--types <terms_type>...]" description="Track terms on the schedule defined in the configuration" example="`npx ota track --schedule`" >}}
27+
{{< configOption name="ota track --schedule [--services <service_id>...] [--types <terms_type>...]" description="Track terms on the schedule defined in the configuration" example="`npx ota track --schedule`" />}}
2828

2929
## Validating declarations
3030

31-
{{< configOption name="ota validate [--services <service_id>...] [--types <terms_type>...]" description="Check that all declarations allow recording a snapshot and a version properly. If service IDs are provided, check only those services." example="`npx ota validate --services \"Facebook\" \"LinkedIn\" --types \"Privacy Policy\" \"Terms of Service\"`" >}}
31+
{{< configOption name="ota validate [--services <service_id>...] [--types <terms_type>...]" description="Check that all declarations allow recording a snapshot and a version properly. If service IDs are provided, check only those services." example="`npx ota validate --services \"Facebook\" \"LinkedIn\" --types \"Privacy Policy\" \"Terms of Service\"`" />}}
3232

33-
{{< configOption name="ota validate --schema-only [--services <service_id>...] [--types <terms_type>...]" description="Check that all declarations are readable by the engine. Allows for a much faster check of declarations, but does not check that the terms are actually accessible." example="`npx ota validate --schema-only --services \"Facebook\" \"LinkedIn\" --types \"Privacy Policy\" \"Terms of Service\"`" >}}
33+
{{< configOption name="ota validate --schema-only [--services <service_id>...] [--types <terms_type>...]" description="Check that all declarations are readable by the engine. Allows for a much faster check of declarations, but does not check that the terms are actually accessible." example="`npx ota validate --schema-only --services \"Facebook\" \"LinkedIn\" --types \"Privacy Policy\" \"Terms of Service\"`" />}}
3434

35-
{{< configOption name="ota validate --modified" description="Run ota validate only on files that have been modified in Git" example="`npx ota validate --modified`" >}}
35+
{{< configOption name="ota validate --modified" description="Run ota validate only on files that have been modified in Git" example="`npx ota validate --modified`" />}}
3636

3737
## Linting declarations
3838

39-
{{< configOption name="ota lint [--services <service_id>...]" description="Test the format of declarations' normalisation." example="`npx ota lint --services \"Facebook\" \"LinkedIn\"`" >}}
39+
{{< configOption name="ota lint [--services <service_id>...]" description="Test the format of declarations' normalisation." example="`npx ota lint --services \"Facebook\" \"LinkedIn\"`" />}}
4040

41-
{{< configOption name="ota lint --fix [--services <service_id>...]" description="Automatically correct formatting mistakes and ensure that all declarations are standardised" example="`npx ota lint --fix`" >}}
41+
{{< configOption name="ota lint --fix [--services <service_id>...]" description="Automatically correct formatting mistakes and ensure that all declarations are standardised" example="`npx ota lint --fix`" />}}
4242

43-
{{< configOption name="ota lint --modified" description="Run ota lint only on files that have been modified in Git" example="`npx ota lint --modified`" >}}
43+
{{< configOption name="ota lint --modified" description="Run ota lint only on files that have been modified in Git" example="`npx ota lint --modified`" />}}
4444

4545
## Publishing dataset
4646

47-
{{< configOption name="ota dataset [--file <filename>]" description="Export the versions dataset into a ZIP file and publish it to GitHub releases. The dataset title and the URL of the versions repository are defined in the configuration." example="`npx ota dataset --file dataset.zip`" >}}
47+
{{< configOption name="ota dataset [--file <filename>]" description="Export the versions dataset into a ZIP file and publish it to GitHub releases. The dataset title and the URL of the versions repository are defined in the configuration." example="`npx ota dataset --file dataset.zip`" />}}
4848

4949
To export the dataset into a ZIP file and publish it on GitHub releases:
5050

51-
{{< configOption name="ota dataset --publish [--file <filename>]" description="Export and publish dataset to GitHub releases" example="`GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --publish`" >}}
51+
{{< configOption name="ota dataset --publish [--file <filename>]" description="Export and publish dataset to GitHub releases" example="`GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --publish`" />}}
5252

5353
The `GITHUB_TOKEN` can also be defined in a [`.env` file]({{< relref "collections/reference/environment-variables" >}}).
5454

5555
To export, publish the dataset and remove the local copy that was created after it has been uploaded:
5656

57-
{{< configOption name="ota dataset --publish --remove-local-copy [--file <filename>]" description="Export, publish dataset and remove local copy after upload" example="`GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --publish --remove-local-copy`" >}}
57+
{{< configOption name="ota dataset --publish --remove-local-copy [--file <filename>]" description="Export, publish dataset and remove local copy after upload" example="`GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --publish --remove-local-copy`" />}}
5858

59-
{{< configOption name="ota dataset --schedule [--file <filename>]" description="Schedule export, publishing and local copy removal" example="`GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --schedule --publish --remove-local-copy`" >}}
59+
{{< configOption name="ota dataset --schedule [--file <filename>]" description="Schedule export, publishing and local copy removal" example="`GITHUB_TOKEN=ghp_XXXXXXXXX npx ota dataset --schedule --publish --remove-local-copy`" />}}
6060

6161
## Exposing the collection API
6262

63-
{{< configOption name="ota serve" description="Start the collection Web API server. The Web API will be available under `<http://localhost>:<port>/<basePath>/<apiVersion>/<resource>`. The server port and base path are defined in the configuration." example="`npx ota serve`" >}}
63+
{{< configOption name="ota serve" description="Start the collection Web API server. The Web API will be available under `<http://localhost>:<port>/<basePath>/<apiVersion>/<resource>`. The server port and base path are defined in the configuration." example="`npx ota serve`" />}}

content/collections/reference/configuration.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ As an example, see the [production configuration file](https://github.com/OpenTe
1616
type="string"
1717
description="Defines how often the engine should check for changes in terms. Uses standard cron syntax to set the schedule."
1818
default="`30 */12 * * *` (runs every 12 hours at minute 30)"
19-
>}}
19+
/>}}
2020

2121
{{< configOption
2222
name="collectionPath"
2323
type="string"
2424
description="Path to the collection's directory containing declarations directory and metadata file, relative to the engine execution location"
2525
example="`../collections/demo-declarations`"
2626
default="`./`"
27-
>}}
27+
/>}}
2828

2929
### Recorder
3030

@@ -34,13 +34,13 @@ The recorder section manages how versions and snapshots of terms are stored, sup
3434
name="recorder.versions.storage"
3535
type="object"
3636
description="Configuration for storing versions. Supports Git and MongoDB. See [Storage Repositories](#storage-repositories) for more information."
37-
>}}
37+
/>}}
3838

3939
{{< configOption
4040
name="recorder.snapshots.storage"
4141
type="object"
4242
description="Configuration for storing snapshots. Supports Git and MongoDB. See [Storage Repositories](#storage-repositories) for more information."
43-
>}}
43+
/>}}
4444

4545
### Fetcher
4646

@@ -51,21 +51,21 @@ The fetcher section configures how the engine retrieves documents from the web.
5151
type="number"
5252
description="Maximum wait time for elements to appear in a page (milliseconds)."
5353
default="`10000`"
54-
>}}
54+
/>}}
5555

5656
{{< configOption
5757
name="fetcher.navigationTimeout"
5858
type="number"
5959
description="Maximum wait time for a page to load (milliseconds)."
6060
default="`30000`"
61-
>}}
61+
/>}}
6262

6363
{{< configOption
6464
name="fetcher.language"
6565
type="string"
6666
description="Language code (ISO 639-1) for request headers."
6767
default="`en`"
68-
>}}
68+
/>}}
6969

7070
### Notifier
7171

@@ -76,14 +76,14 @@ The notifier section sets up how notifications are sent when new versions of ter
7676
type="string"
7777
description="SendInBlue contacts list ID of persons to notify on terms updates."
7878
default="`850`"
79-
>}}
79+
/>}}
8080

8181
{{< configOption
8282
name="notifier.sendInBlue.updateTemplateId"
8383
type="string"
8484
description="SendInBlue email template ID used for updates notifications."
8585
default="`7`"
86-
>}}
86+
/>}}
8787

8888
### Logger
8989

@@ -94,42 +94,42 @@ The logger section configures logging and error notification settings.
9494
type="string"
9595
description="SMTP server hostname."
9696
default="`smtp-relay.sendinblue.com`"
97-
>}}
97+
/>}}
9898

9999
{{< configOption
100100
name="logger.smtp.username"
101101
type="string"
102102
description="Username for SMTP server authentication."
103103
default="`[email protected]`"
104-
>}}
104+
/>}}
105105

106106
{{< configOption
107107
name="logger.sendMailOnError.to"
108108
type="string"
109109
description="Email address for error notifications."
110110
example="`[email protected]`"
111-
>}}
111+
/>}}
112112

113113
{{< configOption
114114
name="logger.sendMailOnError.from"
115115
type="string"
116116
description="Sender email address for error notifications."
117117
example="`[email protected]`"
118-
>}}
118+
/>}}
119119

120120
{{< configOption
121121
name="logger.sendMailOnError.sendWarnings"
122122
type="boolean"
123123
description="Set to true to also send email in case of warning."
124124
default="`false`"
125-
>}}
125+
/>}}
126126

127127
{{< configOption
128128
name="logger.timestampPrefix"
129129
type="boolean"
130130
description="Set to false to avoid duplicate timestamps if logs are managed by a process manager."
131131
default="`true`"
132-
>}}
132+
/>}}
133133

134134
### Reporter
135135

@@ -141,42 +141,42 @@ The reporter section manages how issues are reported when terms content is inacc
141141
description="Type of reporter"
142142
example="`github`"
143143
allowedValues="`github`, `gitlab`"
144-
>}}
144+
/>}}
145145

146146
{{< configOption
147147
name="reporter.repositories.declarations"
148148
type="string"
149149
description="Repository for creating issues."
150150
example="`OpenTermsArchive/demo-declarations`"
151-
>}}
151+
/>}}
152152

153153
{{< configOption
154154
name="reporter.repositories.versions"
155155
type="string"
156156
description="Repository for versions."
157157
example="`OpenTermsArchive/demo-versions`"
158-
>}}
158+
/>}}
159159

160160
{{< configOption
161161
name="reporter.repositories.snapshots"
162162
type="string"
163163
description="Repository for snapshots."
164164
example="`OpenTermsArchive/demo-snapshots`"
165-
>}}
165+
/>}}
166166

167167
{{< configOption
168168
name="reporter.baseURL"
169169
type="string"
170170
description="Base URL for GitLab (if applicable)."
171171
example="`https://gitlab.example.com`"
172-
>}}
172+
/>}}
173173

174174
{{< configOption
175175
name="reporter.apiBaseURL"
176176
type="string"
177177
description="API base URL for GitLab (if applicable)."
178178
example="`https://api.gitlab.example.com`"
179-
>}}
179+
/>}}
180180

181181
### Dataset
182182

@@ -187,21 +187,21 @@ The dataset section configures how datasets are published.
187187
type="string"
188188
description="Title of the dataset."
189189
default="`sandbox`"
190-
>}}
190+
/>}}
191191

192192
{{< configOption
193193
name="dataset.versionsRepositoryURL"
194194
type="string"
195195
description="Repository URL for dataset releases."
196196
default="`https://github.com/OpenTermsArchive/sandbox`"
197-
>}}
197+
/>}}
198198

199199
{{< configOption
200200
name="dataset.publishingSchedule"
201201
type="string"
202202
description="Cron expression for dataset publishing."
203203
default="`30 8 * * MON` (runs every Monday at 8:30 AM)"
204-
>}}
204+
/>}}
205205

206206
### Collection API
207207

@@ -213,15 +213,15 @@ The collection API section sets the parameters for the API server.
213213
description="Port number for the API server."
214214
example="`8080`"
215215
required=true
216-
>}}
216+
/>}}
217217

218218
{{< configOption
219219
name="collection-api.api.basePath"
220220
type="string"
221221
description="Base path for API endpoints."
222222
example="`/collection-api`"
223223
required=true
224-
>}}
224+
/>}}
225225

226226
---
227227

@@ -235,7 +235,7 @@ The storage repositories section set the parameters for supported backends for s
235235
description="Type of storage backend."
236236
default="`git`"
237237
allowedValues="`git`, `mongo`"
238-
>}}
238+
/>}}
239239

240240
### Git
241241

@@ -246,35 +246,35 @@ The Git storage configuration allows to store versions in a Git repository.
246246
type="string"
247247
description="Path to the versions database directory."
248248
default="`./data/versions`"
249-
>}}
249+
/>}}
250250

251251
{{< configOption
252252
name="storage.git.publish"
253253
type="boolean"
254254
description="Boolean to push changes to the origin."
255255
default="`false`"
256-
>}}
256+
/>}}
257257

258258
{{< configOption
259259
name="storage.git.snapshotIdentiferTemplate"
260260
type="string"
261261
description="Template for snapshot ID reference. `%SNAPSHOT_ID` will be replaced with the actual snapshot ID."
262262
default="`./data/snapshots/%SNAPSHOT_ID`"
263-
>}}
263+
/>}}
264264

265265
{{< configOption
266266
name="storage.git.author.name"
267267
type="string"
268268
description="Author name for changes."
269269
default="`Open Terms Archive Bot`"
270-
>}}
270+
/>}}
271271

272272
{{< configOption
273273
name="storage.git.author.email"
274274
type="string"
275275
description="Author email for changes."
276276
default="`[email protected]`"
277-
>}}
277+
/>}}
278278

279279
### MongoDB
280280

@@ -285,18 +285,18 @@ The MongoDB storage configuration allows to store versions in a MongoDB database
285285
type="string"
286286
description="MongoDB connection URI."
287287
default="`mongodb://127.0.0.1:27017`"
288-
>}}
288+
/>}}
289289

290290
{{< configOption
291291
name="storage.mongo.database"
292292
type="string"
293293
description="Database name."
294294
default="`open-terms-archive`"
295-
>}}
295+
/>}}
296296

297297
{{< configOption
298298
name="storage.mongo.collection"
299299
type="string"
300300
description="Collection name."
301301
default="`snapshots`"
302-
>}}
302+
/>}}

content/collections/reference/environment-variables.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ This reference documentation details all available environment variables that ca
99

1010
### Engine
1111

12-
{{< configOption name="OTA_ENGINE_SMTP_PASSWORD" type="string" description="SMTP password for email error notifications." >}}
12+
{{< configOption name="OTA_ENGINE_SMTP_PASSWORD" type="string" description="SMTP password for email error notifications." />}}
1313

14-
{{< configOption name="OTA_ENGINE_SENDINBLUE_API_KEY" type="string" description="API key for SendInBlue." >}}
14+
{{< configOption name="OTA_ENGINE_SENDINBLUE_API_KEY" type="string" description="API key for SendInBlue." />}}
1515

16-
{{< configOption name="OTA_ENGINE_GITHUB_TOKEN" type="string" description="GitHub token for API access." >}}
16+
{{< configOption name="OTA_ENGINE_GITHUB_TOKEN" type="string" description="GitHub token for API access." />}}
1717

18-
{{< configOption name="OTA_ENGINE_GITLAB_TOKEN" type="string" description="GitLab token for API access." >}}
18+
{{< configOption name="OTA_ENGINE_GITLAB_TOKEN" type="string" description="GitLab token for API access." />}}
1919

20-
{{< configOption name="OTA_ENGINE_GITLAB_RELEASES_TOKEN" type="string" description="GitLab token for dataset releases." >}}
20+
{{< configOption name="OTA_ENGINE_GITLAB_RELEASES_TOKEN" type="string" description="GitLab token for dataset releases." />}}
2121

2222
---
2323

2424
### Federation API
2525

26-
{{< configOption name="OTA_FEDERATION_API_SMTP_PASSWORD" type="string" description="SMTP password for email error notifications." >}}
26+
{{< configOption name="OTA_FEDERATION_API_SMTP_PASSWORD" type="string" description="SMTP password for email error notifications." />}}

0 commit comments

Comments
 (0)