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
Comments
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. |
@jayswinney: But why would you want to hide the code if the purpose of the repo is to scale knowledge? |
@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. |
@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. |
Then I guess your issue is with Rmarkdown, not with the Knowledge Repo, if you set the chunk options as:
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. |
@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. |
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
The text was updated successfully, but these errors were encountered: