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

provide some markdownish string formatting #107

Closed
JanMarvin opened this issue Mar 26, 2022 · 1 comment
Closed

provide some markdownish string formatting #107

JanMarvin opened this issue Mar 26, 2022 · 1 comment
Labels
enhancement 😀 New feature or request styles 🎨
Milestone

Comments

@JanMarvin
Copy link
Owner

We could provide some interface to format strings. For example:

# for this example I just needed a file that already has inlinestrings
xlsxFile <- system.file("extdata", "inline_str.xlsx", package = "openxlsx2")
wb2 <- loadWorkbook(xlsxFile)
cc <- wb2$worksheets[[1]]$sheet_data$cc

# formatted strings (inline or shared) look like this:
# si/is + r node:
# rPr node defining the style used
# t node for the text
# rPr and t can repeat
# closing r + si/is
cc$is[1] <- paste0("<is><r><rPr><b/><i/><u/></rPr><t>PairedIndex</t></r><r><rPr><b/><i/><u/><sz val=\"11\"/><color theme=\"4\"/><rFont val=\"Calibri\"/><family val=\"2\"/><scheme val=\"minor\"/></rPr><t xml:space=\"preserve\"> text.</t></r></is>")

wb2$worksheets[[1]]$sheet_data$cc <- cc

wb_open(wb2)   

Certain features such as new line foo\nbar require the iirc column attribute wrap to be true.

@JanMarvin JanMarvin added enhancement 😀 New feature or request styles 🎨 labels Mar 26, 2022
@JanMarvin JanMarvin added this to the future milestone Mar 26, 2022
@JanMarvin
Copy link
Owner Author

wrap text is in cellstyle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 😀 New feature or request styles 🎨
Projects
None yet
Development

No branches or pull requests

1 participant