takluyver / bookbook

Tools to use a collection of notebooks as 'chapters'
MIT License
99 stars 24 forks source link

AssertionError #21

Open jaimebayes opened 4 years ago

jaimebayes commented 4 years ago

Hi Thomas,

I try to run boobook with some notebooks, but I got an assertion error, maybe it is caused by my source_dir, any wrong with it?: Thanks in advance, JL

C:\github\bookbook>python -m bookbook.latex --pdf --output-file test3 **C:/github/bookbook/Capitulo/**
Traceback (most recent call last):
  File "C:\Anaconda3\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Anaconda3\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\github\bookbook\bookbook\latex.py", line 163, in <module>
    main()
  File "C:\github\bookbook\bookbook\latex.py", line 160, in main
    combine_and_convert(args.source_dir, args.output_file, args.pdf, args.template)
  File "C:\github\bookbook\bookbook\latex.py", line 144, in combine_and_convert
    combined_nb = combine_notebooks(notebook_files)
  File "C:\github\bookbook\bookbook\latex.py", line 77, in combine_notebooks
    combined_nb.cells.extend(add_sec_label(nb.cells[0], nbname))
  File "C:\github\bookbook\bookbook\latex.py", line 46, in add_sec_label
    assert cell.cell_type == 'markdown', cell.cell_type
AssertionError: code
takluyver commented 4 years ago

IIRC, it expects the first cell of each notebook to be a markdown cell containing a # Level 1 Heading, to use as a section title. Sorry, bookbook is not really polished at all, it's pretty much just a couple of scripts I put together to do what I needed at the time.

jaimebayes commented 4 years ago

I see, I will fix all notebooks then, and after that I will try again. Thanks for your time and patience, JL