rosscdh / mkdocs-markdownextradata-plugin

A MkDocs plugin that injects the mkdocs.yml extra variables into the markdown template
MIT License
83 stars 18 forks source link

on_page_read_source getting multiple page arguments #22

Closed joevolleyball closed 4 years ago

joevolleyball commented 4 years ago

When I pip install the latest version of this plugin (v0.1.6), I now get:

$ mkdocs build
INFO    -  Cleaning site directory 
INFO    -  Building documentation to directory: /home/aaron/git-tid/external-documentation-server/html 
INFO    -  The following pages exist in the docs directory, but are not included in the "nav" configuration:
  - SUMMARY.md
  - explore/mobile/mobile_installation.md 
ERROR   -  Error reading page 'index.md': on_page_read_source() got multiple values for keyword argument 'page' 
Traceback (most recent call last):
  File "/home/aaron/.local/bin/mkdocs", line 11, in <module>
    sys.exit(cli())
  File "/home/aaron/.local/lib/python2.7/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/aaron/.local/lib/python2.7/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/aaron/.local/lib/python2.7/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/aaron/.local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/aaron/.local/lib/python2.7/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/aaron/.local/lib/python2.7/site-packages/mkdocs/__main__.py", line 163, in build_command
    ), dirty=not clean)
  File "/home/aaron/.local/lib/python2.7/site-packages/mkdocs/commands/build.py", line 274, in build
    _populate_page(file.page, config, files, dirty)
  File "/home/aaron/.local/lib/python2.7/site-packages/mkdocs/commands/build.py", line 170, in _populate_page
    page.read_source(config)
  File "/home/aaron/.local/lib/python2.7/site-packages/mkdocs/structure/pages.py", line 126, in read_source
    source = config['plugins'].run_event('page_read_source', None, config=config, page=self)
  File "/home/aaron/.local/lib/python2.7/site-packages/mkdocs/plugins.py", line 94, in run_event
    result = method(item, **kwargs)
TypeError: on_page_read_source() got multiple values for keyword argument 'page'

Doesn't appear to be the result of any recent changes in our repo. Works fine in v0.1.5.

rosscdh commented 4 years ago

Thanks for reporting will investigate asap

rosscdh commented 4 years ago

Would you be so kind as to provide the segment of mkdown etc that you are trying to render? or at least a case I can replicate with?

rosscdh commented 4 years ago

also versions of all software please

rosscdh commented 4 years ago

I've reverted and released 0.1.7 https://pypi.org/project/mkdocs-markdownextradata-plugin/