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

Improve implementation of all vec_*() functions #995

Merged
merged 57 commits into from
Aug 5, 2022

Conversation

rich-iannone
Copy link
Member

@rich-iannone rich-iannone commented Aug 2, 2022

The vec_*() series of functions is useful for creating formatted values from vectors (totally independent of using tables, which is great for formatting values in an R Markdown or Quarto doc). Here, we include a "plain" output option. It can use Unicode characters and is suitable for printing in the R console. We also now have an "auto" output option (the default) which will determine the output context (e.g., Quarto rendering a PDF document) and choose the output, defaulting to "plain" in the interactive case.

This PR also continues the work on using preferring the use of Unicode characters instead of HTML entities to represent certain non-ASCII characters (e.g., multiplication sign, minus sign, etc.).

The use of CSS classes in formatted values was limited since the classes used are inaccessible outside of a table context. For example, when using vec_fmt_scientific() with a vector of numeric values, a class would be present in the output and it likely wouldn't be available when embedding the output values in an HTML document. This is solved by inlining CSS styles to the relevant style attribute.

@rich-iannone rich-iannone changed the title Remove html entities in context-based marks Improve implementation of all vec_*() functions Aug 3, 2022
@rich-iannone rich-iannone marked this pull request as ready for review August 4, 2022 20:59
@rich-iannone rich-iannone requested a review from cscheid August 4, 2022 21:00
Copy link
Member

@cscheid cscheid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rich-iannone rich-iannone merged commit 165c6d0 into master Aug 5, 2022
@rich-iannone rich-iannone deleted the remove-html-entities branch August 5, 2022 17:40
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.

2 participants