Skip to content

Commit

Permalink
Document representation.json file (exercism#408)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikSchierboom authored Nov 15, 2022
1 parent a03e0a9 commit e3a0faa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions building/tooling/representers/interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ All interactions with the Exercism website are handled automatically. Represente
- A path to a directory containing the submitted file(s) (with a trailing slash).
- A path to an output directory (with a trailing slash). This directory is writable.
- The script must write a `representation.txt` file to the output directory.
- The script must write a `representation.json` file to the output directory.
- The script must write a `mapping.json` file to the output directory.

## Output format

### representation.txt

The `representation.txt` file contains some sort of canonical representation. This representation can take many forms, but is usually an AST:

```ruby
Expand Down Expand Up @@ -50,6 +53,8 @@ class PLACEHOLDER_1
end
```

### mapping.json

The `mapping.json` file maps placeholders to their original values:

```json
Expand All @@ -62,3 +67,15 @@ The `mapping.json` file maps placeholders to their original values:
```

It is important to note that all identical names must be replaced with the same placeholder, irrespective of scope.

### representation.json

The `representation.json` file contains metadata:

- `version`: the version number of the representer (defaults to `1`)

Example:

```json
{ "version": 2 }
```

0 comments on commit e3a0faa

Please sign in to comment.