Skip to content

Commit

Permalink
Pass builder to on_serve event.
Browse files Browse the repository at this point in the history
Every call to `server.watch` requires `builder` to be passed in. If
users are to add their own watched files, then they need access to
`builder`. Fixes #1952.
  • Loading branch information
waylan committed Apr 19, 2020
1 parent f532ade commit 7b68f7b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/about/release-notes.md
Expand Up @@ -23,6 +23,8 @@ The current and past members of the MkDocs team.

## Version 1.1.1 (in development)

* Bugfix: Pass `builder` to the `on_serve` event so that it can be passed to
`server.watch` by plugins (#1952).
* Bugfix: Use `lunr[languages]==0.5.8` to avoid `nltk` incompatibilities (#2062).
* Bugfix: Ensure wheel is Python 3 only (#2021).
* Bugfix: Clean up `dev_addr` validation and disallow `0.0.0.0` (#2022).
Expand Down
1 change: 1 addition & 0 deletions docs/user-guide/plugins.md
Expand Up @@ -155,6 +155,7 @@ entire site.
Parameters:
: __server:__ `livereload.Server` instance
: __config:__ global configuration object
: __builder:__ a callable which gets passed to each call to `server.watch`

Returns:
: `livereload.Server` instance
Expand Down
2 changes: 1 addition & 1 deletion mkdocs/commands/serve.py
Expand Up @@ -73,7 +73,7 @@ def get_web_handlers(self, script):
server.watch(d, builder)

# Run `serve` plugin events.
server = config['plugins'].run_event('serve', server, config=config)
server = config['plugins'].run_event('serve', server, config=config, builder=builder)

server.serve(root=site_dir, host=host, port=port, restart_delay=0)

Expand Down

0 comments on commit 7b68f7b

Please sign in to comment.