emphatic
emphatic copied to clipboard
General fixes
- [x] populate
HL_*options from the users environment at startup. - [x] Unmodifed strings in
hl_diffshould not be coloured at all and work in both light and dark modes. - [x] PIck good contrasting colours for hl_diff and hl_grep
- [x] Revisit knitr output and extend adapt for quarto output
- [x] Unify grep highlighting into single function
- [x] honour 'dark mode' setting in all default colouring
- [x] Revisit how options are set, read and adjusted. Global settings vs per object settings
- [x] bugfix
hl_difffor longer outputs e.g.hl_str_diff(head(mtcars), head(mtcars, 7)) - [x] Decide on what to support for release: Currently have
- [x] data.frames
- [x] ~~matrices~~
- [x] differences
- [x] regular expressions
- [x] Sanity check arguments to
hl_opts() - [x] Consider swapping arguments from (data, colour, selection) to (data, selection, colour)
- [x] Rendering SVG for a vignette for CRAN? Is it possible?
- [x] Replace all magrittr pipe with base R pipe
- [x] Unify terminology:
bg/fgvsfill/textI think I prefer fill/text - [x]
hl_diffandhl_grepshould auto-generate a contrasting colour if only 'fill' is given. - [x] Consider changing "colour" argument to "palette". This avoids name confusions with 'col' and 'dest_cols' argument. And also this variable should capture single colours as well colour scale objects.
- [x] Rename
colsanddest_colsto clarify their purposes/differences. - [x] Is dark mode now obsolete? Yes
- [x] Add option to
as_html()to include full DOCTYPE and html tags so it could be saved as a valid/complete html file. - [x] When rendering to github marked - coloured text is html wrapped in an SVG. But the HTML still needs to be escaped.
- [x] Need to htmlescape when using
as_html() - [x] Clone functionality of
htmltools::htmlescape. Pretty sure this is just a regex - [x] Will also need to escape rownames and column names. this will be rarer, but still possible.
- [x] Need to htmlescape when using
- [x] Default colours for
hl_grep()andhl_diff()should come from options/environment. - [x] When using a scale object as the palette. I think we can do away with the 'scale_mode' argument. If multiple columns are specified, then the scale is trained globally on all data. The
scale_mode = 'first'setting should probably be expanded such that the user does multiplehl()commands. Then usescale_apply()if you want the same colouring shown across multiple columns. - [x] ~~Expose ANSI colouring viewing and conversion functions? No~~
- [x] Remove 'underline_header' as an option
- [x] Refactor/Unify code for the backends. Move all the
escape_*()functions to their respectivecore-*.Rfiles. Maybe unify into a named list of functions and options so that I can remove some messy if/then logic inhl_inner()andhl_loc() - [x] Rethink default colours for
hl_diff()- should be less severe? andhl_grep()should beyellow? - [x] PDF/latex table rendering ist still a little askew. Difference between leading space and
\space definition? - [x] Add font size option to html, svg and latex output
- [x] ~~Can i roughly calculated SVG height?~~ No.
- [x] collapser for html should just be
<br/>. Because we're rendering in<pre>mode, any\nwill actually put spaces between the lines
Rendering backends
- [x] Full HTML document - with DOCTYPE and
htmltags - [x] Full SVG document
- [x] Latex support so that rendering to PDF works.
- [x] typst rendering
- [x] What's the best standard monospace font.
fontset toCourier New. Can be changed in call toas_typst() - [x] Hook up rendering with knitr/quarto by checking
pandoc_toor similar and callingas_typst(). done. - [x] Unpack the guts of
knitr::raw_block()to be part ofas_typst()to get output to render - [x] Using the raw block support. No need to escape anything but the backtick.
- [x] What's the best standard monospace font.
- [x] animated SVG
Before release
- [ ] Regenerate pkgdown site
- [ ] Do a pass over function docs
- [ ] Do a pass over function internal commenting
- [ ] Focus README on what's important
- [ ] Extend vignettes to cover new features e.g.
hl_diff()works on any object.
Cran stuff
- [ ] Rhub tests
- [ ] All functions must have an example
- [ ] All functions must have a return value
- [ ] Check on win-builder
- [ ] Check on mac-builder
- [ ] Update authors and copyright
Future?
- Word & Excel rendering
- HTML hover text
This should probably work for escaping HTML
html_replacement <- c(
`&` = "&",
`<` = "<",
`>` = ">",
`"` = """,
`'` = "'"
)
escape_html <- function(x) {
x <- enc2utf8(x)
for (orig in names(html_replacement)) {
x <- gsub(orig, html_replacement[[orig]], x, fixed = TRUE, useBytes = TRUE)
}
Encoding(x) <- 'UTF-8'
x
}