@@ -1,3 +1,57 @@
1−### POSE - a formatter for PureScript code
1+# POSE - a formatter for PureScript code
22
3−Find some instructions [here](https://pose.rowtype.yoga)
3+_Disclaimer_: You might want to use the [tidy](https://github.com/natefaubion/purescript-tidy) formatter instead.
4+
5+**The POSE project is in low maintenance mode.** This means that pull requests are very welcome but the original authors don't actively improve the code.
6+
7+## Try it out
8+
9+Try the formatter live and find some instructions [here](https://pose.rowtype.yoga)
10+
11+## Installation
12+
13+We hook into prettier to take care of a lot of the heavy lifting for us so let's install it and the plugin:
14+
15+```
16+npm install --save-dev prettier @rowtype-yoga/prettier-plugin-purescript
17+```
18+
19+We only want to format our own code so we modify .prettierignore:
20+
21+```
22+echo -e ".spago\noutput/" >> .prettierignore
23+```
24+
25+## Formatting
26+
27+If you use VSCode then you can simply turn on format on save and you're good to go, if you want to manually format some files here's an example:
28+
29+```
30+npx prettier --write src
31+```
32+
33+## Contributing
34+
35+The project is split in two subpackages:
36+
37+1. The core formatter in the `packages/core` folder
38+2. The prettier plugin in the `packages/prettier-plugin-purescript` folder
39+
40+To work on the formatter add a test in `packages/core/testfiles/original/` and run:
41+
42+```sh
43+spago -x exe.dhall test
44+```
45+
46+Then you should adjust the corresponding file in: `packages/core/testfiles/golden/` to what you expect the output to be and start making changes in `packages/core/src/Format.purs` until all tests pass.
47+
48+Run the tests often to get nice diffs:
49+
50+
51+```
52+51 passing
53+1 failed
54+
55+1) Golden Tests formats Issue5.purs
56+ "The diff is saved here: file:///tmp/testfiles-golden-Issue5.purs-actual.html"
57+```