Skip to content

Document building problem #3085

Closed
Closed
@mirsakhawathossain

Description

@mirsakhawathossain

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

When I try to build doc using Python 3.8.5 it shows following error

Error: MkDocs encountered an error parsing the configuration file: while constructing a Python object cannot find module 'materialx.emoji' (No module named 'material') in "/root/bangla-ml/mkdocs.yml", line 129, column 20
and often error shows

Traceback (most recent call last): File "/usr/local/bin/mkdocs", line 8, in <module> sys.exit(cli()) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1137, in __call__ return self.main(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1062, in main rv = self.invoke(ctx) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1668, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/usr/local/lib/python3.8/dist-packages/click/core.py", line 763, in invoke return __callback(*args, **kwargs) File "/usr/local/lib/python3.8/dist-packages/mkdocs/__main__.py", line 183, in build_command build.build(config.load_config(**kwargs), dirty=not clean) File "/usr/local/lib/python3.8/dist-packages/mkdocs/commands/build.py", line 298, in build _build_theme_template(template, env, files, config, nav) File "/usr/local/lib/python3.8/dist-packages/mkdocs/commands/build.py", line 111, in _build_theme_template output = _build_template(template_name, template, files, config, nav) File "/usr/local/lib/python3.8/dist-packages/mkdocs/commands/build.py", line 90, in _build_template output = template.render(context) File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render return original_render(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render return self.environment.handle_exception(exc_info, True) File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception reraise(exc_type, exc_value, tb) File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise raise value.with_traceback(tb) File "/usr/local/lib/python3.8/dist-packages/material/404.html", line 4, in <module> {% extends "main.html" %} File "/usr/local/lib/python3.8/dist-packages/material/main.html", line 4, in <module> {% extends "base.html" %} File "/usr/local/lib/python3.8/dist-packages/material/base.html", line 130, in <module> {% block site_nav %} File "/usr/local/lib/python3.8/dist-packages/material/base.html", line 138, in <module> {% include "partials/nav.html" %} File "/usr/local/lib/python3.8/dist-packages/material/partials/nav.html", line 27, in <module> {% include "partials/nav-item.html" %} File "/usr/local/lib/python3.8/dist-packages/material/partials/nav-item.html", line 89, in <module> {{ render(nav_item, path, level) }} File "/usr/lib/python3/dist-packages/jinja2/runtime.py", line 583, in _invoke rv = self._func(*arguments) File "/usr/local/lib/python3.8/dist-packages/material/partials/nav-item.html", line 10, in <module> {% if "navigation.sections" in features and level == 1 + ( TypeError: unsupported operand type(s) for +: 'int' and 'str'

Expected behaviour

Document building

Actual behaviour

Error

Steps to reproduce

Try to build doc from this file Gitlab File

Package versions

  • Python: python 3.8.5
  • MkDocs: mkdocs 1.2.2
  • Material: 7.3.1

Configuration

# Copyright (c) 2021-2050 Mir Sakhawat Hossain <s.hossain18@gmail.com>

# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:

# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.

# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

# Project information
site_name: Bangla ML
site_url: https://banglaml.github.io
site_author: Mir Sakhawat Hossain
site_description: >-
  Bangla ML is a Website where anyone can find tutorials and resources about Data Science and Machine Learning.

# Repository
repo_name: mirsakhawathossain/bangla-ml
repo_url: https://gitlab.com/mirsakhawathossain/bangla-ml
edit_uri: ""

# Copyright
copyright: Copyright &copy; 2021 - 2050 Mir Sakhawat Hossain

# Configuration
theme:
  name: material
#  custom_dir: !ENV [THEME_DIR, "material"]

  # Static files
  static_templates:
    - 404.html

  # Don't include MkDocs' JavaScript
  include_search_page: false
  search_index_only: true

  # Default values, taken from mkdocs_theme.yml
  language: bn
  features:
    - content.code.annotate
    - content.tabs.link
    # - header.autohide
    # - navigation.expand
    # - navigation.indexes
    # - navigation.instant
    - navigation.sections
    - navigation.tabs
    # - navigation.tabs.sticky
    - navigation.top
    - navigation.tracking
    - search.highlight
    - search.share
    - search.suggest
    # - toc.integrate
  palette:
    - scheme: default
      primary: indigo
      accent: indigo
      toggle:
        icon: material/toggle-switch-off-outline
        name: Switch to dark mode
    - scheme: slate
      primary: red
      accent: red
      toggle:
        icon: material/toggle-switch
        name: Switch to light mode
  font:
    text: Roboto
    code: Roboto Mono
  favicon: assets/favicon.png
  icon:
    logo: logo
# Plugins
plugins:
  - search
  - minify:
      minify_html: true
  - macros
# Customization
extra:
  analytics:
    provider: google
    property: G-EP625L7V4G
  social:
    - icon: fontawesome/brands/github
      link: https://github.com/mirsakhawathossain/
#    - icon: fontawesome/brands/gitter
#      link: https://gitter.im/squidfunk/mkdocs-material
#    - icon: fontawesome/brands/docker
#      link: https://hub.docker.com/r/squidfunk/mkdocs-material/
    - icon: fontawesome/brands/twitter
      link: https://twitter.com/s_hossain18
    - icon: fontawesome/brands/linkedin
      link: https://linkedin.com/in/mirsakhawathossain/
    - icon: fontawesome/brands/instagram
      link: https://instagram.com/mir_sakhawat_hossain

# Extensions
markdown_extensions:
  - admonition
  - abbr
  - attr_list
  - def_list
  - footnotes
  - meta
  - md_in_html
  - toc:
      permalink: true
  - pymdownx.arithmatex:
      generic: true
  - pymdownx.betterem:
      smart_enable: all
  - pymdownx.caret
  - pymdownx.details
  - pymdownx.emoji:
      emoji_index: !!python/name:materialx.emoji.twemoji
      emoji_generator: !!python/name:materialx.emoji.to_svg
  - pymdownx.highlight
  - pymdownx.inlinehilite
  - pymdownx.keys
  - pymdownx.magiclink:
      repo_url_shorthand: true
      user: squidfunk
      repo: mkdocs-material
  - pymdownx.mark
  - pymdownx.smartsymbols
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid-experimental
          format: !!python/name:pymdownx.superfences.fence_code_format
  - pymdownx.tabbed
  - pymdownx.tasklist:
      custom_checkbox: true
  - pymdownx.tilde

# Page tree
nav:
  - সূচনা: index.md
  - প্রবন্ধ:
    - মেশিন লার্নিং: Article/MachineLearning.md
    - পাইথন ও কৃত্রিম বুদ্ধিমত্তা: Article/AIPython.md
  - টিউটোরিয়াল:
    - পাইথন: Tutorial/PythonBasic.md
  - গণিত:
    - র‌্যান্ডম ফরেস্ট: Math/RandomForest.md
  - গবেষণাপত্র:
    - গবেষণা: ResearchPaper/ResearchPaper.md
extra_javascript:
  - javascripts/config.js
  - https://polyfill.io/v3/polyfill.min.js?features=es6
  - https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js

System information

  • Operating system: UBUNTU 20.04
  • Browser: Firefox

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions