Some queries regarding nbdev

  1. When I’m building docs, I’m getting
Warning: Some of your Notebooks use the same title (['Title', 'Title', 'Title']).
converting /home/root/project/index.ipynb to README.md

Although, title of each notebook is different. As a result, in the documentation website, only one page is created.

  1. When I try to add an image, it renders well locally. At the time for building docs, I get
[Errno 2] No such file or directory: '/home/root/project/https:/github.com/username/project/workflows/CI/badge.svg\\'
Traceback (most recent call last):
  File "/home/u37216/.local/bin/nbdev_build_docs", line 8, in <module>
    sys.exit(nbdev_build_docs())
  File "/home/u37216/.local/lib/python3.6/site-packages/fastscript/core.py", line 73, in _f
    func(**args.__dict__)
  File "/home/u37216/.local/lib/python3.6/site-packages/nbdev/cli.py", line 164, in nbdev_build_docs
    notebook2html(fname=fname, force_all=force_all, n_workers=n_workers)
  File "/home/u37216/.local/lib/python3.6/site-packages/nbdev/export2html.py", line 426, in notebook2html
    raise Exception(msg + '\n'.join([f.name for p,f in zip(passed,files) if not p]))
Exception: Conversion failed on the following:
index.ipynb
1 Like

For 1, it means the cells where you defined the title don’t follow the syntax:

# Title
> Summary

(with nothing else in the cell) otherwise it would have grabbed the proper titles (what I can see is the default when nbdev does not find such a cell)

For 2. Support for images on the web has just been added (yesterday actually) so you will need to do a dev install to get rid of that error (or wait a little bit, I have a few last things to fix and there’ll probably be a release at the end of today).

1 Like

Thanks for replying.
Do I need to add title and summary for the modules also ?
My first cell contains

# default_exp module.sub_module # first cell

#export                         # Second cell   
import math
import torch
import torch.nn as nn
import torch.nn.functional as F

In the fastcore, the same format is being followed. Where to add title and summary in modules ?

In any cell you like. In fastcore you can see each notebook has a markdown cell with title and summary. The 00 notebook for instace has:

# Test
> Helper functions to quickly write tests in notebooks
1 Like

Thanks for the reply. It solved the first problem. It hasn’t been covered in video tutorial or documentation tutorial. I checked both of them. I’ll check with the images tomorrow as you suggested. Looking forward to using more of nbdev.