Exemple #1
0
def generate_exercises():
    p = Path(*EXERCISES_DIR)
    exporter = HTMLExporter()
    exporter.register_preprocessor(ClearOutputPreprocessor(), enabled=True)

    for exercise in p.iterdir():
        if exercise.suffix == '.ipynb':
            html, _ = exporter.from_file(exercise.open())
            with open(exercise.with_suffix('.html').name, 'w') as f:
                f.write(html)