Skip to content

use .qmd as as full replacement of .ipynb #1461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tatakof opened this issue Oct 19, 2024 · 1 comment
Open

use .qmd as as full replacement of .ipynb #1461

tatakof opened this issue Oct 19, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@tatakof
Copy link

tatakof commented Oct 19, 2024

hello!

wanted to know if it's possible to use only .qmd files for a full nbdev project (no .ipynb, all the code on .qmd) using nbdev's directives like so:


```{python}
#| default_exp core

\```

<some markdown>

```{python}
#| hide
from nbdev.showdoc import *

\```

<some markdown>

```{python}
#| export
def foo(): pass

\```

```{python}
#| hide
import nbdev; nbdev.nbdev_export()

\```
        

and get a result package with a core.py containing foo()

cheers,
Francis

@tatakof tatakof added the bug Something isn't working label Oct 19, 2024
@bhoov
Copy link

bhoov commented Jun 6, 2025

I've taken a stab at this issue in #1521. Feel free to try it out leave some comments in the PR if you have any issues:

pip install -U "git+https://github.com/bhoov/nbdev.git@qmd_support"

Then create a new .qmd file in your existing project with exports, docs, and tests. Alternatively, you can convert your entire .ipynb codebase to .qmd files following the tutorial section "Convert existing .ipynb codebase to .qmd":

  1. Run nbdev_ipynb_to_qmd nbs nbs_qmd && mv nbs nbs_ipynb && mv nbs_qmd nbs to convert your .ipynb files to .qmd files (feel free to rm -r nbs_ipynb)
  2. Update the readme_nb in settings.ini to be the new .qmd file
  3. Run nbdev_prepare

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants