-
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Include shortcode is to include child Quarto document. For actual code, via Meaning, there is no native way to include only part of a file, unless you write a hacky code cell using the knitr In my opinion, if you only want a subset of a Quarto document A (not code) into document B, I suggest you put this subset in _C, and include it in both A and B. |
Beta Was this translation helpful? Give feedback.
-
Just an idea for a workaround: put a link to the source on GitHub, if the code is there, such as https://github.com/fuhrmanator/pandoc-filter-fr-nbsp/blob/main/fr-nbsp.lua#L37-L40 -- that's I don't think you can display the GitHub view the same way in the book, but maybe you can put a live link (as above) and put a screen shot in the book? It's probably best to reference the code at a specific commit since the latest version might change. |
Beta Was this translation helpful? Give feedback.
-
FWIW, I was able to do this with
It shows lines 20 to 39 of the script file in the output, as expected. |
Beta Was this translation helpful? Give feedback.
Include shortcode is to include child Quarto document.
For actual code, via
knitr
at least you can use https://quarto.org/docs/reference/cells/cells-knitr.html#include.Meaning, there is no native way to include only part of a file, unless you write a hacky code cell using the knitr
code
option to include your contents.In my opinion, if you only want a subset of a Quarto document A (not code) into document B, I suggest you put this subset in _C, and include it in both A and B.