Elm Proofread.
This command-line tool runs your Elm documentation tests.
module Example exposing (add)
{-| Add two integers together.
>>> add 1 2
3
>>> import Tuple
>>> nine =
..> Tuple.first ( 9, True )
>>> 1.0
..> |> round
..> |> add nine
add
(round 5.0)
5
-}
add : Int -> Int -> Int
add x y = x + y
# Proofread a single file
elm-proofread src/Main.elm
# Proofread stdin
cat src/Main.elm | elm-proofread
# Go to a directory, find all the Elm files and proofread all of them until one fails
( cd elm-project && \
find . -name "*.elm" -print0 | \
xargs -0 -n 1 -I % sh -c 'elm-proofread -- % || exit 255; echo "\n\n"' \
)
Built for Elm v0.19
.
This command assumes the Elm REPL can be run and can locate an elm.json
file.
-
Option 1, use one of the prebuilt binaries available on the releases page.
-
Option 2, use Haskell Stack.
git clone [email protected]:icidasset/elm-proofread.git cd elm-proofread stack install