Skip to content

Commit a1e8de3

Browse files
committed
diff
1 parent 6d92e31 commit a1e8de3

File tree

2 files changed

+400
-0
lines changed

2 files changed

+400
-0
lines changed

nbdev/diff.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
"""Get ipynb diffs by cell"""
2+
3+
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/19_diff.ipynb.
4+
5+
# %% auto 0
6+
__all__ = ['source_diff']
7+
8+
# %% ../nbs/api/19_diff.ipynb
9+
def source_diff(
10+
old_source, # Original source string
11+
new_source # New source string
12+
): # Unified diff string
13+
"Return unified diff string for source change"
14+
return '\n'.join(unified_diff(old_source.splitlines(), new_source.splitlines(), lineterm=''))

0 commit comments

Comments
 (0)