dmy / elm-doc-preview

Elm offline documentation previewer
https://www.npmjs.com/package/elm-doc-preview
Other
128 stars 15 forks source link

Add an option to check whether the documentation is correct #23

Closed jfmengels closed 5 years ago

jfmengels commented 5 years ago

Hi!

First of all, thanks for the awesome tool, I find it really useful!

One of the things I like about this tool, is that it tells us when the documentation is incomplete or erroneous, and it does that before we'd try to publish the package.

What I would like, is a way to enforce that the documentation is complete and valid when running the test suite. This way, when someone makes a pull request to your project, you don't have to manually run elm-doc-preview to verify that the docs are still okay. I think this can be especially useful for package repositories.

My proposal is to add a --check (or similarly named) option that doesn't run the documentation server, and only checks whether the docs are valid. If they are, the process succeeds, otherwise the process fails and the same errors as in the server are shown in the terminal.

Let me know what you think :)

rlefevre commented 5 years ago

elm make --docs will return an error exit code if the documentation is invalid, so you can use this command in your tests.

See https://github.com/dmy/elm-doc-preview/issues/21

jfmengels commented 5 years ago

Oh, awesome! Thanks a lot!