mirror of
https://github.com/openai/codex.git
synced 2026-05-01 01:47:18 +00:00
Also, simplify the streaming behavior. This fixes a number of display issues with streaming markdown, and paves the way for better markdown features (e.g. customizable styles, syntax highlighting, markdown-aware wrapping). Not currently supported: - footnotes - tables - reference-style links
16 lines
358 B
Rust
16 lines
358 B
Rust
use std::io::Read;
|
|
use std::io::{self};
|
|
|
|
fn main() {
|
|
let mut input = String::new();
|
|
if let Err(err) = io::stdin().read_to_string(&mut input) {
|
|
eprintln!("failed to read stdin: {err}");
|
|
std::process::exit(1);
|
|
}
|
|
|
|
let parser = pulldown_cmark::Parser::new(&input);
|
|
for event in parser {
|
|
println!("{event:?}");
|
|
}
|
|
}
|