-
Notifications
You must be signed in to change notification settings - Fork 0
/
CONTRIBUTING.mz
68 lines (50 loc) · 1.88 KB
/
CONTRIBUTING.mz
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Contributing
## Implementation
1. [./src/walkable.js][2] - Patroon allows one to define deeply nested
patterns. To implement these features succinctly we use an abstraction
which allows the traversing of a tree. This is an area of computer science
named [tree traversal][1].
2. [./src/index.js][3] - We now take the walkable utility and implement
patroon's functionality.
3. [./src/helpers.js][4] - You might have noticed that both the patroon and
walkable modules have common helper functions.
## Formatting
Standard is good enough.
```bash bash 1>&2
npx standard
```
## Documentation
We generate the contributors list using node and store it in [memplate][7].
```js node -p | memplate contributors
require('./package.json').contributors.reduce((acc, {name, url, email}) =>
`${acc}- **${name}** *${url}*\n`, '')
```
We also generate the table of contents and store it in memplate.
```bash bash | memplate toc
npx markdown-toc --no-firsth1 --maxdepth 4 README.mz
```
For the tests in the README.mz to work we also need to install patroon.
```bash bash
npm link
npm link patroon
```
We then use memplate to template the README. Then we run [markatzea][6] to run
the examples and show the output of those.
```bash bash
memplate < README.mz | markatzea > README.md
echo 'Documentation generated successfully.' 1>&2
```
## Changelog
The [changelog][changelog] is generated using the useful [auto-changelog][auto-changelog]
project.
```bash bash > /dev/null
npx auto-changelog -p
```
[1]:https://en.wikipedia.org/wiki/Tree_traversal
[2]:https://github.com/bas080/patroon/blob/master/src/walkable.js
[3]:https://github.com/bas080/patroon/blob/master/src/index.js
[4]:https://github.com/bas080/patroon/blob/master/src/helpers.js
[6]:https://github.com/bas080/markatzea
[7]:https://github.com/bas080/memplate
[changelog]:./CHANGELOG.md
[auto-changelog]:https://www.npmjs.com/package/auto-changelog