AnswerDotAI / AnswerDotAI/nbdev

Unwanted `show_doc` Documentation Automatically Added 3x to Rendered HTML

Open
#1,446 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
5.3k
Forks
513
Avg merge
2d 30m
Merged PRs (30d)
8

Description

## Description

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!

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with nbdev_preview using the 01_code.ipynb notebook, then inspect the generated _proc/_docs/core.html.md for the repeated show_doc entries. Compare the generated content with the notebook and run nbdev_clean, nbdev_export, and nbdev_test to identify whether the duplicate documentation is produced during export or rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter, python
Domain
devtools, documentation
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.