mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-12-18 10:25:58 +01:00
Improve plugin inter-op with external tools like mike
This commit is contained in:
parent
ef448ed945
commit
ab178b2bc2
@ -52,10 +52,18 @@ from material.plugins.blog.config import BlogConfig
|
|||||||
class BlogPlugin(BasePlugin[BlogConfig]):
|
class BlogPlugin(BasePlugin[BlogConfig]):
|
||||||
supports_multiple_instances = True
|
supports_multiple_instances = True
|
||||||
|
|
||||||
|
# Initialize plugin
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
# Initialize variables for incremental builds
|
||||||
|
self.is_serve = False
|
||||||
|
self.is_dirtyreload = False
|
||||||
|
self.is_dirty = False
|
||||||
|
|
||||||
# Determine whether we're running under dirty reload
|
# Determine whether we're running under dirty reload
|
||||||
def on_startup(self, *, command, dirty):
|
def on_startup(self, *, command, dirty):
|
||||||
self.is_serve = (command == "serve")
|
self.is_serve = (command == "serve")
|
||||||
self.is_dirtyreload = False
|
|
||||||
self.is_dirty = dirty
|
self.is_dirty = dirty
|
||||||
|
|
||||||
# Initialize plugin
|
# Initialize plugin
|
||||||
|
@ -42,6 +42,13 @@ from material.plugins.info.config import InfoConfig
|
|||||||
# Info plugin
|
# Info plugin
|
||||||
class InfoPlugin(BasePlugin[InfoConfig]):
|
class InfoPlugin(BasePlugin[InfoConfig]):
|
||||||
|
|
||||||
|
# Initialize plugin
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
# Initialize variables for incremental builds
|
||||||
|
self.is_serve = False
|
||||||
|
|
||||||
# Determine whether we're serving
|
# Determine whether we're serving
|
||||||
def on_startup(self, *, command, dirty):
|
def on_startup(self, *, command, dirty):
|
||||||
self.is_serve = (command == "serve")
|
self.is_serve = (command == "serve")
|
||||||
|
@ -42,14 +42,20 @@ except ImportError:
|
|||||||
# Search plugin
|
# Search plugin
|
||||||
class SearchPlugin(BasePlugin[SearchConfig]):
|
class SearchPlugin(BasePlugin[SearchConfig]):
|
||||||
|
|
||||||
# Determine whether we're running under dirty reload
|
# Initialize plugin
|
||||||
def on_startup(self, *, command, dirty):
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
# Initialize variables for incremental builds
|
||||||
self.is_dirtyreload = False
|
self.is_dirtyreload = False
|
||||||
self.is_dirty = dirty
|
|
||||||
|
|
||||||
# Initialize search index cache
|
# Initialize search index cache
|
||||||
self.search_index_prev = None
|
self.search_index_prev = None
|
||||||
|
|
||||||
|
# Determine whether we're serving
|
||||||
|
def on_startup(self, *, command, dirty):
|
||||||
|
self.is_dirty = dirty
|
||||||
|
|
||||||
# Initialize plugin
|
# Initialize plugin
|
||||||
def on_config(self, config):
|
def on_config(self, config):
|
||||||
if not self.config.lang:
|
if not self.config.lang:
|
||||||
|
@ -52,10 +52,18 @@ from material.plugins.blog.config import BlogConfig
|
|||||||
class BlogPlugin(BasePlugin[BlogConfig]):
|
class BlogPlugin(BasePlugin[BlogConfig]):
|
||||||
supports_multiple_instances = True
|
supports_multiple_instances = True
|
||||||
|
|
||||||
|
# Initialize plugin
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
# Initialize variables for incremental builds
|
||||||
|
self.is_serve = False
|
||||||
|
self.is_dirtyreload = False
|
||||||
|
self.is_dirty = False
|
||||||
|
|
||||||
# Determine whether we're running under dirty reload
|
# Determine whether we're running under dirty reload
|
||||||
def on_startup(self, *, command, dirty):
|
def on_startup(self, *, command, dirty):
|
||||||
self.is_serve = (command == "serve")
|
self.is_serve = (command == "serve")
|
||||||
self.is_dirtyreload = False
|
|
||||||
self.is_dirty = dirty
|
self.is_dirty = dirty
|
||||||
|
|
||||||
# Initialize plugin
|
# Initialize plugin
|
||||||
|
@ -42,6 +42,13 @@ from material.plugins.info.config import InfoConfig
|
|||||||
# Info plugin
|
# Info plugin
|
||||||
class InfoPlugin(BasePlugin[InfoConfig]):
|
class InfoPlugin(BasePlugin[InfoConfig]):
|
||||||
|
|
||||||
|
# Initialize plugin
|
||||||
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
# Initialize variables for incremental builds
|
||||||
|
self.is_serve = False
|
||||||
|
|
||||||
# Determine whether we're serving
|
# Determine whether we're serving
|
||||||
def on_startup(self, *, command, dirty):
|
def on_startup(self, *, command, dirty):
|
||||||
self.is_serve = (command == "serve")
|
self.is_serve = (command == "serve")
|
||||||
|
@ -42,14 +42,20 @@ except ImportError:
|
|||||||
# Search plugin
|
# Search plugin
|
||||||
class SearchPlugin(BasePlugin[SearchConfig]):
|
class SearchPlugin(BasePlugin[SearchConfig]):
|
||||||
|
|
||||||
# Determine whether we're running under dirty reload
|
# Initialize plugin
|
||||||
def on_startup(self, *, command, dirty):
|
def __init__(self, *args, **kwargs):
|
||||||
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
|
# Initialize variables for incremental builds
|
||||||
self.is_dirtyreload = False
|
self.is_dirtyreload = False
|
||||||
self.is_dirty = dirty
|
|
||||||
|
|
||||||
# Initialize search index cache
|
# Initialize search index cache
|
||||||
self.search_index_prev = None
|
self.search_index_prev = None
|
||||||
|
|
||||||
|
# Determine whether we're serving
|
||||||
|
def on_startup(self, *, command, dirty):
|
||||||
|
self.is_dirty = dirty
|
||||||
|
|
||||||
# Initialize plugin
|
# Initialize plugin
|
||||||
def on_config(self, config):
|
def on_config(self, config):
|
||||||
if not self.config.lang:
|
if not self.config.lang:
|
||||||
|
Loading…
Reference in New Issue
Block a user