elixir-lang / ex_doc

ExDoc produces HTML and EPUB documentation for Elixir projects
http://elixir-lang.org
Other
1.44k stars 324 forks source link

Watch CLI option to make development easier #822

Closed lleger closed 6 years ago

lleger commented 6 years ago

When writing docs, I frequently want to check the output in the browser to ensure things are formatted like I’m intending. During development, this creates a bit of an awkward workflow. I write, save in the editor, run the mix docs command, then refresh the browser. It’d be great if there was a watch option on the CLI or some sort of live reload-type system so changes are reflected a bit more immediately. It would make the writing workflow a bit more productive.

Is this possible to add, perhaps with a file system watcher? If so, and if desired, I’d be happy to attempt a PR. Any tips on the implementation would be appreciated!

josevalim commented 6 years ago

I would say the file system watcher should be set externally, something like fswatch:

fswatch . | mix docs
lleger commented 6 years ago

With fswatch, this seems like the syntax:

fswatch -o lib | xargs -n1 -I {} mix docs