Skip to content

Commit

Permalink
added --dump
Browse files Browse the repository at this point in the history
  • Loading branch information
TomLebeda committed Sep 27, 2024
1 parent 08b83a6 commit bc03b96
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
.vimproject
sample_latex_project
builder_script.sh
test.html
7 changes: 7 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ pub struct CliArgs {
#[arg(short, long)]
pub verbose: bool,

/// Print the final text also into stdout
#[arg(short, long)]
pub dump: bool,

/// Escape double quotes `"` as `\dq{}` for users of babel with [ngerman]
#[arg(short, long)]
pub german: bool,
Expand Down Expand Up @@ -183,6 +187,9 @@ fn main() {
}
let highlighted_text_pieces = extract_highlighted_pieces(out.stdout, &conf);
let generated_latex = generate_latex_verbatim(highlighted_text_pieces, &conf);
if conf.dump {
println!("{}", generated_latex);
}
if let Err(write_err) = std::fs::write(output_file, generated_latex) {
println!(
"Sorry, there was error while trying to write the output file: {}",
Expand Down

0 comments on commit bc03b96

Please sign in to comment.