Skip to content
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

Initial Support for More Quarto-like Cell Options #117

Closed
coatless opened this issue Dec 8, 2023 · 1 comment · Fixed by #143
Closed

Initial Support for More Quarto-like Cell Options #117

coatless opened this issue Dec 8, 2023 · 1 comment · Fixed by #143
Labels
p: medium Address issue before the next release if possible t: feature-request Request the addition of a new feature
Milestone

Comments

@coatless
Copy link
Owner

coatless commented Dec 8, 2023

From the Quarto Code Cell: Knitr documentation, there are quite a few different options to support on a per-cell basis. The following lays out what I think would be a good set of initial options to support for a more R like Quarto experience in the browser.

If I'm missing something from here, please feel free to comment below.

Attributes

The attributes portion will likely be useful for allowing custom CSS classes to be applied to the code cell.

We're also interested in having a label being available. Though, we're probably not going to want to override our initial ID structure.

Option Description
label Unique label for code cell. Used when other code needs to refer to the cell
classes Classes to apply to cell container

Code Evaluation

This is probably a stretch for now outside of mapping echo: false over to context: output.

Option Description
eval Evaluate code cells (if false just echos the code into output).
`` true (default): evaluate code cell
`` false: don’t evaluate code cell
`` [...]: A list of positive or negative line numbers to selectively include or exclude lines (explicit inclusion/excusion of lines is available only when using the knitr engine)
echo Include cell source code in rendered output.
`` true (default): include source code in output
`` false: do not include source code in output
`` fenced: in addition to echoing, include the cell delimiter as part of the output.
`` [...]: A list of positive or negative line numbers to selectively include or exclude lines (explicit inclusion/excusion of lines is available only when using the knitr engine)

Cell Output

Differentiating the cell output will be tricky as we do not track conditions (captureConditions: false) when using captureR.

With that in mind, we already have a request in #104, and in #115 we had an attempt to escape HTML entities with output:

Option Description
output Include the results of executing the code in the output. Possible values:
`` true: Include results.
`` false: Do not include results.
`` asis: Treat output as raw markdown with no enclosing containers.
warning Include warnings in rendered output.
error Include errors in the output (note that this implies that errors executing code will not halt processing of the document).
message Include messages in rendered output.

Figures

Initial support should likely make available the existing width and height variables

Option Description
fig-width Default width for figures
fig-height Default height for figures
@coatless coatless added t: feature-request Request the addition of a new feature p: medium Address issue before the next release if possible labels Dec 8, 2023
@coatless coatless added this to the 4.0 milestone Dec 8, 2023
This was referenced Jan 30, 2024
@coatless
Copy link
Owner Author

Skipped implementing echo/eval and error.

Added label, classes, fig-cap, out-width, out-height, and dpi.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p: medium Address issue before the next release if possible t: feature-request Request the addition of a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant