Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove check for absolute file path in IPyPostProcessor #115

Closed
wants to merge 9 commits into from
5 changes: 0 additions & 5 deletions ipypublish/postprocessors/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@ def postprocess(self, stream, mimetype, filepath, resources=None):

if self.requires_path:

if not filepath.is_absolute():
self.handle_error(
"the post-processor requires an absolute folder path", IOError
)

if filepath.parent.exists() and not filepath.parent.is_dir():
self.handle_error(
"the filepath's parent is not a folder: {}".format(filepath),
Expand Down
14 changes: 14 additions & 0 deletions ipypublish/preprocessors/skip_ignored.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from nbconvert.preprocessors import Preprocessor
from nbformat import NotebookNode


class SkipIgnored(Preprocessor):

def preprocess(self, nb, resources):

def included(cell):
cell.metadata.ipub = cell.metadata.get("ipub", NotebookNode())
return not cell.metadata.ipub.get("ignore", False)

nb.cells = list(filter(included, nb.cells))
return nb, resources
3 changes: 3 additions & 0 deletions ipypublish/schema/doc_metadata.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
"type": "string",
"default": "english"
},
"customcss": {
"description": "additional custom stylesheet to link"
},
"titlepage": {
"description": "options for creating the title page",
"type": [
Expand Down
6 changes: 6 additions & 0 deletions ipypublish/templates/segments/std-slides.html-tplx.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@
"<script src=\"{{resources.reveal.url_prefix}}/lib/js/html5shiv.js\"></script>",
"<![endif]-->",
"",
"{%- if nb.metadata.ipub -%}",
"{%- if nb.metadata.ipub.customcss -%}",
"<link rel=\"stylesheet\" href=\"{{nb.metadata.ipub.customcss}}\">",
"",
"{% endif %}",
"{% endif %}",
"<!-- Get Font-awesome from cdn -->",
"<link rel=\"stylesheet\" href=\"{{resources.reveal.font_awesome_url}}\">",
"",
Expand Down