pub struct Markdown { /* private fields */ }Implementations§
Source§impl Markdown
impl Markdown
Sourcepub fn parse(text: &str) -> Self
pub fn parse(text: &str) -> Self
Examples found in repository?
More examples
examples/streaming.rs (lines 7-25)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7 let mut md = Markdown::parse(
8 "## Build Pipeline\n\n\
9 | Task | Status | Details |\n\
10 |---------|---------|---------------------------------|\n\
11 | build | pending | |\n\
12 | test | pending | |\n\
13 | deploy | pending | |\n\
14 \n\
15 _Live streaming table update demo_\n\n\
16 \n\
17 ### Task Status\n\n\
18 - [x] Compile source\n\
19 - [x] Run unit tests\n\
20 - [ ] Integration tests\n\
21 - [ ] Deploy to staging\n\
22 \n\
23 See the pipeline logs or visit <https://ci.example.com>\n\
24 for detailed build output.\n"
25 );
26
27 println!("\nStreaming Markdown Demo\n-----------------------\n");
28 md.render();
29 io::stdout().flush()?;
30 thread::sleep(Duration::from_millis(800));
31
32 md.append_to_cell(0, 2, "compiling source");
33 md.render();
34 io::stdout().flush()?;
35 thread::sleep(Duration::from_millis(800));
36
37 md.append_to_cell(0, 2, " files...");
38 md.render();
39 io::stdout().flush()?;
40 thread::sleep(Duration::from_millis(800));
41
42 md.append_to_cell(1, 2, "running unit tests across all crates");
43 md.render();
44 io::stdout().flush()?;
45 thread::sleep(Duration::from_millis(800));
46
47 md.set_cell_content(0, 1, "done");
48 md.render();
49 io::stdout().flush()?;
50 thread::sleep(Duration::from_millis(800));
51
52 md.set_cell_content(1, 1, "running");
53 md.append_to_cell(1, 2, " with coverage instrumentation enabled for llvm-cov");
54 md.render();
55 io::stdout().flush()?;
56 thread::sleep(Duration::from_millis(1200));
57
58 md.set_cell_content(2, 1, "queued");
59 md.append_to_cell(0, 2, " and linking final binary artifact");
60 md.render();
61 io::stdout().flush()?;
62 thread::sleep(Duration::from_millis(800));
63
64 md.set_cell_content(2, 1, "done");
65 md.set_cell_content(2, 2, "release published to registry");
66 md.render();
67 io::stdout().flush()?;
68 thread::sleep(Duration::from_millis(800));
69
70 println!();
71
72 Ok(())
73}pub fn theme_mode(self, mode: ThemeMode) -> Self
pub fn code_theme(self, theme: &str) -> Self
pub fn has_terminal_resized(&self) -> bool
Sourcepub fn append_to_cell(&mut self, row: usize, col: usize, text: &str)
pub fn append_to_cell(&mut self, row: usize, col: usize, text: &str)
Examples found in repository?
examples/streaming.rs (line 32)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7 let mut md = Markdown::parse(
8 "## Build Pipeline\n\n\
9 | Task | Status | Details |\n\
10 |---------|---------|---------------------------------|\n\
11 | build | pending | |\n\
12 | test | pending | |\n\
13 | deploy | pending | |\n\
14 \n\
15 _Live streaming table update demo_\n\n\
16 \n\
17 ### Task Status\n\n\
18 - [x] Compile source\n\
19 - [x] Run unit tests\n\
20 - [ ] Integration tests\n\
21 - [ ] Deploy to staging\n\
22 \n\
23 See the pipeline logs or visit <https://ci.example.com>\n\
24 for detailed build output.\n"
25 );
26
27 println!("\nStreaming Markdown Demo\n-----------------------\n");
28 md.render();
29 io::stdout().flush()?;
30 thread::sleep(Duration::from_millis(800));
31
32 md.append_to_cell(0, 2, "compiling source");
33 md.render();
34 io::stdout().flush()?;
35 thread::sleep(Duration::from_millis(800));
36
37 md.append_to_cell(0, 2, " files...");
38 md.render();
39 io::stdout().flush()?;
40 thread::sleep(Duration::from_millis(800));
41
42 md.append_to_cell(1, 2, "running unit tests across all crates");
43 md.render();
44 io::stdout().flush()?;
45 thread::sleep(Duration::from_millis(800));
46
47 md.set_cell_content(0, 1, "done");
48 md.render();
49 io::stdout().flush()?;
50 thread::sleep(Duration::from_millis(800));
51
52 md.set_cell_content(1, 1, "running");
53 md.append_to_cell(1, 2, " with coverage instrumentation enabled for llvm-cov");
54 md.render();
55 io::stdout().flush()?;
56 thread::sleep(Duration::from_millis(1200));
57
58 md.set_cell_content(2, 1, "queued");
59 md.append_to_cell(0, 2, " and linking final binary artifact");
60 md.render();
61 io::stdout().flush()?;
62 thread::sleep(Duration::from_millis(800));
63
64 md.set_cell_content(2, 1, "done");
65 md.set_cell_content(2, 2, "release published to registry");
66 md.render();
67 io::stdout().flush()?;
68 thread::sleep(Duration::from_millis(800));
69
70 println!();
71
72 Ok(())
73}Sourcepub fn set_cell_content(&mut self, row: usize, col: usize, text: &str)
pub fn set_cell_content(&mut self, row: usize, col: usize, text: &str)
Examples found in repository?
examples/streaming.rs (line 47)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7 let mut md = Markdown::parse(
8 "## Build Pipeline\n\n\
9 | Task | Status | Details |\n\
10 |---------|---------|---------------------------------|\n\
11 | build | pending | |\n\
12 | test | pending | |\n\
13 | deploy | pending | |\n\
14 \n\
15 _Live streaming table update demo_\n\n\
16 \n\
17 ### Task Status\n\n\
18 - [x] Compile source\n\
19 - [x] Run unit tests\n\
20 - [ ] Integration tests\n\
21 - [ ] Deploy to staging\n\
22 \n\
23 See the pipeline logs or visit <https://ci.example.com>\n\
24 for detailed build output.\n"
25 );
26
27 println!("\nStreaming Markdown Demo\n-----------------------\n");
28 md.render();
29 io::stdout().flush()?;
30 thread::sleep(Duration::from_millis(800));
31
32 md.append_to_cell(0, 2, "compiling source");
33 md.render();
34 io::stdout().flush()?;
35 thread::sleep(Duration::from_millis(800));
36
37 md.append_to_cell(0, 2, " files...");
38 md.render();
39 io::stdout().flush()?;
40 thread::sleep(Duration::from_millis(800));
41
42 md.append_to_cell(1, 2, "running unit tests across all crates");
43 md.render();
44 io::stdout().flush()?;
45 thread::sleep(Duration::from_millis(800));
46
47 md.set_cell_content(0, 1, "done");
48 md.render();
49 io::stdout().flush()?;
50 thread::sleep(Duration::from_millis(800));
51
52 md.set_cell_content(1, 1, "running");
53 md.append_to_cell(1, 2, " with coverage instrumentation enabled for llvm-cov");
54 md.render();
55 io::stdout().flush()?;
56 thread::sleep(Duration::from_millis(1200));
57
58 md.set_cell_content(2, 1, "queued");
59 md.append_to_cell(0, 2, " and linking final binary artifact");
60 md.render();
61 io::stdout().flush()?;
62 thread::sleep(Duration::from_millis(800));
63
64 md.set_cell_content(2, 1, "done");
65 md.set_cell_content(2, 2, "release published to registry");
66 md.render();
67 io::stdout().flush()?;
68 thread::sleep(Duration::from_millis(800));
69
70 println!();
71
72 Ok(())
73}Sourcepub fn render(&mut self)
pub fn render(&mut self)
Examples found in repository?
More examples
examples/streaming.rs (line 28)
6fn main() -> Result<(), Box<dyn std::error::Error>> {
7 let mut md = Markdown::parse(
8 "## Build Pipeline\n\n\
9 | Task | Status | Details |\n\
10 |---------|---------|---------------------------------|\n\
11 | build | pending | |\n\
12 | test | pending | |\n\
13 | deploy | pending | |\n\
14 \n\
15 _Live streaming table update demo_\n\n\
16 \n\
17 ### Task Status\n\n\
18 - [x] Compile source\n\
19 - [x] Run unit tests\n\
20 - [ ] Integration tests\n\
21 - [ ] Deploy to staging\n\
22 \n\
23 See the pipeline logs or visit <https://ci.example.com>\n\
24 for detailed build output.\n"
25 );
26
27 println!("\nStreaming Markdown Demo\n-----------------------\n");
28 md.render();
29 io::stdout().flush()?;
30 thread::sleep(Duration::from_millis(800));
31
32 md.append_to_cell(0, 2, "compiling source");
33 md.render();
34 io::stdout().flush()?;
35 thread::sleep(Duration::from_millis(800));
36
37 md.append_to_cell(0, 2, " files...");
38 md.render();
39 io::stdout().flush()?;
40 thread::sleep(Duration::from_millis(800));
41
42 md.append_to_cell(1, 2, "running unit tests across all crates");
43 md.render();
44 io::stdout().flush()?;
45 thread::sleep(Duration::from_millis(800));
46
47 md.set_cell_content(0, 1, "done");
48 md.render();
49 io::stdout().flush()?;
50 thread::sleep(Duration::from_millis(800));
51
52 md.set_cell_content(1, 1, "running");
53 md.append_to_cell(1, 2, " with coverage instrumentation enabled for llvm-cov");
54 md.render();
55 io::stdout().flush()?;
56 thread::sleep(Duration::from_millis(1200));
57
58 md.set_cell_content(2, 1, "queued");
59 md.append_to_cell(0, 2, " and linking final binary artifact");
60 md.render();
61 io::stdout().flush()?;
62 thread::sleep(Duration::from_millis(800));
63
64 md.set_cell_content(2, 1, "done");
65 md.set_cell_content(2, 2, "release published to registry");
66 md.render();
67 io::stdout().flush()?;
68 thread::sleep(Duration::from_millis(800));
69
70 println!();
71
72 Ok(())
73}Auto Trait Implementations§
impl Freeze for Markdown
impl RefUnwindSafe for Markdown
impl Send for Markdown
impl Sync for Markdown
impl Unpin for Markdown
impl UnsafeUnpin for Markdown
impl UnwindSafe for Markdown
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more