brad-cannell/codebookr

Stylize the Description

Opened this issue · 1 comments

Overview

Working on the L2C codebook, I wanted to stylize the description a little bit. For example, I wanted to add some bolded headers. Off the top of my head, I'm not sure that this is possible. I want to play around with it a little bit. If I do get it to work, I should probably add it to the README or a vignette.

Notes on stylizing with officer

Just passing formatted officer paragraphs to the description argument of the codebook() function doesn't work. This is because the description argument is just looking for a character vector.

  • If the description argument isn't missing, then it passes the value to cb_add_description.
  • That function is only set up to handle character strings.

Solution options:

  • Use officer to add post hoc styling.
  • Update cb_add_description to accept officer code.

Tasks

  • Figure out how to do post hoc styling.
  • Figure out why the codebook title and subtitle appear at the end of the codebook now.
  • Create a vignette or add to README.
  • Update cb_add_description to accept officer code.
  • Update vignette and/or README.

2024-02-15

  • Created a branch iss-51-style-description with a file called test.qmd that starts working on solutions.
  • I have some good examples of making post hoc styling changes. I am going to use this for my immediate need -- updating the L2C codebook.
  • When I have more time, I'd like to come back and update cb_add_description to accept officer code.
  • But, now this weird thing is happening where the codebook title and subtitle appear at the end of the codebook. I'm not sure why. (#52)
  • I think I fixed #52, but I ran out of time to work on the codebook. When you get time, come back and finish figuring out the post hoc styling (switch to the iss-51-style-description branch). Specifically, you were about to add bullets for "sections" that each study question came from. For example, "administrative" and "sociodemographic".