Skip to content

ISSUE-3924 Bumps mkdocs and associated tools #4024

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

Closed

Conversation

schuylermartin45
Copy link

This attempts to fix #3942 by way of upgrading mkdocs and the associated dependencies. As I mentioned in the issue, it looks like the hamburger menu glitch has been fixed in mkdocs-material upstream.

NOTE
I have been unable to test this change. I currently cannot get past an issue with plantuml when I attempt to run the docs with the suggested:

make install_venv serve -C docs/mkdocs

Here is the issue. I get this error on both MacOS and a Ubuntu machine no matter which branch I am on. I don't see any mention of anyone else encountering this in another GitHub issue:

Exception: Failed to run plantuml: [Errno 2] No such file or directory: 'plantuml'
make: *** [serve] Error 1

But in the spirit of FOSS Friday, I wanted to get a PR up anyways. I was at least able to determine a cascading set of version number dependencies and I don't want to lose that effort.

Cheers!


Pull request checklist

Read the Contribution Guidelines for detailed information.

  • [ x] Changes are described in the pull request, or an existing issue is referenced.
  • [n/a? ] The test suite compiles and runs without error.
  • [ n/a?] Code coverage is 100%. Test cases can be added by editing the test suite.
  • [ n/a] The source code is amalgamated; that is, after making changes to the sources in the include/nlohmann directory, run make amalgamate to create the single-header files single_include/nlohmann/json.hpp and single_include/nlohmann/json_fwd.hpp. The whole process is described here.

Please don't

  • The C++11 support varies between different compilers and versions. Please note the list of supported compilers. Some compilers like GCC 4.7 (and earlier), Clang 3.3 (and earlier), or Microsoft Visual Studio 13.0 and earlier are known not to work due to missing or incomplete C++11 support. Please refrain from proposing changes that work around these compiler's limitations with #ifdefs or other means.
  • Specifically, I am aware of compilation problems with Microsoft Visual Studio (there even is an issue label for this kind of bug). I understand that even in 2016, complete C++11 support isn't there yet. But please also understand that I do not want to drop features or uglify the code just to make Microsoft's sub-standard compiler happy. The past has shown that there are ways to express the functionality such that the code compiles with the most recent MSVC - unfortunately, this is not the main objective of the project.
  • Please refrain from proposing changes that would break JSON conformance. If you propose a conformant extension of JSON to be supported by the library, please motivate this extension.
  • Please do not open pull requests that address multiple issues.

This attempts to fix nlohmann#3942 by way of upgrading `mkdocs` and the associated
dependencies. As I mentioned in the issue, it looks like the hamburger menu
glitch has been fixed in `mkdocs-material` upstream.

**NOTE**
I have been unable to test this change. I currently cannot get past an issue
with `plantuml` when I attempt to run the docs with the suggested:
```sh
make install_venv serve -C docs/mkdocs
```

Here is the issue. I get this error on both MacOS and a Ubuntu machine no
matter which branch I am on. I don't see any mention of anyone else
encountering this in another GitHub issue:
```
Exception: Failed to run plantuml: [Errno 2] No such file or directory: 'plantuml'
make: *** [serve] Error 1
```

But in the spirit of FOSS Friday, I wanted to get a PR up anyways. I was at
least able to determine a cascading set of version number dependencies and I
don't want to lose that effort.

Cheers!
@schuylermartin45
Copy link
Author

Here is the full error log from serve:
I'm guessing some binary from plantuml_markdown.py isn't being pulled correctly down? Maybe there's another missing dependency or some assumed file that needs to be installed globally? But this happens on develop and the latest tagged release.

cp -r ../examples/*.cpp ../examples/*.output docs/examples
------------------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------------------------
venv/bin/mkdocs serve
INFO     -  Building documentation...
INFO     -  Cleaning site directory
ERROR    -  Error reading page 'api/basic_json/exception.md': Failed to run plantuml: [Errno 2] No such file
            or directory: 'plantuml'
Traceback (most recent call last):
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/plantuml_markdown.py", line 438, in _render_local_uml_image
    p = Popen(cmdline, stdin=PIPE, stdout=PIPE, stderr=PIPE, shell=(os.name == 'nt'))
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'plantuml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/bin/mkdocs", line 8, in <module>
    sys.exit(cli())
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/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 "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/mkdocs/commands/serve.py", line 83, in serve
    builder(config)
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/mkdocs/commands/serve.py", line 76, in builder
    build(config, live_server=live_server, dirty=dirty)
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/mkdocs/commands/build.py", line 308, in build
    _populate_page(file.page, config, files, dirty)
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/mkdocs/commands/build.py", line 181, in _populate_page
    page.render(config, files)
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/mkdocs/structure/pages.py", line 270, in render
    self.content = md.convert(self.markdown)
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/markdown/core.py", line 261, in convert
    self.lines = prep.run(self.lines)
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/plantuml_markdown.py", line 154, in run
    text1, idx1 = self._replace_block(text[idx:])
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/plantuml_markdown.py", line 217, in _replace_block
    diagram, err = self._render_diagram(code, requested_format)
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/plantuml_markdown.py", line 359, in _render_diagram
    diagram, err = self._render_local_uml_image(code, requested_format)
  File "/Users/smartin/foss_friday/json/docs/mkdocs/venv/lib/python3.9/site-packages/plantuml_markdown.py", line 441, in _render_local_uml_image
    raise Exception(f'Failed to run plantuml: {exc}')
Exception: Failed to run plantuml: [Errno 2] No such file or directory: 'plantuml'
make: *** [serve] Error 1

@coveralls
Copy link

Coverage Status

Coverage: 100.0%. Remained the same when pulling 64a8c59 on schuylermartin45:issue3942 into 6af826d on nlohmann:develop.

@schuylermartin45
Copy link
Author

It looks like I needed to brew install plantuml/sudo apt-get install -y plantuml to get past that error message.

Unfortunately, pulling the latest version of mkdocs-material does not appear to fix the issue with the hamburger menu, as was suggested by the closed issue tagged above. I will close this PR for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The website's hamburger menu opens to the home menu
2 participants