mystmd icon indicating copy to clipboard operation
mystmd copied to clipboard

literal include directive for function

Open atharvaaalok opened this issue 8 months ago • 5 comments

Is there a way to use the literalinclude directive for a particular function?

I am using for a function named automate_training the following code:

:::{literalinclude} assets/utils.py
:start-at: automate_training
:end-at: print(
:::

My function does not have a return statement and therefore I am trying to 'hack' the literalinclude by using the print( word.

But this is overall a very hacky method and if I add in a line later at the end it would break.

atharvaaalok avatar Mar 01 '25 18:03 atharvaaalok