ipypublish icon indicating copy to clipboard operation
ipypublish copied to clipboard

ipub.ignore is only honoured for slide output

Open phelps-sg opened this issue 5 years ago • 4 comments

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)

  • IPyPublish: [e.g. 0.10.10]

  • Python: [e.g. 3.7.3]

  • OS: [e.g. Linux Mint 18.03]

  • Pandoc: [ 2.7.3]

  • (optional for pdf issues) texlive: [run tex]

  • (optional for pdf issues) latexmk: [run latexmk --version]

phelps-sg avatar Nov 28 '19 14:11 phelps-sg

@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?

chrisjsewell avatar Dec 09 '19 08:12 chrisjsewell

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

phelps-sg avatar Dec 09 '19 09:12 phelps-sg

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

chrisjsewell avatar Dec 09 '19 09:12 chrisjsewell

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).

phelps-sg avatar Dec 10 '19 09:12 phelps-sg