AnswerDotAI / AnswerDotAI/nbdev

nbdev_preview strips leading digits from directories in `sidebar.yml`, but not in `_docs`

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

Description

As the title suggests, calling `nbdev_preview` with a file inside a directory whose name starts with leading digits (e.g. `00_test`) will result in broken documentation.

## steps to reproduce
Create a new nbdev_project and a `00_test` directory under notebooks.

```bash
nbdev_init
mkdir nbs/00_test
mv nbs/00_core.ipynb nbs/00_test/00_core.ipynb
nbdev_preview
```

will result in the following `sidebar.yml`

```yaml
website:
sidebar:
contents:
- index.ipynb
- section: test
contents:
- test/00_core.ipynb
```

which is broken, as the correct path would be `00_test/00_core.ipynb` (file is under `_proc/00_test/00_core.html.md`). Thus the link in the preview will not work.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.