import invoke
import livereload
import shutil

server = livereload.Server()


@invoke.task
def clean():
    shutil.rmtree('./build')


@invoke.task(pre=[clean])
def build():
    invoke.run('sphinx-build ./source ./build', pty=True)


@invoke.task(pre=[build])
def serve():
    server.watch('./source/*', build)
    server.watch('./source/**/*', build)
    server.serve(
        root='./build',
        host='localhost',
        liveport=35729,
        port=8080
    )

import invoke
import livereload
import shutil

server = livereload.Server()


@invoke.task
def clean():
    shutil.rmtree('./build')


@invoke.task(pre=[clean])
def build():
    invoke.run('sphinx-build ./source ./build', pty=True)


@invoke.task(pre=[build])
def serve():
    server.watch('../reqon/', build)
    server.watch('./source/', build)
    server.serve(
        root='./build',
        host='localhost',
        liveport=35729,
        port=8080
    )

Fix directory watching when serving the docs.
Fix directory watching when serving the docs.

  import invoke
  import livereload
  import shutil
  
  server = livereload.Server()
  
  
  @invoke.task
  def clean():
      shutil.rmtree('./build')
  
  
  @invoke.task(pre=[clean])
  def build():
      invoke.run('sphinx-build ./source ./build', pty=True)
  
  
  @invoke.task(pre=[build])
  def serve():
+     server.watch('../reqon/', build)
-     server.watch('./source/*', build)
+     server.watch('./source/', build)
-     server.watch('./source/**/*', build)
      server.serve(
          root='./build',
          host='localhost',
          liveport=35729,
          port=8080
      )
  
Fix directory watching when serving the docs.
## Code Before:
import invoke
import livereload
import shutil

server = livereload.Server()


@invoke.task
def clean():
    shutil.rmtree('./build')


@invoke.task(pre=[clean])
def build():
    invoke.run('sphinx-build ./source ./build', pty=True)


@invoke.task(pre=[build])
def serve():
    server.watch('./source/*', build)
    server.watch('./source/**/*', build)
    server.serve(
        root='./build',
        host='localhost',
        liveport=35729,
        port=8080
    )

## Instruction:
Fix directory watching when serving the docs.
## Code After:
import invoke
import livereload
import shutil

server = livereload.Server()


@invoke.task
def clean():
    shutil.rmtree('./build')


@invoke.task(pre=[clean])
def build():
    invoke.run('sphinx-build ./source ./build', pty=True)


@invoke.task(pre=[build])
def serve():
    server.watch('../reqon/', build)
    server.watch('./source/', build)
    server.serve(
        root='./build',
        host='localhost',
        liveport=35729,
        port=8080
    )
