Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.
/ elm-proofread Public archive

Elm documentation testing.

Notifications You must be signed in to change notification settings

icidasset/elm-proofread

Repository files navigation

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

How to use

# 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.

How to install