-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: override stdout code block language #61
Comments
More customization for stdout formatting could be good. The current syntax could probably be extended to support something like Do you anticipate any situations where a single code block will produce stdout in multiple formats? I've been working on new features that could make that possible. I'm currently finishing the next version of Codebraid Preview, which will bring scroll sync for all Markdown variants, not just
|
Thanks for the trick! Using I don't anticipate a situation where a single block would produce multiple stdout formats. |
I have a code block that looks like this:
The
my-command-that-produces-json-stdout
is a command that produces json stdout. This example uses json, but it applies to any other output format.When the code block stdout is rendered in Pandoc, I want it to be rendered with json syntax highlighting, i.e. as a json code block.
Somehow I would need to inform the codebraid bash code block that a stdout JSON code block should be rendered.
Maybe the
rich_format
option can be used, e.g.rich_format:json
or some other option can be introduced. Ideally, all of the languages that appear inpandoc --list-highlight-languages
should be supported.Another option could be to add a new keyword that is understood by codebraid, e.g. cb-bash-runner, that codebraid will prefer if it exists. If codebraid sees this annotation in the code block header, then it will prefer this as the code runner, and then regular pandoc syntax can be used. The following example indicates that the body of the code block should be rendered as json (something that pandoc does), and that codebraid should execute the body using bash, and then replace the body with the stdout:
The text was updated successfully, but these errors were encountered: