Render markdown comments within logical code blocks

Is there a way to have rendered makdown inside logical units of text?
For example have formatted text between methods of a class or even between sections of a function.
AFAIK it is not possible to interleave code and markdown cells at that level of granularity since each top level block of code must be within a single code cell, but maybe there is a another way to achieve something that looks similar?
eg make comments render nicely?
Or maybe a way to stitch code fragments like in noweb?
Or perhaps a package like nbdeb or ipytext has a way to do something like this