Moved the markdown_table utility function from the Python documentation
generator core module to the utility module. The public exports
definition of the utility module and all imports were updated.
The test module was also moved to the appropriate new path and the
testing functions were renamed.
Moved the _fit_row_length function from the Python generator core module
to fit_row_length in the utility module. The public exports definition
of the utility module and all imports were updated.
The test module was also moved to the appropriate new path and the
testing functions were renamed.
Pipe characters ('|') in Markdown table cells are now replaced with an
escape sequence ('\|') to ensure that cells are not split by Markdown
renderers.
Tests which expected pipe characters to be unescaped, which is
incorrect, were updatedto expect an escape sequence and new test cases
to ensure the correct escaping behavior were added.
Added more strict validation for namespaces names to PythonNamespace
than before and updated error messages.
All tests depending on this were updated to the new behavior.
The path to the directory is now completely resolved in
PythonDocumentationGenerator._namespace to prevent from empty path names
if the path is '.'. A fallback was also added for the case that the path
is '/'; the fallback value is irrelevant as the root namespace name is
not included in the output and only the root package path can be '/'.
Added a force argument to
PythonDocumentationGenerator.generate_documentation to control whether
the content of the output directory should be overwritten or not, if it
is not empty. If the force argument is True, the output directory
content will first be deleted recursively. If it is False and the output
directory is not empty, a DirectoryNotEmptyError will be raised.
The CLI now handles error that may result from user input and prints an
error message. Following error types are handled:
- file not found
- not a directory
- directory instead of file
- file exists
- permission error
- general operating system errors
- Unicode errors
- errors parsing project source code
Additionally, KeyboardInterrupt and BrokenPipeError are catched and an
appropriate exit code is returned.