Exemple #1
0
def export(nbname, outfilename=None):
    exportRST = RSTExporter()
    # exclude default paths
    exportRST.template_path = ['.','/Users/adam/repos/blog'] 

    (body,resources) = exportRST.from_filename(nbname)

    if outfilename is None:
        outfilename = nbname.replace("ipynb","rst")

    with open(outfilename,'w') as f:
        f.write(body)

    return body,resources