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

Insiders 4.16+: macro 'render' takes not more than 1 argument(s) #3961

Closed
5 tasks done
btbf opened this issue May 28, 2022 · 8 comments
Closed
5 tasks done

Insiders 4.16+: macro 'render' takes not more than 1 argument(s) #3961

btbf opened this issue May 28, 2022 · 8 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@btbf
Copy link

btbf commented May 28, 2022

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

Build errors on local server and GithubAction.

Expected behaviour

Build completes without error

Actual behaviour

btbf@db-snapshot:~/sjg/main$ mkdocs serve --dev-addr=0.0.0.0:8000
INFO - Building documentation...
WARNING - Config value: 'dev_addr'. Warning: The use of the IP address '0.0.0.0' suggests a production
environment or the use of a proxy to connect to the MkDocs server. However, the MkDocs' server is
intended for local development purposes only. Please use a third party production-ready server
instead.
INFO - Cleaning site directory
Traceback (most recent call last):
File "/home/btbf/.local/bin/mkdocs", line 8, in
sys.exit(cli())
File "/home/btbf/.local/lib/python3.8/site-packages/click/core.py", line 1128, in call
return self.main(*args, **kwargs)
File "/home/btbf/.local/lib/python3.8/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/home/btbf/.local/lib/python3.8/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/home/btbf/.local/lib/python3.8/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/btbf/.local/lib/python3.8/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/btbf/.local/lib/python3.8/site-packages/mkdocs/main.py", line 181, in serve_command
serve.serve(dev_addr=dev_addr, livereload=livereload, watch=watch, **kwargs)
File "/home/btbf/.local/lib/python3.8/site-packages/mkdocs/commands/serve.py", line 63, in serve
config = builder()
File "/home/btbf/.local/lib/python3.8/site-packages/mkdocs/commands/serve.py", line 58, in builder
build(config, live_server=live_server, dirty=dirty)
File "/home/btbf/.local/lib/python3.8/site-packages/mkdocs/commands/build.py", line 306, in build
_build_theme_template(template, env, files, config, nav)
File "/home/btbf/.local/lib/python3.8/site-packages/mkdocs/commands/build.py", line 111, in _build_theme_template
output = _build_template(template_name, template, files, config, nav)
File "/home/btbf/.local/lib/python3.8/site-packages/mkdocs/commands/build.py", line 90, in _build_template
output = template.render(context)
File "/home/btbf/.local/lib/python3.8/site-packages/jinja2/environment.py", line 1291, in render
self.environment.handle_exception()
File "/home/btbf/.local/lib/python3.8/site-packages/jinja2/environment.py", line 925, in handle_exception
raise rewrite_traceback_stack(source=source)
File "/home/btbf/.local/lib/python3.8/site-packages/material/404.html", line 4, in top-level template code
{% extends "main.html" %}
File "/home/btbf/sjg/main/docs/overrides/main.html", line 1, in top-level template code
{% extends "base.html" %}
File "/home/btbf/.local/lib/python3.8/site-packages/material/base.html", line 144, in top-level template code
{% block header %}
File "/home/btbf/.local/lib/python3.8/site-packages/material/base.html", line 145, in block 'header'
{% include "partials/header.html" %}
File "/home/btbf/.local/lib/python3.8/site-packages/material/partials/header.html", line 83, in top-level template code
{% include "partials/tabs.html" %}
File "/home/btbf/.local/lib/python3.8/site-packages/material/partials/tabs.html", line 8, in top-level template code
{% include "partials/tabs-item.html" %}
File "/home/btbf/.local/lib/python3.8/site-packages/material/partials/tabs-item.html", line 37, in top-level template code
{{ render(nav_item) }}
File "/home/btbf/.local/lib/python3.8/site-packages/jinja2/runtime.py", line 828, in _invoke
rv = self._func(*arguments)
File "/home/btbf/.local/lib/python3.8/site-packages/material/partials/tabs-item.html", line 21, in template
{{ render(first, title) }}
TypeError: macro 'render' takes not more than 1 argument(s)

Steps to reproduce

  1. Start the server
  2. It's an error.

