What's the best way to embed jupyter notebook into markdown post?

So couple approaches I’ve tried from other posts here, just none of them are good enough -

  1. I tried to use mmark and just do {{...html}}
    Turned out it distort the original html tags somehow and thus i couldn’t get it to format correctly
  2. I’ve created shortcodes with
    {{ $file := .Get 0 | readFile }}
    {{ htmlUnescape $file | safeHTML}}
    
    So far, this is the only way that works in my favor, renders the file without losing format or any hassle. However, I looked at the source, there seems to be 1MB filesize limit.

Is there any other way to get this working? For now I have recompile hugo to take max 10MB, is there any cons of doing so?

@l1990790120 I built an nbconvert exporter to suit my needs for converting notebooks to a Hugo-friendly markdown format. I’m not sure if it will solve your problem or not (or if you still have a problem one year later). But you can take a look on Github if you’re interested. I’d love feedback!