ukgovdatascience / govdown

GOV.UK Design System theme for R Markdown
https://ukgovdatascience.github.io/govdown/
Other
46 stars 5 forks source link

Support encrypted HTML #28

Closed nacnudus closed 4 years ago

nacnudus commented 5 years ago

https://github.com/dirkschumacher/encryptedRmd

It would be something like this:

encrypted_html_document <- function(...) {
  format <- rmarkdown::html_document(...)
  initial_post_process <- format$post_processor
  format$post_processor <- function(metadata, input_file, output_file, clean, verbose) {
    on.exit(encrypt_html_file(path = output_file, message_key = FALSE, write_key_file = TRUE))
    initial_post_process(metadata, input_file, output_file, clean, verbose)
  }
  format
}
nacnudus commented 5 years ago

See the branch: https://github.com/ukgovdatascience/govdown/tree/encryption And an issue for custom decryption pages: https://github.com/dirkschumacher/encryptedRmd/issues/2

nacnudus commented 5 years ago

Upstream now supports decryption page templates https://github.com/derhuerst/self-decrypting-html-page#self-decrypting-html-page

nacnudus commented 4 years ago

I've investigated again, and the templates are only templates to a certain extent. The phrase "The key seems to be wrong." is embedded in javascript, and I can't see a way to style the error message correctly according to the GOV.UK Design System and accessibility guidelines. Closing this issue until/unless something better happens.