zhaoterryy / mkdocs-pdf-export-plugin

An MkDocs plugin to export content pages as PDF files
MIT License
312 stars 43 forks source link

Error with pull request "Fix compatibility with mkdocs-1.0" #8

Closed panoti closed 5 years ago

panoti commented 5 years ago

I build my source with docker image python:3.6-alpine3.7

docker run -it --rm python:3.6-alpine3.7 /bin/sh
apk add --update --no-cache alpine-sdk python3-dev zlib-dev libffi-dev jpeg-dev tiff-dev freetype cairo-dev pango-dev giflib-dev && \
pip install mkdocs-material && \
pip install git+https://github.com/shauser/mkdocs-pdf-export-plugin.git
git clone <my source url>
mkdocs build

I catched some err:

File "/usr/local/lib/python3.6/site-packages/mkdocs_pdf_export_plugin/plugin.py", line 68, in on_post_page
    print('Error converting {} to PDF: {}'.format(page.input_path, e), file=sys.stderr)
AttributeError: 'Page' object has no attribute 'input_path'

Then I tried fix it with cmd

sed -i 's/page.input_path/page.file.src_path/g' /usr/local/lib/python3.6/site-packages/mkdocs_pdf_export_plugin/plugin.py

And I still catched new error

Error converting index.md to PDF: cannot use string() on <cdata 'unsigned char *' NULL>
panoti commented 5 years ago

I solved it. Please edit line 68 for safe code.

shauser commented 5 years ago

Fixed