Skip to content

Commit ea1539a

Browse files
committed
Merge branch 'main' into add-local-contrib-guide
2 parents e44267d + b3be850 commit ea1539a

27 files changed

+761
-149
lines changed

.github/workflows/gh-pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
hugo config
4444
4545
- name: Build with Hugo
46-
run: hugo --minify
46+
run: npm run build
4747

4848
- name: Build JSDoc
4949
run: npm run jsdoc

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
hugo-version: '0.119.0'
3030
extended: true # Prevent error building site: POSTCSS: failed to transform, see https://gohugo.io/troubleshooting/faq/#i-get-this-feature-is-not-available-in-your-current-hugo-version
3131
- name: Build with Hugo
32-
run: hugo --minify
32+
run: npm run build
33+
- name: Build JSDoc
34+
run: npm run jsdoc
3335
- name: Test broken links
3436
run: npm run test:links

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
Open Terms Archive documentation.
22

3+
## Styleguide
4+
5+
### Order of menu sections
6+
7+
Pages and sections are ordered on the “end user” to “core team member” spectrum: the more up a page is in the menu, the more it is targeted at consumer end users, the more low it is the more it is targeted at committed contributors.
8+
39
## Installation
410

511
### Dependencies

content/_index.en.md

Lines changed: 13 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,23 @@ _Words in bold are [business domain names](https://en.wikipedia.org/wiki/Domain-
2121

2222
## Main concepts
2323

24-
### Instances
24+
### Collection
2525

26-
Open Terms Archive is a decentralised system.
27-
28-
It aims at enabling any entity to **track** **terms** on its own and at federating a number of public **instances** in a single ecosystem to maximise discoverability, collaboration and political power. To that end, the Open Terms Archive **engine** can be run on any server, thus making it a dedicated **instance**.
29-
30-
> Federated public instances can be [found on GitHub](
31-
https://github.com/OpenTermsArchive?q=declarations).
32-
33-
### Collections
34-
35-
An **instance** **tracks** **terms** of a single **collection**.
26+
Open Terms Archive is a decentralised system. It aims at enabling any entity to **track** **terms** on its own. To that end, the Open Terms Archive **engine** can be run on any server, thus making it a dedicated **instance**. An **instance** **tracks** **terms** within a single **collection**.
3627

3728
A **collection** is characterised by a **scope** across **dimensions** that describe the **terms** it **tracks**, such as **language**, **jurisdiction** and **industry**.
3829

39-
> Federated public collections can be [found on GitHub](https://github.com/OpenTermsArchive?q=versions).
40-
4130
#### Example scope
4231

4332
> The terms tracked in this collection are:
4433
> - Of dating services used in Europe.
4534
> - In the European Union and Switzerland jurisdictions.
4635
> - In English, unless no English version exists, in which case the primary official language of the jurisdiction of incorporation of the service operator will be used.
4736
37+
### Federation
38+
39+
In order to maximise discoverability, collaboration and political power, public **collections** are **federated** within a single ecosystem. This makes their data mutually discoverable and enables mutualising effort.
40+
4841
### Terms types
4942

5043
To distinguish between the different **terms** of a **service**, each has a **type**, such as “Terms of Service”, “Privacy Policy”, “Developer Agreement”…
@@ -105,9 +98,8 @@ Such a dataset can be generated from **versions** alone. If **snapshots** and **
10598
10699
This documentation describes how to execute the **engine** independently from any specific **instance**. For other use cases, other parts of the documentation could be more relevant:
107100
108-
- to contribute **declarations** to an existing **instance**, see [how to contribute terms]({{< relref "contributing-terms" >}});
109-
- to create a new **collection**, see the [collection bootstrap](https://github.com/OpenTermsArchive/template-declarations) script;
110-
- to create a new public **instance**, see the [governance]({{< relref "governance" >}}) documentation.
101+
- to contribute **declarations** to an existing **collection**, see [contributing terms]({{< relref "contributing-terms" >}});
102+
- to create a new **collection**, see [creating a new collection]({{< relref "collections/create" >}}).
111103
112104
### Requirements
113105
@@ -284,68 +276,6 @@ The server `<port>` and `<basePath>` are defined in the [configuration](#configu
284276

285277
> For example, with the default configuration, the list of services can be found at [`http://localhost:3000/api/v1/services`](http://localhost:3000/api/v1/services).
286278
287-
## API
288-
289-
Open Terms Archive collections can be explored locally over a [Node.js](#nodejs-api), or remotely over a [Web API](#web-api). As Open Terms Archive is decentralised, each [instance](#instances) embarks its own API. The documentation relevant to the specific version of the engine on that instance is provided on that instance itself.
290-
291-
### Web API
292-
293-
The Web API exposes JSON data over HTTP(S). Its [OpenAPI](https://swagger.io/specification/) specification can be found at `http://localhost:<port>/<basePath>/<API version>/docs`.
294-
295-
That endpoint exposes both the OpenAPI specification if the requested `Content-Type` is JSON, and a Swagger UI for visual and interactive documentation otherwise.
296-
297-
> For example, the [documentation](http://162.19.74.224/api/v1/docs) of the [Demo collection](https://github.com/OpenTermsArchive/demo-declarations) is publicly available for exploration.
298-
299-
### Node.js API
300-
301-
As a Node module dependency, the engine exposes a JavaScript API that can be called in your own code. The following modules are available.
302-
303-
#### `fetch`
304-
305-
The `fetch` module gets the MIME type and content of a document from its URL
306-
307-
```js
308-
import fetch from '@opentermsarchive/engine/fetch';
309-
```
310-
311-
Documentation on how to use `fetch` is provided [as JSDoc](https://docs.opentermsarchive.org/jsdoc/).
312-
313-
##### Headless browser management
314-
315-
If you pass the `executeClientScripts` option to `fetch`, a headless browser will be used to download and execute the page before serialising its DOM. For performance reasons, the starting and stopping of the browser is your responsibility to avoid instantiating a browser on each fetch. Here is an example on how to use this feature:
316-
317-
```js
318-
import fetch, { launchHeadlessBrowser, stopHeadlessBrowser } from '@opentermsarchive/engine/fetch';
319-
320-
await launchHeadlessBrowser();
321-
await fetch({ executeClientScripts: true, ... });
322-
await fetch({ executeClientScripts: true, ... });
323-
await fetch({ executeClientScripts: true, ... });
324-
await stopHeadlessBrowser();
325-
```
326-
327-
The `fetch` module options are defined as a [`node-config` submodule](https://github.com/node-config/node-config/wiki/Sub-Module-Configuration). The default `fetcher` configuration can be overridden by adding a `fetcher` object to the [local configuration file](#configuration-file).
328-
329-
#### `extract`
330-
331-
The `extract` module transforms HTML or PDF content into a Markdown string according to a [declaration](#declarations).
332-
333-
```js
334-
import extract from '@opentermsarchive/engine/extract';
335-
```
336-
337-
The `extract` function documentation is available [as JSDoc](https://docs.opentermsarchive.org/jsdoc/).
338-
339-
#### `SourceDocument`
340-
341-
The `SourceDocument` class encapsulates information about a terms' source document tracked by Open Terms Archive.
342-
343-
```js
344-
import SourceDocument from '@opentermsarchive/engine/sourceDocument';
345-
```
346-
347-
The `SourceDocument` format is defined [in source code](https://github.com/OpenTermsArchive/engine/tree/main/src/archivist/services/sourceDocument.js).
348-
349279
- - -
350280

351281
## Configuring
@@ -393,13 +323,12 @@ The default configuration can be found in `config/default.json`. The full refere
393323
"sendWarnings": "Boolean. Set to true to also send email in case of warning",
394324
}
395325
},
396-
"tracker": { // Tracking mechanism to create GitHub issues when terms content is inaccessible
326+
"reporter": { // Reporter mechanism to create GitHub issues when terms content is inaccessible
397327
"githubIssues": {
398-
"repository": "GitHub repository where to create isssues",
399-
"label": {
400-
"name": "Label to attach to bot-created issues. This specific label will be created automatically in the target repository",
401-
"color": "The hexadecimal color code for the label, without the leading #",
402-
"description": "A short description of the label"
328+
"repositories": {
329+
"declarations": "GitHub repository where to create issues; expected format: <owner>/<repository>",
330+
"versions": "GitHub repository of versions associated with the declarations; expected format: <owner>/<repository>",
331+
"snapshots": "GitHub repository of snapshots associated with the declarations; expected format: <owner>/<repository>"
403332
}
404333
}
405334
},

content/api/_index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: API
3+
weight: 6
4+
---

content/api/collection.en.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
title: Collection
3+
weight: 2
4+
---
5+
6+
# Collection Web API [Beta]
7+
8+
As Open Terms Archive is decentralised, each instance embarks its own API. The documentation relevant to the specific version of the engine on that instance is provided on that instance itself.
9+
10+
The Collection API exposes JSON data over HTTP. Its [OpenAPI](https://swagger.io/specification/) specification can be found at `http://localhost:<port>/<basePath>/<API version>/docs`.
11+
12+
That endpoint exposes both the OpenAPI specification if the requested `Content-Type` is JSON, and a Swagger UI for visual and interactive documentation otherwise.
13+
14+
> For example, the [documentation](http://162.19.74.224/api/v1/docs) of the [Demo collection](https://github.com/OpenTermsArchive/demo-declarations) is publicly available for exploration.

content/api/federated.en.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: Federated
3+
weight: 3
4+
---
5+
6+
# Federated Web API [Beta]
7+
8+
Open Terms Archive is a decentralised system that tracks collections of services' terms across multiple servers. Each collection operates its own API, and the federated API unifies search and discovery across collections, fostering collaboration with external applications.
9+
10+
The Federated Web API exposes JSON data over HTTP. Its [documentation](http://51.89.136.45/v1/docs/) is provided in a dedicated, interactive interface.
11+
12+
That endpoint exposes both the [OpenAPI](https://swagger.io/specification/) specification if the requested `Content-Type` is JSON, and a Swagger UI for visual and interactive documentation otherwise.
13+
14+
## Beta
15+
16+
This API is offered as a preview, based on a first use case [defined](https://github.com/OpenTermsArchive/engine/issues/1016) with partner [ToS;DR](https://tosdr.org). Unexpected problems or missing functionality may arise. Please provide feedback through [issues](https://github.com/OpenTermsArchive/federated-api/issues) in the dedicated repository.
17+
18+
## Source code
19+
20+
The codebase for the Federated API is available on [`github.com/OpenTermsArchive/federated-api`](https://github.com/OpenTermsArchive/federated-api).
21+
22+
## Deploying
23+
24+
Deployment recipes are available in a [dedicated repository](https://github.com/OpenTermsArchive/deployment). Look at the [Federated API section](https://github.com/OpenTermsArchive/deployment#federated-api-application) on the README to know how to deploy the API.

content/api/node.en.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: Node
3+
weight: 1
4+
---
5+
6+
# Node.js API [Beta]
7+
8+
As a Node module dependency, the engine exposes a JavaScript API that can be called in your own code. The following modules are available.
9+
10+
## `fetch`
11+
12+
The `fetch` module gets the MIME type and content of a document from its URL
13+
14+
```js
15+
import fetch from '@opentermsarchive/engine/fetch';
16+
```
17+
18+
Documentation on how to use `fetch` is provided [as JSDoc](/jsdoc/index.html).
19+
20+
### Headless browser management
21+
22+
If you pass the `executeClientScripts` option to `fetch`, a headless browser will be used to download and execute the page before serialising its DOM. For performance reasons, the starting and stopping of the browser is your responsibility to avoid instantiating a browser on each fetch. Here is an example on how to use this feature:
23+
24+
```js
25+
import fetch, { launchHeadlessBrowser, stopHeadlessBrowser } from '@opentermsarchive/engine/fetch';
26+
27+
await launchHeadlessBrowser();
28+
await fetch({ executeClientScripts: true, ... });
29+
await fetch({ executeClientScripts: true, ... });
30+
await fetch({ executeClientScripts: true, ... });
31+
await stopHeadlessBrowser();
32+
```
33+
34+
The `fetch` module options are defined as a [`node-config` submodule](https://github.com/node-config/node-config/wiki/Sub-Module-Configuration). The default `fetcher` configuration can be overridden by adding a `fetcher` object to the local configuration file.
35+
36+
## `extract`
37+
38+
The `extract` module transforms HTML or PDF content into a Markdown string according to a declaration.
39+
40+
```js
41+
import extract from '@opentermsarchive/engine/extract';
42+
```
43+
44+
The `extract` function documentation is available [as JSDoc](/jsdoc/index.html).
45+
46+
## `SourceDocument`
47+
48+
The `SourceDocument` class encapsulates information about a terms' source document tracked by Open Terms Archive.
49+
50+
```js
51+
import SourceDocument from '@opentermsarchive/engine/sourceDocument';
52+
```
53+
54+
The `SourceDocument` format is defined [in source code](https://github.com/OpenTermsArchive/engine/tree/main/src/archivist/services/sourceDocument.js).

content/collections/_index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Collections
3+
weight: 5
4+
---

0 commit comments

Comments
 (0)