diff --git a/nbdev/cli.py b/nbdev/cli.py index 257a0e46a..5d94c28b1 100644 --- a/nbdev/cli.py +++ b/nbdev/cli.py @@ -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: diff --git a/nbdev/showdoc.py b/nbdev/showdoc.py index 64850c7df..6c138093e 100644 --- a/nbdev/showdoc.py +++ b/nbdev/showdoc.py @@ -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 diff --git a/nbs/08_showdoc.ipynb b/nbs/08_showdoc.ipynb index 3e0aba310..d90d7324b 100644 --- a/nbs/08_showdoc.ipynb +++ b/nbs/08_showdoc.ipynb @@ -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" ] @@ -734,7 +734,7 @@ { "cell_type": "code", "execution_count": null, - "id": "37c1c293-40f6-47fd-8d25-a5cb005b3b3b", + "id": "2df577a8", "metadata": {}, "outputs": [ { @@ -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", @@ -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", @@ -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()" ] }, { diff --git a/nbs/10_cli.ipynb b/nbs/10_cli.ipynb index 722e86c40..11f4c1304 100644 --- a/nbs/10_cli.ipynb +++ b/nbs/10_cli.ipynb @@ -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", @@ -647,8 +646,7 @@ "outputs": [], "source": [ "#|hide\n", - "from nbdev.doclinks import nbdev_export\n", - "nbdev_export()" + "import nbdev; nbdev.nbdev_export()" ] }, {