autowarefoundation / autoware.universe

https://autowarefoundation.github.io/autoware.universe/
Apache License 2.0
952 stars 620 forks source link

Remove warnings/errors from Autoware.Universe Documentation #8341

Open mitsudome-r opened 1 month ago

mitsudome-r commented 1 month ago

Checklist

Description

Autoware.Universe documentation is hosted in https://autowarefoundation.github.io/autoware.universe/main/ with mkdocs, but some pages outputs warnings and errors when mkdocs build is executed. We should remove these for the health of documentation.

Purpose

Remove errors/warnings from our documentation page.

Possible approaches

Run mkdocs build locally and fix the errors one by one.

Definition of done

All errors and warnings are removed from mkdocs build.

mitsudome-r commented 1 month ago

I'm currently seeing errors like the following, which comes from the scripts that converts json schema into a markdown table.

INFO     -  [macros] - ERROR # _Macro Rendering Error_

            _File_: `system/autoware_processing_time_checker/README.md`

            _KeyError_: 'default'
        Traceback (most recent call last):
          File "/home/mitsudome-r/.local/lib/python3.10/site-packages/mkdocs_macros/plugin.py", line 527, in render
            return md_template.render(**page_variables)
          File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1291, in render
            self.environment.handle_exception()
          File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 925, in handle_exception
            raise rewrite_traceback_stack(source=source)
          File "<template>", line 32, in top-level template code
          File "/home/mitsudome-r/autoware.test/src/universe/autoware.universe/mkdocs_macros.py", line 72, in json_to_markdown
            return format_json(data)
          File "/home/mitsudome-r/autoware.test/src/universe/autoware.universe/mkdocs_macros.py", line 63, in format_json
            markdown_table = tabulate(extract_parameter_info(parameters), headers="keys", tablefmt="github")
          File "/home/mitsudome-r/autoware.test/src/universe/autoware.universe/mkdocs_macros.py", line 52, in extract_parameter_info
            param["Default"] = v["default"]
        KeyError: 'default'

        ```

INFO - [macros] - ERROR # Macro Rendering Error

        _File_: `system/bluetooth_monitor/README.md`

        _FileNotFoundError_: [Errno 2] No such file or directory: 'system/bluetooth_monitor/schema/bluetooth_monitor.schema.json'

        ```
        Traceback (most recent call last):
          File "/home/mitsudome-r/.local/lib/python3.10/site-packages/mkdocs_macros/plugin.py", line 527, in render
            return md_template.render(**page_variables)
          File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1291, in render
            self.environment.handle_exception()
          File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 925, in handle_exception
            raise rewrite_traceback_stack(source=source)
          File "<template>", line 49, in top-level template code
          File "/home/mitsudome-r/autoware.test/src/universe/autoware.universe/mkdocs_macros.py", line 70, in json_to_markdown
            with open(json_schema_file_path) as f:
        FileNotFoundError: [Errno 2] No such file or directory: 'system/bluetooth_monitor/schema/bluetooth_monitor.schema.json'

        ```