ratatui_toolkit/widgets/markdown_widget/widget/constructors/
show_toc.rs

1//! Enable or disable the TOC (Table of Contents).
2
3use crate::widgets::markdown_widget::widget::MarkdownWidget;
4
5impl<'a> MarkdownWidget<'a> {
6    /// Enable or disable the TOC (Table of Contents).
7    ///
8    /// When enabled, shows heading navigation in the top-right corner.
9    /// Compact mode shows lines, expanded mode (on hover) shows text.
10    ///
11    /// # Arguments
12    ///
13    /// * `show` - Whether to show the TOC
14    ///
15    /// # Returns
16    ///
17    /// Self for method chaining.
18    pub fn show_toc(mut self, show: bool) -> Self {
19        self.show_toc = show;
20        self
21    }
22}