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

Building pdf outputs errors #86

Open
lzpons opened this issue May 1, 2020 · 2 comments
Open

Building pdf outputs errors #86

lzpons opened this issue May 1, 2020 · 2 comments

Comments

@lzpons
Copy link

lzpons commented May 1, 2020

Hi,
I am trying to install your plugin for pdf generation and finding some issues.
Have done it on a Mac and in a debian machine and both show the same error

mkdocs build
/Applications/anaconda3/lib/python3.6/site-packages/weasyprint/fonts.py:230: UserWarning: FontConfig: No fonts configured. Expect ugly output.
  'FontConfig: No fonts configured. '
/Applications/anaconda3/lib/python3.6/site-packages/weasyprint/document.py:36: UserWarning: There are known rendering problems and missing features with cairo < 1.15.4. WeasyPrint may work with older versions, but please read the note about the needed cairo version on the "Install" page of the documentation before reporting bugs. http://weasyprint.readthedocs.io/en/latest/install.html
  'There are known rendering problems and missing features with '
Traceback (most recent call last):
  File "/Applications/anaconda3/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
....

AttributeError: module 'mkdocs.utils' has no attribute 'string_types'

I believe I have installed the right dependencies

pip list | grep cairo
cairocffi                                         1.1.0
pycairo                                           1.18.0

On the Debian machine I have even installed the library as seen into https://www.cairographics.org/download/

sudo apt-get install libcairo2-dev

But for the moment nothing seems to be working.

Maybe you can give me a hint on how to deal with it !

@wenergy-turajpilehvar
Copy link

This fixes it for me. It's dirty an you should only use this if you understand what it's doing:

sed -i '/usr/local/lib/python3.8/site-packages/mkdocs_pdf_export_plugin/plugin.py' \
    -e 's/^from mkdocs import utils$//g' \
    -e 's/utils.string_types/str/g'

@lzpons
Copy link
Author

lzpons commented May 23, 2020

Thank you for the tip,

I am using Anaconda distribution, so my path is
/Applications/anaconda3/lib/python3.6/site-packages/mkdocs_pdf_export_plugin/plugin.py

into this file there is an import line from mkdocs import utilsbut it does not seem to be used.
In particular I am not finding the utils.string_types
plugin.py.zip

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

No branches or pull requests

2 participants