Skip to content

Commit

Permalink
fixes #841
Browse files Browse the repository at this point in the history
  • Loading branch information
jph00 committed Aug 12, 2022
1 parent fa203e8 commit 77f968f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
1 change: 0 additions & 1 deletion nbdev/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,6 @@ def nbdev_quarto(
refresh_quarto_yml()
files = nbdev_sidebar.__wrapped__(path, symlinks=symlinks, file_re=file_re, folder_re=folder_re,
skip_file_glob=skip_file_glob, skip_file_re=skip_file_re, returnit=True)
shutil.rmtree(doc_path, ignore_errors=True)
if preview: os.system(f'cd "{path}" && quarto preview --no-execute')
else: _sprun(f'cd "{path}" && quarto render --no-execute')
if not preview:
Expand Down
2 changes: 1 addition & 1 deletion nbdev/showdoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def _repr_markdown_(self):
if self.isfunc or self.isprop: doc += '#'
sig = _wrap_sig(f"{self.nm} {_fmt_sig(self.sig)}") if self.sig else ''
doc += f'### {self.nm}\n\n{sig}'
if self.docs: doc += f"\n\n{self.docs.splitlines()[0]}"
if self.docs: doc += f"\n\n{self.docs}"
if self.dm.has_docment: doc += f"\n\n{self.dm}"
return doc

Expand Down
22 changes: 17 additions & 5 deletions nbs/08_showdoc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@
" if self.isfunc or self.isprop: doc += '#'\n",
" sig = _wrap_sig(f\"{self.nm} {_fmt_sig(self.sig)}\") if self.sig else ''\n",
" doc += f'### {self.nm}\\n\\n{sig}'\n",
" if self.docs: doc += f\"\\n\\n{self.docs.splitlines()[0]}\"\n",
" if self.docs: doc += f\"\\n\\n{self.docs}\"\n",
" if self.dm.has_docment: doc += f\"\\n\\n{self.dm}\"\n",
" return doc"
]
Expand Down Expand Up @@ -734,7 +734,7 @@
{
"cell_type": "code",
"execution_count": null,
"id": "37c1c293-40f6-47fd-8d25-a5cb005b3b3b",
"id": "2df577a8",
"metadata": {},
"outputs": [
{
Expand All @@ -748,6 +748,18 @@
"\n",
"func docstring in the numpy style.\n",
"\n",
"This is another line of the docstring.\n",
"\n",
"Parameters\n",
"----------\n",
"x : int\n",
" the parameter x\n",
" \n",
"Returns\n",
"-------\n",
"None\n",
" this function doesn't return anything\n",
"\n",
"| | **Type** | **Default** | **Details** |\n",
"| -- | -------- | ----------- | ----------- |\n",
"| x | int | 1 | the parameter x |\n",
Expand All @@ -767,6 +779,8 @@
" \"\"\"\n",
" func docstring in the numpy style.\n",
" \n",
" This is another line of the docstring.\n",
" \n",
" Parameters\n",
" ----------\n",
" x : int\n",
Expand Down Expand Up @@ -1265,9 +1279,7 @@
"outputs": [],
"source": [
"#|hide\n",
"#|eval: false\n",
"from nbdev.doclinks import nbdev_export\n",
"nbdev_export()"
"import nbdev; nbdev. nbdev_export()"
]
},
{
Expand Down
4 changes: 1 addition & 3 deletions nbs/10_cli.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,6 @@
" refresh_quarto_yml()\n",
" files = nbdev_sidebar.__wrapped__(path, symlinks=symlinks, file_re=file_re, folder_re=folder_re,\n",
" skip_file_glob=skip_file_glob, skip_file_re=skip_file_re, returnit=True)\n",
" shutil.rmtree(doc_path, ignore_errors=True)\n",
" if preview: os.system(f'cd \"{path}\" && quarto preview --no-execute')\n",
" else: _sprun(f'cd \"{path}\" && quarto render --no-execute')\n",
" if not preview:\n",
Expand All @@ -647,8 +646,7 @@
"outputs": [],
"source": [
"#|hide\n",
"from nbdev.doclinks import nbdev_export\n",
"nbdev_export()"
"import nbdev; nbdev.nbdev_export()"
]
},
{
Expand Down

0 comments on commit 77f968f

Please sign in to comment.