orzih / mkdocs-with-pdf

Generate a single PDF file from MkDocs repository.
MIT License
332 stars 77 forks source link

Does i18n support multi-language plugin? #70

Open jesshaw opened 3 years ago

jesshaw commented 3 years ago
  - with-pdf:
      copyright: Copyright © Shanghai LianWei Digits Technology Group Co., Ltd.,All Rights Resevered.
      author: Jes.Xiao
      #cover_title:
      cover_subtitle: LIANWEI EES Technical documentation
      cover_logo: assets/lw-logo.png
      back_cover: true
      toc_level: 3
      # excludes_children:
      #   - 'releases/changelog/:upgrading'
      # convert_iframe:
      #   - src: https://streamable.com/e/zmtb00
      #     img: https://cdn-cf-east.streamable.com/image/zmtb00-screenshot75403.jpg
      # two_columns_level: 3
      output_path: ../document.pdf
      #debug_html: true
      #verbose: true
      #show_anchors: true
      enabled_if_env: ENABLE_PDF_EXPORT
      #  headless chrome using 'MathJax', 'Twemoji' or any more.
      render_js: true
      headless_chrome_path: 'C:\Program Files\Google\Chrome\Application\chrome.exe'
  - i18n:
      default_language: en
      default_language_only: false
      languages:
        en: english
        fr: français
      nav_translations:
        fr:
          Home:  Domicile

The result:

mkdocs.exe build
WARNING -  Language 'fr' is not supported by lunr.js, not setting it in the 'plugins.search.lang' option 
INFO    -  Cleaning site directory 
INFO    -  Building documentation to directory: C:\projects\lianwei\framework\lianwei-doc\contents\site 
Traceback (most recent call last):
  File "c:\python39\lib\runpy.py", line 197, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\python39\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Python39\Scripts\mkdocs.exe\__main__.py", line 7, in <module>
  File "c:\python39\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\python39\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\python39\lib\site-packages\click\core.py", line 1259, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\python39\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\python39\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\python39\lib\site-packages\mkdocs\__main__.py", line 152, in build_command
    build.build(config.load_config(**kwargs), dirty=not clean)
  File "c:\python39\lib\site-packages\mkdocs\commands\build.py", line 261, in build
    files = config['plugins'].run_event('files', files, config=config)
  File "c:\python39\lib\site-packages\mkdocs\plugins.py", line 94, in run_event
    result = method(item, **kwargs)
  File "c:\python39\lib\site-packages\mkdocs_static_i18n\plugin.py", line 367, in on_files
    self.i18n_configs[language] = deepcopy(config)
  File "c:\python39\lib\copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "c:\python39\lib\copy.py", line 270, in _reconstruct
    state = deepcopy(state, memo)
  File "c:\python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "c:\python39\lib\copy.py", line 230, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "c:\python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "c:\python39\lib\copy.py", line 230, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "c:\python39\lib\copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "c:\python39\lib\copy.py", line 270, in _reconstruct
    state = deepcopy(state, memo)
  File "c:\python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "c:\python39\lib\copy.py", line 230, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "c:\python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "c:\python39\lib\copy.py", line 230, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "c:\python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "c:\python39\lib\copy.py", line 205, in _deepcopy_list
    append(deepcopy(a, memo))
  File "c:\python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "c:\python39\lib\copy.py", line 237, in _deepcopy_method
    return type(x)(x.__func__, deepcopy(x.__self__, memo))
  File "c:\python39\lib\copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "c:\python39\lib\copy.py", line 270, in _reconstruct
    state = deepcopy(state, memo)
  File "c:\python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "c:\python39\lib\copy.py", line 230, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "c:\python39\lib\copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "c:\python39\lib\copy.py", line 270, in _reconstruct
    state = deepcopy(state, memo)
  File "c:\python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "c:\python39\lib\copy.py", line 230, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "c:\python39\lib\copy.py", line 161, in deepcopy
    rv = reductor(4)
TypeError: cannot pickle 'module' object

Thanks a lot!

orzih commented 3 years ago

Not yet supported. And, we have a PR for this issue.

See https://github.com/mkdocs/mkdocs/pull/2487

liya2017 commented 1 year ago

mkdocs/mkdocs#2487

This issue was closed , but i18n still not support multi-language plugin,right?