diff options
| author | sigoden <sigoden@gmail.com> | 2023-03-07 11:38:44 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-07 11:38:44 +0800 |
| commit | 1640456049cda9999bb27501af30e05e46b0360d (patch) | |
| tree | 8cc1ad88bd233a5898bff0520fd933db41f1e0da /src/main.rs | |
| parent | c12ae0275108acbbb124a41ff936b441723ae625 (diff) | |
| download | aichat-1640456049cda9999bb27501af30e05e46b0360d.tar.gz | |
refactor: use syntect for highlight, abandon mdcat (#26)
* refactor: use syntect for highlight, abandon mdcat
* split src/render.rs to sub modules. embed a default theme
* simulate typing effect.
* fix format
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 5cb94f5..8f7b1a2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -68,8 +68,8 @@ fn start_directive(client: ChatGptClient, config: SharedConfig, input: &str) -> let output = client.send_message(input, prompt)?; let output = output.trim(); if config.borrow().highlight && stdout().is_terminal() { - let markdown_render = MarkdownRender::init()?; - markdown_render.print(output)?; + let mut markdown_render = MarkdownRender::new(); + markdown_render.render(output); } else { println!("{output}"); } |
