pub struct Config {
pub auto_reload: bool,
pub debounce_ms: u32,
pub image_viewer: Option<String>,
pub plot_viewer: Option<String>,
pub show_timings: bool,
pub clear_on_run: bool,
}Expand description
Configuration options for a cellbook.
Pass to the cellbook!() macro to customize behavior:
// Using struct literal
cellbook!(Config {
auto_reload: false,
..Default::default()
});
// Using builder methods
cellbook!(Config::default()
.auto_reload(false)
.image_viewer("feh"));
// Using defaults
cellbook!();Fields§
§auto_reload: boolWatch for file changes and rebuild automatically.
Default: true
debounce_ms: u32Debounce delay for file watcher in milliseconds.
Default: 500
image_viewer: Option<String>External command to view images (e.g., “feh”, “open”, “xdg-open”).
If None, uses platform default.
plot_viewer: Option<String>External command to view plots.
If None, uses image_viewer or platform default.
show_timings: boolShow timing information for cell execution.
Default: false
clear_on_run: boolClear output between cell runs.
Default: false
Implementations§
Source§impl Config
impl Config
Sourcepub fn auto_reload(self, enabled: bool) -> Self
pub fn auto_reload(self, enabled: bool) -> Self
Enable or disable auto-reload on file changes.
Sourcepub fn debounce_ms(self, ms: u32) -> Self
pub fn debounce_ms(self, ms: u32) -> Self
Set the debounce delay for file watching.
Sourcepub fn image_viewer(self, cmd: impl Into<String>) -> Self
pub fn image_viewer(self, cmd: impl Into<String>) -> Self
Set the external image viewer command.
Sourcepub fn plot_viewer(self, cmd: impl Into<String>) -> Self
pub fn plot_viewer(self, cmd: impl Into<String>) -> Self
Set the external plot viewer command.
Sourcepub fn show_timings(self, enabled: bool) -> Self
pub fn show_timings(self, enabled: bool) -> Self
Enable or disable timing display for cell execution.
Sourcepub fn clear_on_run(self, enabled: bool) -> Self
pub fn clear_on_run(self, enabled: bool) -> Self
Enable or disable clearing output between runs.