Skip to content

feat: add output language support for code blocks#25

Open
natrimmer wants to merge 1 commit into
simonw:mainfrom
natrimmer:output-block-lang
Open

feat: add output language support for code blocks#25
natrimmer wants to merge 1 commit into
simonw:mainfrom
natrimmer:output-block-lang

Conversation

@natrimmer
Copy link
Copy Markdown

Add --output-lang flag to exec command

When the output of a command is source code (e.g. cat main.go), the default output fence language doesn't give you syntax highlighting. This adds an optional --output-lang flag to exec that sets the fence language on the output block:

showboat exec demo.md bash --output-lang go "cat main.go"

produces:

```go
package main
...
```

instead of:

```output
package main
...
```

The default behavior is unchanged -- without the flag, output blocks still use output. The parser handles both formats, and extract round-trips the flag correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant