blueswen / mkdocs-glightbox

A MkDocs plugin supports image lightbox (zoom effect) with GLightbox.
https://blueswen.github.io/mkdocs-glightbox/
MIT License
115 stars 14 forks source link

Not able to install glightbox with poetry #3

Closed mhubig closed 1 year ago

mhubig commented 1 year ago

Hi there, I just tried to install the glightbox plugin for mkdocs-material (v8.3.9) with poetry, but unfortunately it's not working :-(

Here is what I did:

poetry add mkdocs-glightbox
poetry run mkdocs serve
INFO     -  Building documentation...
ERROR    -  Config value: 'markdown_extensions'. Error: Failed to load extension 'glightbox'.
            ModuleNotFoundError: No module named 'glightbox'
Aborted with 1 Configuration Errors!

The plugin is installed and I can load it:

poetry run python
Python 3.9.13 (main, May 24 2022, 21:28:31) 
[Clang 13.1.6 (clang-1316.0.21.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkg_resources
>>> named_objects = {}
>>> for ep in pkg_resources.iter_entry_points(group='mkdocs.plugins'):
...     named_objects.update({ep.name: ep.load()})
... 
>>> named_objects['glightbox']
<class 'mkdocs_glightbox.plugin.LightboxPlugin'>
>>>

Strange ...

blueswen commented 1 year ago

Maybe you put the glightbox inside markdown_extensions in the mkdocs.yml?

The mkdocs.yml shoud be as follow:

plugins:
  - glightbox
mhubig commented 1 year ago

Shit ok I see :-)! Here ist the content of my mkdocs.yml:

site_name: Herakles
site_dir: public
theme:
  name: material
nav:
  - index.md
  - architectur.md
  - security.md
  - api-gateway.md
  - extending-api.md
  - extending-ui.md
  - deployment.md
  - debugging.md
extra_css:
  - stylesheets/extra.css
extra_javascript:
  - https://unpkg.com/mermaid@9.1.3/dist/mermaid.min.js
markdown_extensions:
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_code_format
  - pymdownx.emoji:
      emoji_index: !!python/name:materialx.emoji.twemoji
      emoji_generator: !!python/name:materialx.emoji.to_svg
  - attr_list
  - md_in_html
  - admonition
  - pymdownx.details
  - pymdownx.superfences
  - tables
  - glightbox