mkdocstrings/vba

Can't find 'templates' folder for handler 'vba'

heetbeet opened this issue · 3 comments

When trying to compile VBA docs on
VirtualActuary/MiscVBAFunctions@3a54f77

cd docs
python -m pip install -r requirements.txt
mkdocs build

We run into the following error on the mkdocstrings-vba side:

PS C:\Users\simon\devel\MiscVBAFunctions\docs> mkdocs build
INFO     -  Cleaning site directory
INFO     -  Building documentation to directory: C:\Users\simon\devel\MiscVBAFunctions\docs\dist
ERROR    -  Error reading page 'MiscVBAFunctions\Modules\Casing.md': Can't find 'templates' folder for handler 'vba'
Traceback (most recent call last):
  File "C:\Users\simon\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\simon\anaconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\simon\anaconda3\Scripts\mkdocs.exe\__main__.py", line 7, in <module>
  File "C:\Users\simon\anaconda3\lib\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\simon\anaconda3\lib\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "C:\Users\simon\anaconda3\lib\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\simon\anaconda3\lib\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\simon\anaconda3\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocs\__main__.py", line 192, in build_command
    build.build(config.load_config(**kwargs), dirty=not clean)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocs\commands\build.py", line 292, in build
    _populate_page(file.page, config, files, dirty)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocs\commands\build.py", line 174, in _populate_page
    page.render(config, files)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocs\structure\pages.py", line 175, in render
    self.content = md.convert(self.markdown)
  File "C:\Users\simon\anaconda3\lib\site-packages\markdown\core.py", line 264, in convert
    root = self.parser.parseDocument(self.lines).getroot()
  File "C:\Users\simon\anaconda3\lib\site-packages\markdown\blockparser.py", line 90, in parseDocument
    self.parseChunk(self.root, '\n'.join(lines))
  File "C:\Users\simon\anaconda3\lib\site-packages\markdown\blockparser.py", line 105, in parseChunk
    self.parseBlocks(parent, text.split('\n\n'))
  File "C:\Users\simon\anaconda3\lib\site-packages\markdown\blockparser.py", line 123, in parseBlocks
    if processor.run(parent, blocks) is not False:
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocstrings\extension.py", line 120, in run
    html, handler, data = self._process_block(identifier, block, heading_level)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocstrings\extension.py", line 177, in _process_block
    handler = self._handlers.get_handler(handler_name, handler_config)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocstrings\handlers\base.py", line 473, in get_handler
    self._handlers[name] = module.get_handler(
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocstrings_handlers\vba\handler.py", line 74, in get_handler
    renderer=VbaRenderer("vba", theme, custom_templates),
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocstrings\handlers\base.py", line 100, in __init__
    themes_dir = self.get_templates_dir(handler)
  File "C:\Users\simon\anaconda3\lib\site-packages\mkdocstrings\handlers\base.py", line 183, in get_templates_dir
    raise FileNotFoundError(f"Can't find 'templates' folder for handler '{handler}'")
FileNotFoundError: Can't find 'templates' folder for handler 'vba'

I can compile and have these versions installed:

pip show mkdocs mkdocs-material mkdocstrings-vba mkdocs-gen-files mkdocs-literate-nav
Name: mkdocs
Version: 1.2.3
Summary: Project documentation with Markdown.
Home-page: https://www.mkdocs.org
Author: Tom Christie
Author-email: tom@tomchristie.com
License: BSD
Location: c:\users\malan\anaconda3\lib\site-packages
Requires: packaging, mergedeep, watchdog, Markdown, Jinja2, ghp-import, PyYAML, pyyaml-env-tag, click, importlib-metadata
Required-by: mkdocstrings, mkdocs-section-index, mkdocs-material, mkdocs-macros-plugin, mkdocs-literate-nav, mkdocs-gen-files, mkdocs-autorefs
---
Name: mkdocs-material
Version: 8.1.11
Summary: A Material Design theme for MkDocs
Home-page: https://squidfunk.github.io/mkdocs-material/
Author: Martin Donath
Author-email: martin.donath@squidfunk.com
License: MIT
Location: c:\users\malan\anaconda3\lib\site-packages
Requires: markdown, pymdown-extensions, mkdocs-material-extensions, jinja2, pygments, mkdocs
Required-by: mkdocstrings-vba
---
Name: mkdocstrings-vba
Version: 0.0.5.dev1+g9242215
Summary: MkDocstrings VBA handler
Home-page: https://github.com/AutoActuary/mkdocstrings-vba
Author: Rudolf Byker
Author-email: rudolfbyker@gmail.com
License: UNKNOWN
Location: c:\aa\mkdocstrings-vba
Requires: mkdocstrings, mkdocs-material
Required-by:
---
Name: mkdocs-gen-files
Version: 0.3.4
Summary: MkDocs plugin to programmatically generate documentation pages during the build
Home-page: https://github.com/oprypin/mkdocs-gen-files
Author: Oleh Prypin
Author-email: oleh@pryp.in
License: MIT
Location: c:\users\malan\anaconda3\lib\site-packages
Requires: mkdocs
Required-by:
---
Name: mkdocs-literate-nav
Version: 0.4.1
Summary: MkDocs plugin to specify the navigation in Markdown instead of YAML
Home-page: https://github.com/oprypin/mkdocs-literate-nav
Author: Oleh Prypin
Author-email: oleh@pryp.in
License: MIT
Location: c:\users\malan\anaconda3\lib\site-packages
Requires: mkdocs
Required-by:

Compare of the changes:
9242215...0.0.5

@heetbeet some issues preventing me from debugging this:

  • The commit link you posted refers to a commit that no longer exists: VirtualActuary/MiscVBAFunctions@3a54f77 . I ignored this and tried on the main branch.
  • The provided commands fail because the workbook is not compiled yet, so I guess I need to run compile.cmd
  • There is no requirements.txt file for the compile.py script, so I can't run it without having to figure out the dependencies manually.

Closed in 14c7597