Issue with nbdev show_doc / nbdev_export

Hi there!

I am using nbdev to write a software package and encountered the following issue, which is possibly associated with the nbdev_export command: When I run nbdev_preview to check the rendered html version of my source code for documentation, the documentation for show_doc has automatically been added three times to the very end of the rendered html page with my source code, even though the built-in nbdev show_doc function has not been imported or used in the jupyter notebook with my source code (which is named 01_code.ipynb, following the nbdev documentation). I can see the markdown for show_doc (3 times!) in the markdown file in _proc/_docs/core.html.md located in my project’s root directory, but I am reluctant to manually edit this file (and the associated _proc/_docs/core.html file) as it is automatically generated, to my understanding, when running nbdev_export. Does anybody of you have any suggestions how to prevent that the documentation for nbdev’s show_doc function is automatically added to the documentation/markdown of my own source code? Or how to properly remove it after my source code has been exported? My tests all run successfully (with nbdev_test) and I am pretty sure I don’t mix any import statements with actual code, which is known to cause issues with nbdev. Running nbdev_clean has no effect on this issue, and re-running nbdev_export doesn’t fix it either.

Manny thanks in advance!

Thank you for your feedback and detailed suggestions!

I’ve carefully gone through each point but none of them was the root cause in my case. I also confirmed this by running the following bash command from the root of my project repo:
grep -rni --include="*.ipynb" --include="*.md" "show_doc" nbs/ produces no output. However, the following command showed several lines in files within the _procdirectory, including the redundant show_doc documentation:
grep -rni --include="*.ipynb" --include="*.md" "show_doc" _proc

In the meantime, I’ve been able to identify the root cause. In brief, in my source code, I have defined a decorator function, named add_to_cass, that allows adding methods to an existing Assistant class dynamically. For each method where this add_to_class decorator is being used to extend the Assistant class, the show_doc documentation is being added to my source code documentation page.

I have opened issue #1446, which can be found here, in case anybody else is experiencing a similar issue.

Thanks again!