chrisjsewell / ipypublish

A workflow for creating and editing publication ready scientific reports and presentations, from one or more Jupyter Notebooks, without leaving the browser!
http://ipypublish.readthedocs.io
BSD 3-Clause "New" or "Revised" License
224 stars 37 forks source link

ipub.ignore is only honoured for slide output #119

Open phelps-sg opened 4 years ago

phelps-sg commented 4 years ago

Bug Report

Describe the bug

The documentation seems to imply that the ipub.ignore cell metadata applies for all formats, but in fact it is only used by slides_from_markdown preprocessor.

To Reproduce

Mark a cell to be ignored in a notebook, and publish it to a non-slide format, e.g. latex.

Expected Behaviour

The converted notebook should not contain any slides whose metadata has ipub.ignore=true.

Runtime Information

(please complete the following information)

chrisjsewell commented 4 years ago

@phelps-sg this should be handled in the jinja template, and should not require a pre-processor (as you have done in #120 ). For example, at https://github.com/chrisjsewell/ipypublish/blob/71f2f919fe7d396d22f407ad550d0156ec72efcb/ipypublish/templates/segments/ipy-contents_output-new.yaml.tex.j2#L17

and https://github.com/chrisjsewell/ipypublish/blob/71f2f919fe7d396d22f407ad550d0156ec72efcb/ipypublish/templates/segments/ipy-contents_output-new.yaml.tex.j2#L41

Processing any input / output cells with ipub.ignore should be skipped. Could you perhaps let me know what specific publishing format this is occuring on?

phelps-sg commented 4 years ago

This is happening all publishing formats apart from slides. I have added test-cases in #120 which should illustrate the problem.

chrisjsewell commented 4 years ago

No problem, I’ll add the test cases and see why the jinja templates are failing to do their job 😬

phelps-sg commented 4 years ago

PS - The slides_from_markdown preprocessor sets {cell_type: skip} for any cell with metadata {ipub: {ignore: true}}, which is why publishing to slides seems to work correctly (incidentally this is also the reason that I assumed preprocessing was the correcy way to handle ipub.ignore).