Package versions

  • Python: python --version 3.8.10
  • MkDocs: mkdocs --version 1.3.0
  • Material: pip show mkdocs-material | grep -E ^Version 8.2.16+insiders.4.16.1

Configuration

theme:
  language: ja
  favicon: images/favicon.png
  logo: images/logo-white.png
  font:
    text: Noto Sans Japanese
  name: material
  custom_dir: docs/overrides
  palette:
    - scheme: default
      toggle:
        icon: material/toggle-switch-off-outline
        name: Switch to dark mode
    - scheme: slate
      accent: cyan
      primary: cyan
      toggle:
        icon: material/toggle-switch
        name: Switch to light mode
  features:
    - content.tabs.link
    - navigation.tabs
    - navigation.tabs.sticky
    - navigation.top
    - navigation.instant
    - navigation.tracking
    - search.suggest
    - search.highlight
    - search.share





plugins:
  - git-revision-date-localized:
      type: datetime
  - search:
      lang: ja

markdown_extensions:
  - pymdownx.critic
  - pymdownx.caret
  - pymdownx.keys
  - pymdownx.mark
  - pymdownx.tilde
  - meta
  - codehilite
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_code_format
  - admonition
  - pymdownx.details
  - pymdownx.tabbed:
      alternate_style: true
  - tables
  - attr_list
  - md_in_html
  - pymdownx.superfences
  - toc:
      permalink: true
  - def_list
  - pymdownx.tasklist:
      custom_checkbox: true
  - pymdownx.emoji:
      emoji_index: !!python/name:materialx.emoji.twemoji
      emoji_generator: !!python/name:materialx.emoji.to_svg

extra_css:
  - stylesheets/extra.css

System information

  • Operating system: ...Ubuntu20.04
  • Browser: ...
@squidfunk
Copy link
Owner

squidfunk commented May 28, 2022

Thanks for reporting. I'm not able to reproduce this problem. Could you please provide a minium reproducible example? Try narrowing it down by removing configuration and pages. Please attach the example that reproduces the error as a zip file.

Furthermore, please try removing your customizations. You have overrides in place that might be the cause.

@squidfunk squidfunk added needs reproduction Issue lacks a minimal reproduction .zip file needs input Issue needs further input by the reporter labels May 28, 2022
@btbf
Copy link
Author

btbf commented May 28, 2022

It built fine by removing the navigation.tabs option.
Has the spec been changed recently?

site_name: SPO JAPAN GUILD DOCS
site_url: https://docs.spojapanguild.net
site_description: SPO JAPAN GUILD監修のステークプール構築ガイド。私たちは日本におけるステークプール構築を促進しカルダノ分散化に貢献してまいります。
theme:
  language: ja
  favicon: images/favicon.png
  logo: images/logo-white.png
  font:
    text: Noto Sans Japanese
  name: material
  custom_dir: docs/overrides
  palette:
    - scheme: default
      toggle:
        icon: material/toggle-switch-off-outline
        name: Switch to dark mode
    - scheme: slate
      accent: cyan
      primary: cyan
      toggle:
        icon: material/toggle-switch
        name: Switch to light mode
  features:
    - content.tabs.link
    - navigation.tabs
    - navigation.tabs.sticky
    - navigation.top
    - navigation.instant
    - navigation.tracking
    - search.suggest
    - search.highlight
    - search.share
  icon:
    repo: fontawesome/brands/github

copyright: Copyright © 2020 - 2022 CARDANO COMMUNITY SPO JAPAN GUILD
repo_url: https://github.com/btbf/spojapanguild
repo_name: btbf/spojapanguild

plugins:
  - git-revision-date-localized:
      type: datetime
  - search:
      lang: ja

extra:
  generator: false
  analytics:
    provider: google
    property: G-R9C48XMXE5
  consent:
    title: Cookieの使用許諾
    description: >- 
      当サイトは、ドキュメントの効果測定や利用者確認のため、クッキーを使用しGoogle アナリティクスによるトラフィックの分析を行っています。
      ご同意いただける場合は「Accept」をクリックしてください。

    cookies:
      analytics: Google Analytics


