Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all numbers title fail to create pdf #67

Open
divansantana opened this issue Jul 2, 2021 · 2 comments
Open

all numbers title fail to create pdf #67

divansantana opened this issue Jul 2, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@divansantana
Copy link

With a nav bar like below.

- Logs:
    2020:
      - Something:
          - log/2020/something/somepage.md

Basically any title that is all numbers, it results in:

Traceback (most recent call last):
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/bin/mkdocs", line 10, in <module>
    sys.exit(cli())
  File "/home/user/.guix-extra-profiles/extras/extras/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/user/.guix-extra-profiles/extras/extras/lib/python3.8/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/user/.guix-extra-profiles/extras/extras/lib/python3.8/site-packages/click/core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/user/.guix-extra-profiles/extras/extras/lib/python3.8/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/user/.guix-extra-profiles/extras/extras/lib/python3.8/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/lib/python3.8/site-packages/mkdocs/__main__.py", line 183, in build_command
    build.build(config.load_config(**kwargs), dirty=not clean)
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/lib/python3.8/site-packages/mkdocs/commands/build.py", line 309, in build
    config['plugins'].run_event('post_build', config=config)
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/lib/python3.8/site-packages/mkdocs/plugins.py", line 96, in run_event
    result = method(**kwargs)
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/lib/python3.8/site-packages/mkdocs_with_pdf/plugin.py", line 134, in on_post_build
    self.generator.on_post_build(config, self.config['output_path'])
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/lib/python3.8/site-packages/mkdocs_with_pdf/generator.py", line 126, in on_post_build
    content = self._get_content(soup, page)
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/lib/python3.8/site-packages/mkdocs_with_pdf/generator.py", line 248, in _get_content
    content = self._get_content(soup, c)
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/lib/python3.8/site-packages/mkdocs_with_pdf/generator.py", line 248, in _get_content
    content = self._get_content(soup, c)
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/lib/python3.8/site-packages/mkdocs_with_pdf/generator.py", line 264, in _get_content
    page_path = self._page_path_for_id(page)
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/lib/python3.8/site-packages/mkdocs_with_pdf/generator.py", line 185, in _page_path_for_id
    path = get_section_path(page)
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/lib/python3.8/site-packages/mkdocs_with_pdf/utils/section.py", line 11, in get_section_path
    slugs = list(map(lambda sec: _section_slug(sec), section.ancestors))
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/lib/python3.8/site-packages/mkdocs_with_pdf/utils/section.py", line 11, in <lambda>
    slugs = list(map(lambda sec: _section_slug(sec), section.ancestors))
  File "/home/user/.cache/venv/mobile-sre-docs-3.8.2/lib/python3.8/site-packages/mkdocs_with_pdf/utils/section.py", line 26, in _section_slug
    title = section.title if len(section.title) else str(uuid4)
TypeError: object of type 'int' has no len()
@divansantana
Copy link
Author

Workaround would be to change 2020 above to Year 2020.

Solution, I guess to change convert the title to a str?

@orzih orzih added the bug Something isn't working label Jul 2, 2021
@orzih
Copy link
Owner

orzih commented Jul 3, 2021

This issue has been fixed in v0.9.3. Please check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants