Open D34m0nN0n3 opened 2 years ago
+1 I have the same issue.
+1
+1
+1
Have you found any workarounds?
Just a guess, but could it be due to different versions of Python? I will try downgrading
The problem is that self._cover_title
in Options.py gets only defined if self.cover=true
, but it is always read in line 28 of the init file.
So if you configure cover: false
in your mkdocs.yml, the init file attempts to read a non existing property.
In order to resolve this issue, one could either always define self._cover_title
in Options.py regardless of self.cover
:
# Cover
self.cover = local_config['cover']
self.back_cover = local_config['back_cover']
+ self._cover_title = None
if self.cover or self.back_cover:
self._cover_title = local_config['cover_title'] \
if local_config['cover_title'] else config['site_name']
self._cover_subtitle = local_config['cover_subtitle']
self._cover_logo = local_config['cover_logo']
Or remove the if-statement underneath altogether. The plugin works just fine if cover properties are defined but the cover is invisible.
+1
Also seeing this. Using mkdocs 1.5.3 and mkdocs-with-pdf 0.9.3. My config looks like:
site_name: My Docs
plugins:
- with-pdf:
cover: false
Running mkdocs build
produces the error "AttributeError: 'Options' object has no attribute '_cover_title'. Did you mean: 'cover_title'?".
I created a venv with python3 -m venv venv
and activated with source ./venv/bin/activate
. I can confirm that modifying venv/lib/python3.11/site-packages/mkdocs_with_pdf/options.py
as suggested by https://github.com/orzih/mkdocs-with-pdf/issues/80#issuecomment-1508444386 allows mkdocs build
to build succesfully when cover: false
.
Obviously, manually patching this file isn't a great solution, maybe someone can put up a PR if one doesn't already exist.
Good day!
It is necessary to generate PDF without cover, but an error occurs: AttributeError: 'Options' object has no attribute '_cover_title' How can I fix it?
Site config mkdocs.yml:
Log:
Version: mkdocs-with-pdf==0.9.2