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

Support automatic code folding/hiding in knowledge posts #118

Closed
jayswinney opened this issue Nov 4, 2016 · 6 comments
Closed

Support automatic code folding/hiding in knowledge posts #118

jayswinney opened this issue Nov 4, 2016 · 6 comments
Milestone

Comments

@jayswinney
Copy link

Auto-reviewers: @NiharikaRay @matthewwardrop @earthmancash @danfrankj
Is there an option to hide the code in knowledge post somewhere? It's mentioned in the article on medium, but I can't find any sign of it.

"The markdown served by our web-app hides code and uses our internal branded aesthetics, making the work more accessible to less technical readers."

knowledge-repo 0.6.10
python 3.5
Ubuntu 16.04

@earthmancash
Copy link
Collaborator

Hey Jay! I actually misstated in the medium article. The code-hiding happens in the notebook and its postprocessing, not the webapp. Rmd files have an option to hide the code chunks, and we strip the output cells in ipython notebooks. We've talked about building out more of a "code folding" concept but haven't found much demand so far.

@kaelhuerta
Copy link

@jayswinney: But why would you want to hide the code if the purpose of the repo is to scale knowledge?

@mwillumz
Copy link

mwillumz commented Nov 5, 2016

@kaelhuerta 9 times out of 10 I want the insight via tables, charts, and narrative. Displaying code can actually be distracting. The tenth time I want to replicate, modify, or really understand the analysis (so I expand the folded code with one click in rmd output).

It's there, just not in the forefront.

@jayswinney
Copy link
Author

@kaelhuerta I want to hide the code so the post is not intimidating to non-coders. Also it makes the post shorter and easier to read. I would envision having a hide/show code toggle as the best solution with the default set to hide.

@kaelhuerta
Copy link

Then I guess your issue is with Rmarkdown, not with the Knowledge Repo, if you set the chunk options as:

{r, echo = F}

The code gets evaluated, and the results shown. Yet, the code does not appear in the post until you toggle to show the raw file.

@RMHogervorst
Copy link
Contributor

@kaelhuerta although echo = F works, the canonical way of doing it is : echo = FALSE. (nitpicking here, but it makes the intention more clear) .

@jayswinney There is also a parameterized way of building the rmarkdown posts. That way you can build 2 versions of the same post, one with code, and one without. Not sure how to make that useful in this context though.

@matthewwardrop matthewwardrop added this to the v0.8.0 milestone Nov 8, 2016
@matthewwardrop matthewwardrop changed the title hiding code in knowledge post? Support automatic code folding/hiding in knowledge posts Nov 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants