Skip to content

hint activation key of 'none' breaks site builds #41

Closed

Description

@jeffhern

Recent refactor introduced a bug where 'none' is configured as the hint key the mkdocs site won't build as the hint_message var has no value.

match key:
  case "alt":
        hint_message = 'Hold "Alt" / "Option" to enable Pan & Zoom'
  case "ctrl":
        hint_message = 'Hold "Ctrl" to enable Pan & Zoom'
  case "shift":
        hint_message = 'Hold "Shift" to enable Pan & Zoom'
    
 return f"""<div class="{css_class}">
{hint_message}

Build Logs

ERROR   -  Error reading page 'index.md': cannot access local variable 'hint_message' where it is not associated with a value
Traceback (most recent call last):
  File "/usr/local/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs/__main__.py", line 270, in serve_command
    serve.serve(**kwargs)
  File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/serve.py", line 86, in serve
    builder(config)
  File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/serve.py", line 67, in builder
    build(config, live_server=None if is_clean else server, dirty=is_dirty)
  File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/build.py", line 322, in build
    _populate_page(file.page, config, files, dirty)
  File "/usr/local/lib/python3.11/site-packages/mkdocs/commands/build.py", line 175, in _populate_page
    page.render(config, files)
  File "/usr/local/lib/python3.11/site-packages/mkdocs/structure/pages.py", line 271, in render
    self.content = md.convert(self.markdown)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/markdown/core.py", line 361, in convert
    newRoot = treeprocessor.run(root)
              ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/markdown/extensions/toc.py", line 333, in run
    toc = pp.run(toc)
          ^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs_panzoom_plugin/markdown_extension.py", line 44, in run
    sub = create_panzoom_box(config=self.config, id=0)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs_panzoom_plugin/panzoom_box.py", line 67, in create_panzoom_box
    placeholder_info_bottom = create_info_box(config=config)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mkdocs_panzoom_plugin/panzoom_box.py", line 47, in create_info_box
    {hint_message}
     ^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'hint_message' where it is not associated with a value
make: *** [run] Error 1
`

Activity

  1. PLAYG0N commented on Sep 5, 2025

    @PLAYG0N
    Owner

    Thanks for reporting.

  2. self-assigned this
    on Sep 5, 2025
  3. added a commit that references this issue on Sep 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions