Npdoc-to-md

Latest version: v2.0.1

Safety actively analyzes 620930 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

2.0.1

Bugfixes
* Fixed bug where a superfluous code block would appear in the examples (see commit 82f6804)

2.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](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](https://docs.python.org/3/library/doctest.html#doctest.SKIP) ` 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 now `False` instead of `True`
* Parameter `examples_md_flavor` has been renamed to `examples_md_lang`
* Parameter `obj_namespace` has been renamed to `obj` and there is now a parameter `alias` 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 to `string`

`npdoc_to_md.render_md_file`

* The function was renamed to `render_file`
* Returns an instance of `npdoc_to_md.RenderedFile` (or `npdoc_to_md.RenderedFileCLI` when using the CLI) instead of `str`
* 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`

1.1

Bugfixes
* Fixed bug with npdoc_to_md's logger that was taking over other loggers (see [similar issue](https://github.com/ThibTrip/pangres/issues/20) in my library pangres)

Improvements
* Custom exception <code>npdoc_to_md.NonExistentObjectException</code> for non existent objects
* Added function <code>npdoc_to_md.render_md_string</code> :tada: to render directly from a markdown string (instead of using a markdown file)
* Added more logging for function <code>render_md_file</code>

1.0.1

Improvements
* **Empty docstrings** are now supported! See [commit 7d1feeb](https://github.com/ThibTrip/npdoc_to_md/commit/7d1feeb57a951eae6b633e10ecb9e761d19ad629)
* Added <code>\_\_version\_\_</code> attribute

v1
Improvements
* Added "remove_doctest_blanklines" argument in the all main functions (except <code>render_md_file</code>). It is True by default and when True it replaces <code>\<BLANKLINE\></code> which is used for [doctest](https://docs.python.org/3.8/library/doctest.html#how-are-docstring-examples-recognized) with an empty string.
* Improved logging for errors in function <code>render_md_file</code>. 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 :+1:

Bugfixes
* Problem with "\_" not being rendered properly in object names in Markdown outputs fixed. This was done by using HTML escaped code for "\_" (<code>\&95;</code>). See commit [ac4902d](https://github.com/ThibTrip/npdoc_to_md/commit/ac4902d93cee37a10345c7d3597ddc59a53ce0e2)

0.3

Bugfixes

* Fixed bug of summary not showing

Changes for developers

* Testing improved! Added rigorous content check with pytest.

0.2

Links

Releases

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.