%global _empty_manifest_terminate_build 0
Name: python-notebook-as-pdf
Version: 0.5.0
Release: 1
Summary: Jupyter extension to export notebooks as PDFs
License: BSD3
URL: https://github.com/betatim/notebook-as-pdf
Source0: https://mirrors.nju.edu.cn/pypi/web/packages/48/21/24717d37b0b6f71d4c9a69e4bf5b461b5241aba41cddefc7bcf3cb763820/notebook-as-pdf-0.5.0.tar.gz
BuildArch: noarch
Requires: python3-nbconvert
Requires: python3-pyppeteer
Requires: python3-PyPDF2
%description
# Jupyter Notebooks as PDF
[](https://mybinder.org/v2/gh/betatim/notebook-as-pdf/0.5.0)
This Jupyter notebook extension allows you to save your notebook as a PDF.
Three new features compared to the official "save as PDF" extension:
1. produce a PDF with the smallest number of page breaks,
1. the original notebook is attached to the PDF; and
1. this extension does not require LaTex.
The created PDF will have as few pages as possible, in many cases only one. This is useful if you are exporting your notebook to a PDF for sharing with others who will view it on a screen.
Every `
` tag in the notebook will be converted into a entry in the table of contents of the PDF.
To make it easier to reproduce the contents of the PDF at a later date the original notebook is attached to the PDF. Unfortunately not all PDF viewers know how to deal with attachments. PDF viewers known to support downloading of file attachments are: Acrobat Reader, pdf.js and evince. The `pdftk` CLI program can also extract attached files from a PDF. Preview for OSX does not know how to display/give you access to attachments of PDF files.
## Install
To use this bundler you need to install it:
```
python -m pip install -U notebook-as-pdf
pyppeteer-install
```
The second command will download and setup Chromium. It is used to perform
the HTML to PDF conversion.
On linux you probably also need to install some or all of the APT packages
listed in [`binder/apt.txt`](binder/apt.txt).
## Use it
Create a notebook and the click "File -> Download As". Click the new menu entry
called "PDF via HTML". Your notebook will be converted to a PDF on the fly
and then downloaded.
You can also use it with `nbconvert`:
```
jupyter-nbconvert --to pdfviahtml example.ipynb
```
which will create a file called `example.pdf`.
You will have to use Acrobat Reader to see the attachment to your PDF. Preview
on OSX can not display PDF attachments.
%package -n python3-notebook-as-pdf
Summary: Jupyter extension to export notebooks as PDFs
Provides: python-notebook-as-pdf
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-notebook-as-pdf
# Jupyter Notebooks as PDF
[](https://mybinder.org/v2/gh/betatim/notebook-as-pdf/0.5.0)
This Jupyter notebook extension allows you to save your notebook as a PDF.
Three new features compared to the official "save as PDF" extension:
1. produce a PDF with the smallest number of page breaks,
1. the original notebook is attached to the PDF; and
1. this extension does not require LaTex.
The created PDF will have as few pages as possible, in many cases only one. This is useful if you are exporting your notebook to a PDF for sharing with others who will view it on a screen.
Every `` tag in the notebook will be converted into a entry in the table of contents of the PDF.
To make it easier to reproduce the contents of the PDF at a later date the original notebook is attached to the PDF. Unfortunately not all PDF viewers know how to deal with attachments. PDF viewers known to support downloading of file attachments are: Acrobat Reader, pdf.js and evince. The `pdftk` CLI program can also extract attached files from a PDF. Preview for OSX does not know how to display/give you access to attachments of PDF files.
## Install
To use this bundler you need to install it:
```
python -m pip install -U notebook-as-pdf
pyppeteer-install
```
The second command will download and setup Chromium. It is used to perform
the HTML to PDF conversion.
On linux you probably also need to install some or all of the APT packages
listed in [`binder/apt.txt`](binder/apt.txt).
## Use it
Create a notebook and the click "File -> Download As". Click the new menu entry
called "PDF via HTML". Your notebook will be converted to a PDF on the fly
and then downloaded.
You can also use it with `nbconvert`:
```
jupyter-nbconvert --to pdfviahtml example.ipynb
```
which will create a file called `example.pdf`.
You will have to use Acrobat Reader to see the attachment to your PDF. Preview
on OSX can not display PDF attachments.
%package help
Summary: Development documents and examples for notebook-as-pdf
Provides: python3-notebook-as-pdf-doc
%description help
# Jupyter Notebooks as PDF
[](https://mybinder.org/v2/gh/betatim/notebook-as-pdf/0.5.0)
This Jupyter notebook extension allows you to save your notebook as a PDF.
Three new features compared to the official "save as PDF" extension:
1. produce a PDF with the smallest number of page breaks,
1. the original notebook is attached to the PDF; and
1. this extension does not require LaTex.
The created PDF will have as few pages as possible, in many cases only one. This is useful if you are exporting your notebook to a PDF for sharing with others who will view it on a screen.
Every `` tag in the notebook will be converted into a entry in the table of contents of the PDF.
To make it easier to reproduce the contents of the PDF at a later date the original notebook is attached to the PDF. Unfortunately not all PDF viewers know how to deal with attachments. PDF viewers known to support downloading of file attachments are: Acrobat Reader, pdf.js and evince. The `pdftk` CLI program can also extract attached files from a PDF. Preview for OSX does not know how to display/give you access to attachments of PDF files.
## Install
To use this bundler you need to install it:
```
python -m pip install -U notebook-as-pdf
pyppeteer-install
```
The second command will download and setup Chromium. It is used to perform
the HTML to PDF conversion.
On linux you probably also need to install some or all of the APT packages
listed in [`binder/apt.txt`](binder/apt.txt).
## Use it
Create a notebook and the click "File -> Download As". Click the new menu entry
called "PDF via HTML". Your notebook will be converted to a PDF on the fly
and then downloaded.
You can also use it with `nbconvert`:
```
jupyter-nbconvert --to pdfviahtml example.ipynb
```
which will create a file called `example.pdf`.
You will have to use Acrobat Reader to see the attachment to your PDF. Preview
on OSX can not display PDF attachments.
%prep
%autosetup -n notebook-as-pdf-0.5.0
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-notebook-as-pdf -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Fri May 05 2023 Python_Bot - 0.5.0-1
- Package Spec generated