You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thanks a lot for this great package!
I use another package that requires the option --config-file to bet set when building the documentation using mkdocs build --config-file mkdocs.yml. Unfortunately, in this case, a value error is reported ValueError: The project root dir is ambiguous ! Please report this issue to mkdocs-gallery.
In particular, when providing the absolute path mkdocs serve --config-file /workspaces/mkdocs-gallery/mkdocs.yml in noxfile.py instead of mkdocs serve, everything works as expected when running nox -s docs within the folder /workspaces/mkdocs-gallery/. However, when changing it to mkdocs serve --config-file mkdocs.yml, I get the following error:
nox -s docs
nox > Running session docs-3.9
nox > Re-using existing virtual environment at .nox/docs-3-9.
nox >
A `pyproject.toml` file exists. Loading it.
nox >
About to install *docs* requirements: ['mkdocs', 'matplotlib', 'seaborn', 'statsmodels', 'plotly', 'pillow'].
Conda pkgs are ()
nox > [docs] Installing requirements with pip: ['mkdocs', 'matplotlib', 'seaborn', 'statsmodels', 'plotly', 'pillow']
nox > python -m pip install mkdocs matplotlib seaborn statsmodels plotly pillow
nox > python -m pip install .
nox > mkdocs serve --config-file mkdocs.yml
INFO - Building documentation...
WARNING - Please install 'memory_profiler' to enable peak memory measurements.
WARNING - optipng binaries not found, PNG images and thumbnails will not be optimized
INFO - generating gallery...
Traceback (most recent call last):
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/bin/mkdocs", line 8, in <module>
sys.exit(cli())
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
return self.main(*args, **kwargs)
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/click/core.py", line 1055, in main
rv = self.invoke(ctx)
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/click/core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/mkdocs/__main__.py", line 234, in serve_command
serve.serve(dev_addr=dev_addr, livereload=livereload, watch=watch, **kwargs)
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/mkdocs/commands/serve.py", line 83, in serve
builder(config)
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/mkdocs/commands/serve.py", line 76, in builder
build(config, live_server=live_server, dirty=dirty)
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/mkdocs/commands/build.py", line 273, in build
config.plugins.run_event('pre_build', config=config)
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/mkdocs/plugins.py", line 522, in run_event
result = method(**kwargs)
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/mkdocs_gallery/plugin.py", line 263, in on_pre_build
galleries_tocs, self.md_to_src = generate_gallery_md(self.config, config)
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/mkdocs_gallery/gen_gallery.py", line 418, in generate_gallery_md
all_info = AllInformation.from_cfg(gallery_conf, mkdocs_conf)
File "/workspaces/mkdocs-gallery/.nox/docs-3-9/lib/python3.9/site-packages/mkdocs_gallery/gen_data_model.py", line 905, in from_cfg
raise ValueError("The project root dir is ambiguous ! Please report this issue to mkdocs-gallery.")
ValueError: The project root dir is ambiguous ! Please report this issue to mkdocs-gallery.
nox > Command mkdocs serve --config-file mkdocs.yml failed with exit code 1
nox > Session docs-3.9 failed.
I think the main problem is Path(mkdocs_conf['config_file_path']).parent in gen_data_model.py to get the project root, which is . if mkdocs serve --config-file mkdocs.yml was executed. The same is true for plugin.py.
Hi,
First of all, thanks a lot for this great package!
I use another package that requires the option
--config-file
to bet set when building the documentation usingmkdocs build --config-file mkdocs.yml
. Unfortunately, in this case, a value error is reportedValueError: The project root dir is ambiguous ! Please report this issue to mkdocs-gallery.
In particular, when providing the absolute path
mkdocs serve --config-file /workspaces/mkdocs-gallery/mkdocs.yml
in noxfile.py instead ofmkdocs serve
, everything works as expected when runningnox -s docs
within the folder/workspaces/mkdocs-gallery/
. However, when changing it tomkdocs serve --config-file mkdocs.yml
, I get the following error:I think the main problem is
Path(mkdocs_conf['config_file_path']).parent
in gen_data_model.py to get the project root, which is.
ifmkdocs serve --config-file mkdocs.yml
was executed. The same is true for plugin.py.I've created #64 to circumvent this path issue.
The text was updated successfully, but these errors were encountered: