I figured out the problem with my understanding of how the render works.
My problem was the when the render function is called, my custom render function is not available to it as it is defined in file itself.
This works:
```{r, render=function(x,...) knitr::knit_print(kable(read.csv(textConnection(x))))}
'a,b,c
1,2,3
4,5,6'
```
So, I understand that if I want to use custom render functions, I should put them in a package, say knitrExtras, and contrive to load in addition to rmarkdown
For example, the following shell function
function rendeRmd () { Rscript -e 'library(rmarkdown)' -e 'csvstr2dt=function(x,...) knitr::knit_print(kable(read.csv(textConnection(x))))' -e 'render(commandArgs(trailingOnly=TRUE))' "$@" ; }
allows me to call
rendeRmd t1.Rmd
and render Rmd files which using cvstr2dt as custom block rendering function.
I understand even better will be to put my custom render functions in a package. At least now I understand my misconception.
All is well! Thanks for knitr!