Skip to content

Commit e3a0faa

Browse files
Document representation.json file (#408)
1 parent a03e0a9 commit e3a0faa

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

building/tooling/representers/interface.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ All interactions with the Exercism website are handled automatically. Represente
1010
- A path to a directory containing the submitted file(s) (with a trailing slash).
1111
- A path to an output directory (with a trailing slash). This directory is writable.
1212
- The script must write a `representation.txt` file to the output directory.
13+
- The script must write a `representation.json` file to the output directory.
1314
- The script must write a `mapping.json` file to the output directory.
1415

1516
## Output format
1617

18+
### representation.txt
19+
1720
The `representation.txt` file contains some sort of canonical representation. This representation can take many forms, but is usually an AST:
1821

1922
```ruby
@@ -50,6 +53,8 @@ class PLACEHOLDER_1
5053
end
5154
```
5255

56+
### mapping.json
57+
5358
The `mapping.json` file maps placeholders to their original values:
5459

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

6469
It is important to note that all identical names must be replaced with the same placeholder, irrespective of scope.
70+
71+
### representation.json
72+
73+
The `representation.json` file contains metadata:
74+
75+
- `version`: the version number of the representer (defaults to `1`)
76+
77+
Example:
78+
79+
```json
80+
{ "version": 2 }
81+
```

0 commit comments

Comments
 (0)