use crate::widgets::markdown_widget::extensions::toc::enums::{TocConfig, TocStyle};
use crate::widgets::markdown_widget::extensions::toc::Toc;
use crate::widgets::markdown_widget::state::toc_state::TocState;
impl<'a> Toc<'a> {
pub fn new(toc_state: &'a TocState) -> Self {
Self {
toc_state,
config: TocConfig::default(),
expanded: false,
}
}
pub fn expanded(mut self, expanded: bool) -> Self {
self.expanded = expanded;
self
}
pub fn style(mut self, style: TocStyle) -> Self {
self.config.style = style;
self
}
pub fn config(mut self, config: TocConfig) -> Self {
self.config = config;
self
}
}