Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Watch 'n' build #11

Closed
hayd opened this issue Jan 10, 2016 · 5 comments
Closed

Watch 'n' build #11

hayd opened this issue Jan 10, 2016 · 5 comments

Comments

@hayd
Copy link
Contributor

hayd commented Jan 10, 2016

When writing documentation you usually want to see it rendered.

For example mkdocs watches the docs_dir for any changes, and rebuilds the site each time there is a change. We could watch the docs/src directory and rebuild docs/build upon changes (then mkdocs would see this...). Or build once or watch based on cli arg.

Of course, this could be another package, it does sound like feature creep!

@MichaelHatherly
Copy link
Member

Would definitely be good to have. There's https://github.com/rened/Watcher.jl which sounds as though it does this kind of thing. There's also Base.watch_file so maybe we don't need to pull in a dep if it's simple enough to implement. Either way, 👍.

As well as rebuilding on changes to src/ should also rebuild when changes are made to .jl files in the package itself.

@hayd
Copy link
Contributor Author

hayd commented Jan 11, 2016

Yeah so that works pretty good:

# terminal one
julia -e "using Watcher" -- -f=jl,md -w=src,docs/src --now --run julia docs/build.jl

# terminal two
mkdocs serve

Unfortunately/weirdly I'm getting some weird poll errors (though it works):

ERROR (unhandled task failure): start_watching (FileMonitor): no such file or directory (ENOENT)
 [inlined code] from ./stream.jl:1036
 in start_watching at ./poll.jl:295
 in wait at ./poll.jl:355
 in watch_file at ./poll.jl:394
 in watch_file at ./poll.jl:382
 in anonymous at ./task.jl:435

which I don't get if I do:

julia -e "using Watcher" -- -f=jl,md -w=src,docs/src --now --run echo "rebuild"

@MichaelHatherly
Copy link
Member

no such file or directory (ENOENT) is probably from doing rm on doc/build to clean it out I'd guess. If it's not causing actual problems then let's run with that for the moment. We can just document using Watcher for this and maybe add it as a dep so it's already included by default.

@fredrikekre
Copy link
Member

FWIW, using Revise for this is very smooth. You don't have to restart julia and when everything (Documenter and your package) is compiled already the docs usually build in no time.

@mortenpi
Copy link
Member

DocumenterTools would be more appropriate for this type of tooling I think, so closing in favor of JuliaDocs/DocumenterTools.jl#13.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants