takluyver / bookbook

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

support for --TagRemovePreprocessor... #14

Open boffi opened 6 years ago

boffi commented 6 years ago

I have to say first that bookbook is great!

but not without some problems... If I try to use bookbook on notebooks where I have used the relatively new cell tags mechanism, as in

python3 -m bookbook.latex --TagRemovePreprocessor.remove_input_tags='{"hide-code"}' --template ./art.tplx --TagRemovePreprocessor.remove_cell_tags='{"hide-cell"}'

everything breaks and I'm told

usage: latex.py [-h] [--output-file OUTPUT_FILE] [--pdf] [--template TEMPLATE]
                [source_dir]
latex.py: error: unrecognized arguments: --TagRemovePreprocessor.remove_input_tags={"hide-code"} --TagRemovePreprocessor.remove_cell_tags={"hide-cell"}

Why don't you simply pass to nbconvert the options not understood by bookbook? I have made the example of the tags preprocessor, but there are many other aspects of nbconvert that are configurable via command line options.

Thank you ፨ gb

takluyver commented 6 years ago

It probably makes sense to pass options through to nbconvert, though I'd probably make it work like this:

python3 -m bookbook.latex (bookbook options) -- (nbconvert options)

i.e. the nbconvert options go after --. That avoids clashes if we later want to add some options with the same names as nbconvert options.