Releases: ThibTrip/npdoc_to_md
Releases · ThibTrip/npdoc_to_md
v2.0.1
v2.0
The version 2.0
of npdoc_to_md
is a complete rewrite of the library.
Thanks to drastically improved Python skills I was able to fix many formatting bugs with this library and add a few new features.
Unfortunately, keeping compability with the previous version was just too much work and would have led to an awkward code. Also the current user base seems to be very small and some previous behaviors were rather questionable e.g. removing stuff as a default (remove_doctest_blanklines=True
).
I listed changes in Breaking Changes but I highly suggest you go through the new documentation.
New Features
- Added a CLI
- Added the ability to document members of an object (e.g. class methods) via a new key in placeholders:
"members"
- Added support for custom sections (
numpydoc
ignores them) - Added option
remove_doctest_skip
for removing doctest skip markers# doctest: +SKIP
- Added option
md_section_level
to customize the Markdown title level of the sections in the docstrings - Added new function
npdoc_to_md.render_folder
for rendering a folder of templates
Bugfixes
- Fixed a lot of formatting issues: missing escape characters in signature, irrelevant line breaks, missing line breaks, incorrect detection of blocks in examples...
Documentation
- Made an overhaul of the documentation
Testing
- Switched to GitHub Actions
Breaking Changes
Existing functions that have been changed:
npdoc_to_md.render_md_from_obj_docstring
- The function was renamed to
render_obj_docstring
- Default of parameter
remove_doctest_blanklines
is nowFalse
instead ofTrue
- Parameter
examples_md_flavor
has been renamed toexamples_md_lang
- Parameter
obj_namespace
has been renamed toobj
and there is now a parameteralias
for displaying object names differently than using the namespace
The changes to these parameters also affect placeholders!
npdoc_to_md.render_md_string
- The function was renamed to
render_string
- Parameter
text
was renamed tostring
##npdoc_to_md.render_md_file
- The function was renamed to
render_file
- Returns an instance of
npdoc_to_md.RenderedFile
(ornpdoc_to_md.RenderedFileCLI
when using the CLI) instead ofstr
- Remove parameter
allow_same_path
npdoc_to_md.get_markdown_files_in_dir
- This function was removed. It does not serve much purpose since the introduction of function
npdoc_to_md.render_folder
v1.1
Bugfixes
- Fixed bug with npdoc_to_md's logger that was taking over other loggers (see similar issue in my library pangres)
Improvements
- Custom exception
npdoc_to_md.NonExistentObjectException
for non existent objects - Added function
npdoc_to_md.render_md_string
🎉 to render directly from a markdown string (instead of using a markdown file) - Added more logging for function
render_md_file
v1.0.1
Improvements
- Empty docstrings are now supported! See commit 7d1feeb
- Added
__version__
attribute
v1
Improvements
- Added "remove_doctest_blanklines" argument in the all main functions (except
render_md_file
). It is True by default and when True it replaces<BLANKLINE>
which is used for doctest with an empty string. - Improved logging for errors in function
render_md_file
. It now shows the line number of the error and the name of the file.
Testing
- Instead of a Jupyter Notebook, added a proper script for generating the documentation 👍
Bugfixes
- Problem with "_" not being rendered properly in object names in Markdown outputs fixed. This was done by using HTML escaped code for "_" (
_
). See commit ac4902d