jdoiro3 / mkdocs-multirepo-plugin

Build documentation in multiple repos into one site.
MIT License
126 stars 47 forks source link

Unable to get mkdocs multi repo working in windows #105

Open maitrey opened 1 year ago

maitrey commented 1 year ago

Hi,

I am using python-3.6.5 and when I use the import statement in my config nav section it throws errors like this:

> mkdocs serve
INFO     -  Building documentation...
ERROR    -  Could not load theme handler readthedocs: No module named 'mkdocs_with_pdf.themes.readthedocs'
WARNING  -  Multirepo plugin is ignoring plugins.multirepo.repos. Nav takes precedence.
INFO     -  Multirepo plugin importing docs...
🔳 microservice
Traceback (most recent call last):
  File "c:\tools\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\tools\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Tools\Python\Python36\Scripts\mkdocs.exe\__main__.py", line 7, in <module>
  File "c:\tools\python\python36\lib\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "c:\tools\python\python36\lib\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "c:\tools\python\python36\lib\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\tools\python\python36\lib\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\tools\python\python36\lib\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "c:\tools\python\python36\lib\site-packages\mkdocs\__main__.py", line 181, in serve_command
    serve.serve(dev_addr=dev_addr, livereload=livereload, watch=watch, **kwargs)
  File "c:\tools\python\python36\lib\site-packages\mkdocs\commands\serve.py", line 63, in serve
    config = builder()
  File "c:\tools\python\python36\lib\site-packages\mkdocs\commands\serve.py", line 58, in builder
    build(config, live_server=live_server, dirty=dirty)
  File "c:\tools\python\python36\lib\site-packages\mkdocs\commands\build.py", line 257, in build
    config = config['plugins'].run_event('config', config)
  File "c:\tools\python\python36\lib\site-packages\mkdocs\plugins.py", line 102, in run_event
    result = method(item, **kwargs)
  File "c:\tools\python\python36\lib\site-packages\mkdocs_multirepo_plugin\plugin.py", line 310, in on_config
    config = self.handle_nav_import(config)
  File "c:\tools\python\python36\lib\site-packages\mkdocs_multirepo_plugin\plugin.py", line 180, in handle_nav_import   
    asyncio_run(batch_import(repos, keep_docs_dir=keep_docs_dir))
  File "c:\tools\python\python36\lib\site-packages\mkdocs_multirepo_plugin\util.py", line 117, in asyncio_run
    loop.run_until_complete(futures)
  File "c:\tools\python\python36\lib\asyncio\base_events.py", line 468, in run_until_complete
    return future.result()
  File "c:\tools\python\python36\lib\site-packages\mkdocs_multirepo_plugin\structure.py", line 424, in batch_import     
    keep_docs_dir=keep_docs_dir,
  File "c:\tools\python\python36\lib\site-packages\mkdocs_multirepo_plugin\structure.py", line 412, in batch_execute    
    repo = await future
  File "c:\tools\python\python36\lib\asyncio\tasks.py", line 458, in _wait_for_one
    return f.result()  # May raise f.exception().
  File "c:\tools\python\python36\lib\site-packages\mkdocs_multirepo_plugin\structure.py", line 381, in import_docs      
    await self.sparse_clone([docs_dir, self.config] + self.extra_imports)
  File "c:\tools\python\python36\lib\site-packages\mkdocs_multirepo_plugin\structure.py", line 193, in sparse_clone     
    await execute_bash_script("sparse_clone.sh", args, self.temp_dir)
  File "c:\tools\python\python36\lib\site-packages\mkdocs_multirepo_plugin\util.py", line 98, in execute_bash_script    
    stderr=asyncio.subprocess.PIPE,
  File "c:\tools\python\python36\lib\asyncio\subprocess.py", line 225, in create_subprocess_exec
    stderr=stderr, **kwds)
  File "c:\tools\python\python36\lib\asyncio\base_events.py", line 1192, in subprocess_exec
    bufsize, **kwargs)
  File "c:\tools\python\python36\lib\asyncio\coroutines.py", line 212, in coro
    res = func(*args, **kw)
  File "c:\tools\python\python36\lib\asyncio\base_events.py", line 341, in _make_subprocess_transport
    raise NotImplementedError
NotImplementedError

And this i show mkdocs.yml looks:

site_name: My Documentation
theme: 'readthedocs'
edit_uri: /blob/main/

plugins:
  - search
  - with-pdf
  - mkdocstrings
  - glightbox:
       touchNavigation: true
       loop: false
       effect: zoom
       slide_effect: slide
       width: 100%
       height: auto
       zoomable: true
       draggable: true
       skip_classes:
         - custom-skip-class-name
       auto_caption: false
       caption_position: bottom
  - multirepo:
      # (optional) tells multirepo to cleanup the temporary directory after site is built.cleanup: true
      # if set the docs directory will not be removed when importing docs.
      # When using this with a nav section in an imported repo you must keep the
      # docs directory in the path (e.g., docs/path/to/file.md).
      #keep_docs_dir: true
      cleanup: True
      # if set the docs directory will not be removed when importing docs. When using this with a nav section in an imported repo
      # you must keep the docs directory in the path (e.g., docs/path/to/file.md).
      keep_docs_dir: true

nav:
  - Home: 'index.md'
  - MicroService: '!import {https://github.com/bootstrap}?branch={feature/small-adaptations}&docs_dir={docs/*}&multi_docs={True}&config={mkdocs}.yml&keep_docs_dir={True}'
  - User Guide:
    - GitHub: 
      - 'GitHub App: JenkinsConnector': 'User-Guide/GitHub/JenkinsConnector.md'
    - Jenkins:
      - 'SetUpJenkinsNode': 'User-Guide/Jenkins/SetUpJenkinsNode.md'
      - 'JenkinsInfrastructure': 'User-Guide/Jenkins/JenkinsInfrastructure.md' 

And in the bootstrap repo the yaml look slike this:

site_name: 'My Documentation'
site_description: 'Main documentation for bootstrap repo'
repo_url: https://github.com/bootstrap/tree/feature/small-adaptations
theme: 'readthedocs'
edit_uri: '?query=root/path/docs/'
nav:
  - Overview: 'index.md'

Could you please help me what am I doing wrong? I tried the other methods, none of them seem to show me the documentation from bootstrap repo.

maitrey commented 1 year ago

https://github.com/jdoiro3/mkdocs-multirepo-plugin/blob/main/mkdocs_multirepo_plugin/util.py#L93 -> This seems to be the problem , I am using windows.

charlie430 commented 6 months ago

https://github.com/jdoiro3/mkdocs-multirepo-plugin/blob/main/mkdocs_multirepo_plugin/util.py#L93 -> This seems to be the problem , I am using windows.

What would the underlying issue with that and how would it be fixed?