jacobbien/litr-project

Display of chunks that are embedded within a chunk

jacobbien opened this issue · 0 comments

knitr allows code chunks to be nested within each other, as explained here. However, when the file is knitted, the output one sees does not show the label of the code chunk but instead replaces it with the actual code. Compare this to how literate programming output is displayed in Knuth's literate programming paper. In the context of litr, it seems we'd like to see the label of the inner code chunk rather than the code of the inner code chunk. If a Rmd file has nested code chunks, we'd like the following behavior:

  1. The actual code that is run should still behave exactly as it does normally in knitr.
  2. If a code chunk has something of the form <<inner-chunk>> within it, we should see <<inner-chunk>> with a hyperlink. The hyperlink would take you to the code chunk with label "inner-chunk". It would also be nice for that code chunk to have its label visible (perhaps in small letters and in parentheses in a way that it is not mistaken for the code itself).