Skip to content

Commit ba00ee2

Browse files
committed
rm trailing space
1 parent 858e0dc commit ba00ee2

File tree

2 files changed

+6
-19
lines changed

2 files changed

+6
-19
lines changed

nbdev/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,9 @@ def add_init(path=None):
255255
def write_cells(cells, hdr, file, offset=0, cell_number=True):
256256
"Write `cells` to `file` along with header `hdr` starting at index `offset` (mainly for nbdev internal use)."
257257
for cell in cells:
258-
if cell.source.strip(): file.write(f'\n\n{hdr} {cell.idx_+offset if cell_number else ""}\n{cell.source}')
258+
if cell.source.strip():
259+
idx = f" {cell.idx_+offset}" if cell_number else ""
260+
file.write(f'\n\n{hdr}{idx}\n{cell.source}')
259261

260262
# %% ../nbs/api/01_config.ipynb 52
261263
def _basic_export_nb(fname, name, dest=None):

nbs/api/01_config.ipynb

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"cells": [
33
{
4-
"attachments": {},
54
"cell_type": "markdown",
65
"metadata": {},
76
"source": [
@@ -65,15 +64,13 @@
6564
]
6665
},
6766
{
68-
"attachments": {},
6967
"cell_type": "markdown",
7068
"metadata": {},
7169
"source": [
7270
"## Configuring nbdev"
7371
]
7472
},
7573
{
76-
"attachments": {},
7774
"cell_type": "markdown",
7875
"metadata": {},
7976
"source": [
@@ -86,7 +83,6 @@
8683
]
8784
},
8885
{
89-
"attachments": {},
9086
"cell_type": "markdown",
9187
"metadata": {},
9288
"source": [
@@ -395,7 +391,6 @@
395391
]
396392
},
397393
{
398-
"attachments": {},
399394
"cell_type": "markdown",
400395
"metadata": {},
401396
"source": [
@@ -412,7 +407,6 @@
412407
]
413408
},
414409
{
415-
"attachments": {},
416410
"cell_type": "markdown",
417411
"metadata": {},
418412
"source": [
@@ -475,7 +469,6 @@
475469
]
476470
},
477471
{
478-
"attachments": {},
479472
"cell_type": "markdown",
480473
"metadata": {},
481474
"source": [
@@ -505,7 +498,6 @@
505498
]
506499
},
507500
{
508-
"attachments": {},
509501
"cell_type": "markdown",
510502
"metadata": {},
511503
"source": [
@@ -524,7 +516,6 @@
524516
]
525517
},
526518
{
527-
"attachments": {},
528519
"cell_type": "markdown",
529520
"metadata": {},
530521
"source": [
@@ -542,7 +533,6 @@
542533
]
543534
},
544535
{
545-
"attachments": {},
546536
"cell_type": "markdown",
547537
"metadata": {},
548538
"source": [
@@ -561,7 +551,6 @@
561551
]
562552
},
563553
{
564-
"attachments": {},
565554
"cell_type": "markdown",
566555
"metadata": {},
567556
"source": [
@@ -582,7 +571,6 @@
582571
]
583572
},
584573
{
585-
"attachments": {},
586574
"cell_type": "markdown",
587575
"metadata": {},
588576
"source": [
@@ -601,7 +589,6 @@
601589
]
602590
},
603591
{
604-
"attachments": {},
605592
"cell_type": "markdown",
606593
"metadata": {},
607594
"source": [
@@ -622,7 +609,6 @@
622609
]
623610
},
624611
{
625-
"attachments": {},
626612
"cell_type": "markdown",
627613
"metadata": {},
628614
"source": [
@@ -678,7 +664,6 @@
678664
]
679665
},
680666
{
681-
"attachments": {},
682667
"cell_type": "markdown",
683668
"metadata": {},
684669
"source": [
@@ -722,7 +707,6 @@
722707
]
723708
},
724709
{
725-
"attachments": {},
726710
"cell_type": "markdown",
727711
"metadata": {},
728712
"source": [
@@ -755,7 +739,9 @@
755739
"def write_cells(cells, hdr, file, offset=0, cell_number=True):\n",
756740
" \"Write `cells` to `file` along with header `hdr` starting at index `offset` (mainly for nbdev internal use).\"\n",
757741
" for cell in cells:\n",
758-
" if cell.source.strip(): file.write(f'\\n\\n{hdr} {cell.idx_+offset if cell_number else \"\"}\\n{cell.source}')"
742+
" if cell.source.strip():\n",
743+
" idx = f\" {cell.idx_+offset}\" if cell_number else \"\"\n",
744+
" file.write(f'\\n\\n{hdr}{idx}\\n{cell.source}')"
759745
]
760746
},
761747
{
@@ -788,7 +774,6 @@
788774
]
789775
},
790776
{
791-
"attachments": {},
792777
"cell_type": "markdown",
793778
"metadata": {},
794779
"source": [

0 commit comments

Comments
 (0)