Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nbdev/export2html.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ def _documented(name):
res.append(cell)
if check_re_multi(cell, [_re_export, _re_export_magic]):
for n in export_names(cell['source'], func_only=True):
if not _documented(n): res.append(_show_doc_cell(n, cls_lvl=cls_lvl))
if not _documented(n): res.insert(len(res)-1, _show_doc_cell(n, cls_lvl=cls_lvl))
return res

# Cell
Expand Down
57 changes: 15 additions & 42 deletions nbs/03_export2html.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,15 @@
" return {'cell_type': 'code', 'execution_count': None, 'metadata': {}, 'outputs': [], 'source': source}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import pdb"
]
},
{
"cell_type": "code",
"execution_count": null,
Expand Down Expand Up @@ -1092,7 +1101,7 @@
" res.append(cell)\n",
" if check_re_multi(cell, [_re_export, _re_export_magic]):\n",
" for n in export_names(cell['source'], func_only=True):\n",
" if not _documented(n): res.append(_show_doc_cell(n, cls_lvl=cls_lvl))\n",
" if not _documented(n): res.insert(len(res)-1, _show_doc_cell(n, cls_lvl=cls_lvl))\n",
" return res"
]
},
Expand All @@ -1115,9 +1124,9 @@
"added_cells = add_show_docs(tst_cells, cls_lvl=3)\n",
"test_eq(len(added_cells), 3)\n",
"test_eq(added_cells[0], tst_nb['cells'][i-1])\n",
"test_eq(added_cells[1], tst_nb['cells'][i])\n",
"test_eq(added_cells[2], _show_doc_cell('read_nb', cls_lvl=3))\n",
"test_eq(added_cells[2]['source'], 'show_doc(read_nb, default_cls_level=3)')\n",
"test_eq(added_cells[2], tst_nb['cells'][i])\n",
"test_eq(added_cells[1], _show_doc_cell('read_nb', cls_lvl=3))\n",
"test_eq(added_cells[1]['source'], 'show_doc(read_nb, default_cls_level=3)')\n",
"\n",
"for flag in ['#export', '%nbdev_export', '#exports', '%nbdev_export_and_show']:\n",
" for show_doc_source in [\n",
Expand Down Expand Up @@ -1702,7 +1711,7 @@
"fake_nb = {k:v for k,v in tst_nb.items() if k != 'cells'}\n",
"fake_nb['cells'] = [tst_nb['cells'][0].copy()] + added_cells\n",
"fake_nb = execute_nb(fake_nb, mod='export')\n",
"assert len(fake_nb['cells'][-1]['outputs']) > 0"
"assert len(fake_nb['cells'][-2]['outputs']) > 0"
]
},
{
Expand Down Expand Up @@ -1939,36 +1948,7 @@
"metadata": {
"hide_input": false
},
"outputs": [
{
"data": {
"text/html": [],
"text/plain": [
"<IPython.core.display.HTML object>"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"converting: /home/peter/github/pete88b/nbdev/nbs/01_sync.ipynb\n",
"converting: /home/peter/github/pete88b/nbdev/nbs/05_merge.ipynb\n",
"converting: /home/peter/github/pete88b/nbdev/nbs/99_search.ipynb\n",
"converting: /home/peter/github/pete88b/nbdev/nbs/tutorial.ipynb\n",
"converting: /home/peter/github/pete88b/nbdev/nbs/06_cli.ipynb\n",
"converting: /home/peter/github/pete88b/nbdev/nbs/index.ipynb\n",
"converting: /home/peter/github/pete88b/nbdev/nbs/00_export.ipynb\n",
"converting: /home/peter/github/pete88b/nbdev/nbs/04_test.ipynb\n",
"converting: /home/peter/github/pete88b/nbdev/nbs/magic_flags.ipynb\n",
"converting: /home/peter/github/pete88b/nbdev/nbs/07_clean.ipynb\n",
"converting: /home/peter/github/pete88b/nbdev/nbs/02_showdoc.ipynb\n",
"converting: /home/peter/github/pete88b/nbdev/nbs/03_export2html.ipynb\n"
]
}
],
"outputs": [],
"source": [
"#slow\n",
"#hide\n",
Expand Down Expand Up @@ -2354,13 +2334,6 @@
"from nbdev.export import *\n",
"notebook2script()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down