Open daaronr opened 3 years ago
@oskasf This is now a pretty high priority, but more in terms of a 'Profusion Data Academy spinoff'. I got some feedback on the presentation of that bookdown, and I'll start that as a new issue.
@oskasf Can you check out and help out a bit with the formatting and building in 'metrics_notes'?
@oskasf Turned the above list into tick-boxed we can check when done
Maybe each of these should be a separate issue but they tend to be interconnected
Added: - [ ] Make 'hide code' the default ... have the button say 'show code'
In most cases people seeing these will prefer 'no code' and be overwhelmed by code, and may not even realise they can hide it
The button looks good, but code is hidden and pushing the button doesn't do anything @oskasf. Perhaps its something to do with other settings I have in the project? Can you try to see if you can get it working in one of the actual projects?
I had this working in metrics_discussion yesterday. Which project are you trying it with?
Was working in a (private Repo) Rethink Priorities project. Now its working for me for the Metrics bookdown, at least, so I'll look for differences between the two projects, thanks!
@oskasf in metrics_discussion_work, I think some of the things in the index file are also done in project_setup.R
. Could you check for and remove duplication when you get a chance?
OK @oskasf the 'hide code by default' is [correction 'now'] working in that bookdown. It was the line
knitr::opts_chunk$set(echo = FALSE, warning= FALSE)
that was messing it up (that hides all code, not even allowing any folding)
@daaronr I only saw one particular chunk of code which was duplicated in metrics_discussion, have removed this now.
Does removing that line fix the code hiding or is it still broken?
Sorry, my previous message had an error. It now IS working :)
Wait, it is now showing code by default in the Bookdowns I've been working on. @oskasf can you point me to the code line that determines this?
@daaronr So the approach is a bit involved. I followed the advice here and incorporated this into bookdown_template/support/header.html This does look quite involved however it was seemingly the only way to do this (much easier to show all by default and then hide than the other way around).
It's still seems to be showing, not hiding code by default and I'm using the latest header. Is it doing the same for you @oskasf ?
[x] Centralise process for bookdowns; make them uniform except where warranted otherwise
[ ] Fonts, alignment, spacing etc (continuous improvement)
[ ] colored display blocks (e.g., '
{block2, type='warning'}
) -- add small images/signposts (e.g., a stop sign)[ ] hand-coded tables: larger font
[ ] change label 'unfold' to label 'answer' for some relevant boxes
[x] Make 'hide code' the default ... have the button say 'show code'