markdown_extensions:
  - pymdownx.critic
  - pymdownx.caret
  - pymdownx.keys
  - pymdownx.mark
  - pymdownx.tilde
  - meta
  - codehilite
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_code_format
  - admonition
  - pymdownx.details
  - pymdownx.tabbed:
      alternate_style: true
  - tables
  - attr_list
  - md_in_html
  - pymdownx.superfences
  - toc:
      permalink: true
  - def_list
  - pymdownx.tasklist:
      custom_checkbox: true
  - pymdownx.emoji:
      emoji_index: !!python/name:materialx.emoji.twemoji
      emoji_generator: !!python/name:materialx.emoji.to_svg

extra_css:
  - stylesheets/extra.css

nav:
    - 'HOME':
      - 'スタートガイド': './index.md'
      - 'プール構築マニュアル': './setup/0-start-guide.md'
      - 'プール運用マニュアル': './operation/start-guide.md'
      - 'よくある質問': './faq/node.md'
      - '更新履歴': './changelogs.md'
    - 'プール構築マニュアル':
      - '0-はじめに': './setup/0-start-guide.md'
      - '1-Ubuntu初期設定': './setup/1-ubuntu-setup.md'
      - '2-ノードインストール': './setup/2-node-setup.md'
      - '3-リレー/BPの接続': './setup/3-relay-bp-setup.md'
      - '4-BPセットアップ': './setup/4-bp-setup.md'
      - '5-アドレスの作成': './setup/5-generate-address.md'
      - '6-ステークアドレスの登録': './setup/6-register-stakeaddress.md'
      - '7-ステークプールの登録': './setup/7-register-stakepool.md'
      - '8-P2Pトポロジー設定': './setup/8.topology-setup.md'
      - '9.監視ツールセットアップ': './setup/9-monitoring-tools-setup.md'
      - '10.ブロックログセットアップ': './setup/10-blocklog-setup.md'
      - '11.ブロック生成ステータス通知セットアップ': './setup/11-blocknotify-setup.md'
      - '*寄付とクレジット': './setup/99-donation-credit.md'
    - 'プール運用マニュアル':
      - '運用ガイド': './operation/start-guide.md'
      - 'KESの更新': './operation/kes-update.md'
      - 'プール情報の更新': './operation/cert-update.md'
      - 'ノードアップデート': './operation/node-update.md'
      - '資金引き出し': './operation/withdrawal.md'
      - 'プール廃止': './operation/pool-retire.md'
      - 'SJG TOOL': './operation/tool.md'
      - 'SJG修正プログラム': './operation/sjg-fixed.md'
      - 'Linuxコマンド集': './operation/command.md'
    - 'よくある質問':
      - '運用編':
        - 'ノード関連': './faq/node.md'
        - 'ブロックログ関連': './faq/blocklog.md'
        - 'ノード監視関連': './faq/monitoring.md'

@squidfunk
Copy link
Owner

squidfunk commented May 28, 2022

Thanks for coming back. Please provide a minimal reproducible example or I'm not able to look into this. Yes, navigation tabs were slightly refactored to fix #3950 – possibly related. However, I need to know what configuration is triggering this problem.

@btbf
Copy link
Author

btbf commented May 28, 2022

https://github.com/btbf/spojapanguild.git
Is it possible to check here?

@squidfunk squidfunk added bug Issue reports a bug and removed needs reproduction Issue lacks a minimal reproduction .zip file needs input Issue needs further input by the reporter labels May 29, 2022
@squidfunk
Copy link
Owner

Perfect, thanks! I'm now able to reproduce the error.

@squidfunk
Copy link
Owner

Fixed in d644cd2. This was the outcome of a bad merge when navigation pruning was released.

@squidfunk squidfunk added the resolved Issue is resolved, yet unreleased if open label May 29, 2022
@squidfunk squidfunk changed the title Deployment does not complete. Insiders 4.16+: macro 'render' takes not more than 1 argument(s) May 29, 2022
@squidfunk
Copy link
Owner

Released as part of 8.2.16+insiders-4.16.2!

@btbf
Copy link
Author

btbf commented May 30, 2022

Thank you for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants