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

IPyPostProcessor does not allow relative output path #114

Open
phelps-sg opened this issue Nov 19, 2019 · 1 comment
Open

IPyPostProcessor does not allow relative output path #114

phelps-sg opened this issue Nov 19, 2019 · 1 comment

Comments

@phelps-sg
Copy link
Contributor

phelps-sg commented Nov 19, 2019

Bug Report

Describe the bug

When using nbpublish with the -o option, specifying a relative path such as ./ results in the following error message:

ERROR:write-text-file:the post-processor requires an absolute folder path

To Reproduce

Steps to reproduce the behavior:

Specify a relative path when using nbpublish; e.g.:

nbpublish -log debug -f slides_ipypublish_all bayes-slides.ipynb -o ./target

(for extended explanation, use the additional context section)

Minimal Notebook Example

If possible, please create a minimal Jupyter Notebook to replicate the issue.
Then rename its file extension to .txt (since Github rejects .ipynb),
and drag and drop it here.

Expected Behaviour

nbpublish should write the published files to the target/ folder in the current working directory.

Runtime Information

(please complete the following information)

  • IPyPublish: [e.g. 0.10.10]

  • Python: [e.g. 3.7.3]

  • OS: [e.g. Ubuntu 18.04.3 LTS ]

  • Pandoc: [2.2.3.2]

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

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

  • Versions of any other relevant python packages

Additional context

This makes it difficult to automate the publication process using build tools such as Make.

Note that although by default nbpublish will construct an absolute path, this path is still relative to the location of the source file. Consider a simple example use-case where we want files to be written to the directory target/, relative to the source files, instead of the default converted/. The only way to achieve this without relative paths currently is to specify the absolute path of the project, thus creating additional (but potentially unnecessary) configuration maintenance.

Logging

(base) sphelps@sphelps-OptiPlex-9010:~/vcs/teaching/high-frequency/slides/bayes-slides$ nbpublish -log debug -f slides_ipypublish_all bayes-slides.ipynb -o ./
INFO:ipypublish:started ipypublish v0.10.10 at Tue Nov 19 12:03:32 2019
INFO:ipypublish:logging to: ./bayes-slides.nbpub.log
INFO:ipypublish:running for ipynb(s) at: bayes-slides.ipynb
INFO:ipypublish:with conversion configuration: slides_ipypublish_all
INFO:nbmerge:Reading notebook
DEBUG:ipypublish:notebooks meta path: bayes-slides.ipynb
INFO:ipypublish:finding conversion configuration: slides_ipypublish_all
INFO:ipypublish:loading conversion configuration
INFO:ipypublish:creating exporter
INFO:ipypublish:creating template and loading filters
DEBUG:template:overwrite keys: []
DEBUG:template:overwrite keys: []
DEBUG:template:overwrite keys: []
DEBUG:template:overwrite keys: []
DEBUG:template:overwrite keys: ['notebook_all']
DEBUG:template:overwrite keys: ['notebook_output', 'notebook_all', 'notebook_input_markdown', 'notebook_input_code', 'notebook_input_code_pre', 'notebook_input_code_post', 'notebook_output_text', 'notebook_output_stream_stderr', 'notebook_output_stream_stdout']
DEBUG:template:overwrite keys: ['notebook_all', 'html_body_start', 'notebook_input_markdown']
INFO:ipypublish:creating process configuration
INFO:ipypublish:running nbconvert
DEBUG:traitlets:Applying preprocessor: TagRemovePreprocessor
DEBUG:traitlets:Applying preprocessor: RegexRemovePreprocessor
DEBUG:traitlets:Applying preprocessor: coalesce_streams
DEBUG:traitlets:Applying preprocessor: CSSHTMLHeaderPreprocessor
DEBUG:traitlets:Applying preprocessor: HighlightMagicsPreprocessor
DEBUG:traitlets:Applying preprocessor: MetaDefaults
INFO:root:adding ipub defaults to notebook
DEBUG:traitlets:Applying preprocessor: SplitOutputs
INFO:root:splitting outputs into separate cells
DEBUG:traitlets:Applying preprocessor: LatexDocLinks
INFO:resolve_links:resolving external file paths in ipub metadata to: bayes-slides.ipynb
DEBUG:traitlets:Applying preprocessor: LatexDocHTML
INFO:root:processing notebook for html output in ipub metadata to: bayes-slides.ipynb
DEBUG:traitlets:Applying preprocessor: LatexTagsToHTML
INFO:root:converting latex tags to html
DEBUG:traitlets:Applying preprocessor: LatexCaptions
INFO:captions:extracting caption cells
DEBUG:traitlets:Applying preprocessor: MarkdownSlides
INFO:root:creating slides based on markdown and existing slide tags
DEBUG:root:No toc.base_numbering in notebook metadata; starting at 1
DEBUG:traitlets:Attempting to load template template_file
DEBUG:traitlets:    template_path: .
DEBUG:remove-trailing-space:skipping incorrect mime type: text/html
ERROR:write-text-file:the post-processor requires an absolute folder path
ERROR:nbpublish:Run Failed: the post-processor requires an absolute folder path
@chrisjsewell
Copy link
Owner

I'll await your PR 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants