File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343# Info plugin configuration scheme
4444class InfoPluginConfig (Config ):
4545 enabled = opt .Type (bool , default = True )
46+ enabled_on_serve = opt .Type (bool , default = False )
4647
4748 # Options for archive
4849 archive = opt .Type (bool , default = True )
@@ -54,6 +55,17 @@ class InfoPluginConfig(Config):
5455# Info plugin
5556class InfoPlugin (BasePlugin [InfoPluginConfig ]):
5657
58+ # Determine whether we're serving
59+ def on_startup (self , * , command , dirty ):
60+ if not self .config .enabled :
61+ return
62+
63+ # By default, the plugin is disabled when the documentation is served,
64+ # but not when it is built. This should nicely align with the expected
65+ # user experience when creating reproductions.
66+ if not self .config .enabled_on_serve :
67+ self .config .enabled = command != "serve"
68+
5769 # Initialize plugin (run earliest)
5870 @event_priority (100 )
5971 def on_config (self , config ):
Original file line number Diff line number Diff line change 4343# Info plugin configuration scheme
4444class InfoPluginConfig (Config ):
4545 enabled = opt .Type (bool , default = True )
46+ enabled_on_serve = opt .Type (bool , default = False )
4647
4748 # Options for archive
4849 archive = opt .Type (bool , default = True )
@@ -54,6 +55,17 @@ class InfoPluginConfig(Config):
5455# Info plugin
5556class InfoPlugin (BasePlugin [InfoPluginConfig ]):
5657
58+ # Determine whether we're serving
59+ def on_startup (self , * , command , dirty ):
60+ if not self .config .enabled :
61+ return
62+
63+ # By default, the plugin is disabled when the documentation is served,
64+ # but not when it is built. This should nicely align with the expected
65+ # user experience when creating reproductions.
66+ if not self .config .enabled_on_serve :
67+ self .config .enabled = command != "serve"
68+
5769 # Initialize plugin (run earliest)
5870 @event_priority (100 )
5971 def on_config (self , config ):
You can’t perform that action at this time.
0 commit comments