code: def markdown_to_notebook(infile, outfile):
      
  
      # Read infile into a string
      with open(infile, 'r') as fin:
          str = fin.read()
      # Enclose the markdown within triple quotes and convert from
      # python to notebook
      str = '"""' + str + '"""'
      nb = py2jn.py_string_to_notebook(str)
      py2jn.tools.write_notebook(nb, outfile, nbver=4)
docs: Convert a markdown file to a notebook file.