You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using nbdev to write a Python package, I've encountered an issue possibly associated with the nbdev_export command:
Running nbdev_preview to check the rendered HTML version of my source code for documentation results in the documentation for show_doc being automatically added three times to the very end of the rendered HTML page. The same is true for the published page with source code on GitHub pages
This occurs even though the built-in nbdev show_doc function has not been imported or used in the Jupyter notebook containing my source code (named 01_code.ipynb, following the nbdev documentation).
The markdown for show_doc appears in the local markdown file _proc/_docs/core.html.md located in my project's root directory and in the published page on GitHub pages:
Current Behavior
The show_doc documentation is automatically added three times to the end of the rendered HTML and markdown files.
Expected Behavior
The rendered HTML and markdown files should only contain documentation for the code actually present in the source notebook.
Attempted Solutions
Ran nbdev_clean (no effect on this issue).
Re-ran nbdev_export (doesn't fix the issue).
All tests run successfully with nbdev_test.
Ensured no mixing of import statements with actual code (known to cause issues with nbdev).
Any suggestions to fix this would be greatly appreciated. Thank you!
The text was updated successfully, but these errors were encountered:
I’ve been able to identify the cause for the issue #1446 described earlier. In brief, in my source code, I have defined a decorator function, named add_to_cass, that allows adding methods to an existing Assistantclass dynamically. For each method where this add_to_classdecorator is being used to extend the Assistantclass, the show_doc documentation is being added to my source code documentation page.
I have created a minimal reproduction of the affected repo, which can be found here. I was able to remove the unwanted show_doc documentation by commenting-out the respective methods; see commit 31ccd5d. Then I reproduced the issue by uncommenting one of the methods, see commit 77ecfcb.
Any suggestions how to avoid the show_doc documentation being automatically rendered while keeping my existing source code? I could certainly refactor my code so that all class methods are defined in one place as a workaround. However, ideally I would like to keep the option to dynamically add class methods using my existing add_to_classdecorator function.
Description
When using nbdev to write a Python package, I've encountered an issue possibly associated with the
nbdev_export
command:nbdev_preview
to check the rendered HTML version of my source code for documentation results in the documentation forshow_doc
being automatically added three times to the very end of the rendered HTML page. The same is true for the published page with source code on GitHub pagesshow_doc
function has not been imported or used in the Jupyter notebook containing my source code (named01_code.ipynb
, following the nbdev documentation).show_doc
appears in the local markdown file_proc/_docs/core.html.md
located in my project's root directory and in the published page on GitHub pages:Current Behavior
The
show_doc
documentation is automatically added three times to the end of the rendered HTML and markdown files.Expected Behavior
The rendered HTML and markdown files should only contain documentation for the code actually present in the source notebook.
Attempted Solutions
nbdev_clean
(no effect on this issue).nbdev_export
(doesn't fix the issue).nbdev_test
.Any suggestions to fix this would be greatly appreciated. Thank you!
The text was updated successfully, but these errors were encountered: