File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 43
43
# Info plugin configuration scheme
44
44
class InfoPluginConfig (Config ):
45
45
enabled = opt .Type (bool , default = True )
46
+ enabled_on_serve = opt .Type (bool , default = False )
46
47
47
48
# Options for archive
48
49
archive = opt .Type (bool , default = True )
@@ -54,6 +55,17 @@ class InfoPluginConfig(Config):
54
55
# Info plugin
55
56
class InfoPlugin (BasePlugin [InfoPluginConfig ]):
56
57
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
+
57
69
# Initialize plugin (run earliest)
58
70
@event_priority (100 )
59
71
def on_config (self , config ):
Original file line number Diff line number Diff line change 43
43
# Info plugin configuration scheme
44
44
class InfoPluginConfig (Config ):
45
45
enabled = opt .Type (bool , default = True )
46
+ enabled_on_serve = opt .Type (bool , default = False )
46
47
47
48
# Options for archive
48
49
archive = opt .Type (bool , default = True )
@@ -54,6 +55,17 @@ class InfoPluginConfig(Config):
54
55
# Info plugin
55
56
class InfoPlugin (BasePlugin [InfoPluginConfig ]):
56
57
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
+
57
69
# Initialize plugin (run earliest)
58
70
@event_priority (100 )
59
71
def on_config (self , config ):
You can’t perform that action at this time.
0 commit comments