AnswerDotAI / AnswerDotAI/nbdev

Function def input parameter comments causing a "Javascript error"

Open
#1,353 1 comment 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

With the following in a code cell:
```
#| export
def XCORS_trim_to_time(
f:str,
start:str,
stop:str):
pass
```

and this in a following cell:
```
show_doc(XCORS_trim_to_time)
```

I get the correct expected output:
![image](https://github.com/fastai/nbdev/assets/6384461/1b5c1429-baa0-4e0a-8d38-d012b4d4168d)

But when inserting parameter comments as described in the
Nbdev video:

```
#| export
def XCORS_trim_to_time(
f:str, # Filename
start:str, # Start time.
stop:str): # Stop time.
pass
```

```
show_doc(XCORS_trim_to_time)
```

Below is a screencap of the resulting fail:
![image](https://github.com/fastai/nbdev/assets/6384461/56c499b4-a1b8-485d-89fe-b321957355c8)

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in a notebook using the exported XCORS_trim_to_time definition with inline parameter comments, then run show_doc(XCORS_trim_to_time) in the following cell. Compare the output with the version without comments; done means parameter comments no longer cause a JavaScript error and the documentation renders correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
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.