-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Closed
Description
I maintain a plugin that relies heavily on the page events. A user using --dirtyreload
will be presented with incomplete or emtpy results.
I'd like to be able to detect if the plugin is using used in dirty model. It might make sense to add it to the config (config['is_dirty'] = dirty
) here:
mkdocs/mkdocs/commands/build.py
Lines 254 to 260 in 4ea78da
if not dirty: | |
log.info("Cleaning site directory") | |
utils.clean_directory(config['site_dir']) | |
else: # pragma: no cover | |
# Warn user about problems that may occur with --dirty option | |
log.warning("A 'dirty' build is being performed, this will likely lead to inaccurate navigation and other" | |
" links within your site. This option is designed for site development purposes only.") |
Or have is accessible as a kwarg in relevant global events, for example adding is_dirty
to on_post_build
mkdocs/mkdocs/commands/build.py
Lines 308 to 309 in 4ea78da
# Run `post_build` plugin events. | |
config['plugins'].run_event('post_build', config=config) |
Perhaps there's another way I'm not seeing?
squidfunk and mondeja
Metadata
Metadata
Assignees
Labels
No labels