comwes / mkpdfs-mkdocs-plugin

Converts your mkdocs documentation in PDF, to be shared with users
https://comwes.github.io/mkpdfs-mkdocs-plugin
GNU General Public License v3.0
103 stars 36 forks source link

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

Closed SSBB231 closed 4 years ago

SSBB231 commented 4 years ago

Hi everyone!

Have you guys been working on a new release to support MkDocs versions greater than 1.0? I've added SquidFunk's beautiful MkDocs Material theme to my MkDocs site, and it requires MkDocs version >=1.1, so when I try to use mkpdfs on it, I get an AttributeError. This is because mkdpdfs tries to access string_types from the mkdocs.utils module, but since upgrade 1.1 MkDocs no longer hosts those types inside the mkdocs.utils module. Instead, I believe MkDocs now uses the native Python classes for this as can be seen below:

class DummyPlugin(plugins.BasePlugin):
    config_scheme = (
        ('foo', config.config_options.Type(str, default='default foo')),
        ('bar', config.config_options.Type(int, default=0)),
        ('dir', config.config_options.Dir(exists=False)),
    )

Below is a snippet of the Traceback returned by the Python interpreter:

 class Mkpdfs(BasePlugin):
  File "/usr/local/lib/python3.8/site-packages/mkpdfs_mkdocs/mkpdfs.py", line 20, in Mkpdfs
    ('design', config_options.Type(utils.string_types, default=None)),
AttributeError: module 'mkdocs.utils' has no attribute 'string_types'

Hope you guys come up with a cool new update! Let me know if there's anything else you would like to know that would help

jwaschkau commented 4 years ago

See #15

SSBB231 commented 4 years ago

See #15

Cool, thanks for letting me know!