Closed andreasabel closed 2 years ago
Atm, there is no quick way to find out what ormolu is doing. (The live page is just a blank page.)
I heard this from several persons now, and I can't reproduce it, I opened https://github.com/tweag/ormolu/issues/862 for it. If you see something in the Javascript console, can you maybe create a comment there?
In any case, coming up with a nice example of Ormolu output in the README seems like a good idea. We could just reuse the stylish-haskell snippet for example.
We could just reuse the stylish-haskell snippet for example.
Yes, this would be a good start.
Ormolu live is now working. I think it is the best way to let people know how Ormolu formats the code. I'm not super sure what we could include as a demo snippet in the readme, because no matter what we pick (unless we include a fairly long snippet) it cannot be comprehensive. Closing.
(I don't think the snippet from stylish-haskell
would reveal enough in Ormolu's case, because IIRC stylish-haskell only touches some very specific elements of a module, while Ormolu formats everything.)
Yes, but demonstrating a fraction of the functionality is better than demonstrating nothing.
Demonstrating everything (which is what Ormolu live does) is better still than demonstrating a fraction of functionality.
Another advantage of Ormolu live versus a fixed snippet is that we don't need to worry about it going out of date.
That said, if you open a PR adding an example snippet to the readme I will merge it. However, I don't think this is worth having an issue about it.
The small flaw in the ointment is that https://ormolu-live.tweag.io/ presents me with a blank slate.
Maybe the live demo could be filled with an example code, or you could have a menu where several examples can be tried.
You can shorten the path to obtain information about the formatting style. Currently it is:
(What I originally suggested would give some information already at step 1.)
This would be important if source code formatters were like clothes in a shop. You look and compare A and B and choose the one you like. In reality, though
So chances are, you are
Add an example how code is formatted to your README, like in https://github.com/haskell/stylish-haskell#example. Atm, there is no quick way to find out what ormolu is doing. (The live page is just a blank page.)