terror / terror/present

Add support for language-specific formatting

Open
#28 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
112
Forks
2
Avg merge
2h 52m
Merged PRs (30d)
13

Description

If a language tag is present, we currently won't end up doing anything, i.e this test will fail:

#[test]
fn language_specific_formatting() -> Result {
  Test::new()?
    .markdown(
      r#"
      ```rust present echo "fn main() { println!(\"Hello, World!\"); }"
      ```
      "#,
    )
    .expected_status(0)
    .expected_stdout(
      r#"
      ```rust present echo "fn main() { println!(\"Hello, World!\"); }"
      fn main() { println!("Hello, World!"); }
      ```
      "#,
    )
    .run()
}

We can make it pass by looking for a subset of keywords as language tags, and then doing the entire parse -> command interpolation flow.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the language_specific_formatting test shown in the issue and run it to confirm the current failure. Trace the markdown parsing and command interpolation flow, then make recognized language tags follow the full parse-to-interpolation path; done means the test passes with the expected formatted output.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.