nbsync 0.3.5__py3-none-any.whl → 0.3.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- nbsync/cell.py +3 -2
- nbsync/markdown.py +2 -2
- {nbsync-0.3.5.dist-info → nbsync-0.3.6.dist-info}/METADATA +2 -2
- {nbsync-0.3.5.dist-info → nbsync-0.3.6.dist-info}/RECORD +6 -6
- {nbsync-0.3.5.dist-info → nbsync-0.3.6.dist-info}/WHEEL +0 -0
- {nbsync-0.3.5.dist-info → nbsync-0.3.6.dist-info}/licenses/LICENSE +0 -0
nbsync/cell.py
CHANGED
@@ -75,7 +75,8 @@ def get_source(
|
|
75
75
|
) -> str:
|
76
76
|
attrs = [cell.language]
|
77
77
|
if include_attrs:
|
78
|
-
|
78
|
+
parts = cell.image.iter_parts(exclude_attributes=["result"])
|
79
|
+
attrs.extend(parts)
|
79
80
|
attr = " ".join(attrs)
|
80
81
|
|
81
82
|
source = cell.image.source
|
@@ -125,7 +126,7 @@ def get_markdown(kind: str, source: str, result: str, tabs: str) -> str:
|
|
125
126
|
return f"{result}\n\n{source}"
|
126
127
|
|
127
128
|
if kind == "material-block":
|
128
|
-
result = f'<div class="result" markdown="1"
|
129
|
+
result = f'<div class="result" markdown="1">\n{result}\n</div>'
|
129
130
|
return f"{source}\n\n{result}"
|
130
131
|
|
131
132
|
if kind == "tabbed-left":
|
nbsync/markdown.py
CHANGED
@@ -15,7 +15,7 @@ Element: TypeAlias = str | CodeBlock | Image
|
|
15
15
|
def convert_code_block(code_block: CodeBlock) -> Iterator[Element]:
|
16
16
|
for elem in _convert_code_block_tabbed(code_block):
|
17
17
|
if isinstance(elem, CodeBlock):
|
18
|
-
yield
|
18
|
+
yield _convert_code_block_attrs(elem)
|
19
19
|
else:
|
20
20
|
yield elem
|
21
21
|
|
@@ -35,7 +35,7 @@ def _convert_code_block_tabbed(code_block: CodeBlock) -> Iterator[Element]:
|
|
35
35
|
yield from nbstore.markdown.parse(text)
|
36
36
|
|
37
37
|
|
38
|
-
def
|
38
|
+
def _convert_code_block_attrs(code_block: CodeBlock) -> CodeBlock | Image:
|
39
39
|
exec_ = code_block.attributes.get("exec", None)
|
40
40
|
if exec_ != "1" or not code_block.classes:
|
41
41
|
return code_block
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: nbsync
|
3
|
-
Version: 0.3.
|
3
|
+
Version: 0.3.6
|
4
4
|
Summary: A core library to synchronize Jupyter notebooks and Markdown documents, enabling seamless integration and dynamic content execution
|
5
5
|
Project-URL: Documentation, https://daizutabi.github.io/nbsync/
|
6
6
|
Project-URL: Source, https://github.com/daizutabi/nbsync
|
@@ -39,7 +39,7 @@ Classifier: Topic :: Documentation
|
|
39
39
|
Classifier: Topic :: Software Development :: Documentation
|
40
40
|
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
41
41
|
Requires-Python: >=3.10
|
42
|
-
Requires-Dist: nbstore>=0.
|
42
|
+
Requires-Dist: nbstore>=0.5.2
|
43
43
|
Description-Content-Type: text/markdown
|
44
44
|
|
45
45
|
# nbsync
|
@@ -1,11 +1,11 @@
|
|
1
1
|
nbsync/__init__.py,sha256=3NuWx9D0LcBnXjEKrC-uypNDOz8rLWXI7mIjdN9xSeE,126
|
2
|
-
nbsync/cell.py,sha256=
|
2
|
+
nbsync/cell.py,sha256=9e-Qo0VC-X_HN81IUJzXlK-8EB6EX4uOYNnPqipvCW4,4196
|
3
3
|
nbsync/logger.py,sha256=snNRqi9xESj4B-Z9GQffCBlgqeVujvuXuBveWAebIWM,736
|
4
|
-
nbsync/markdown.py,sha256=
|
4
|
+
nbsync/markdown.py,sha256=6jDaDtCEkDLsukInF0EnauJ2pUki6nVswjyu3Zg2AUE,3832
|
5
5
|
nbsync/notebook.py,sha256=4F3V1KDHfJnIR5ZSb1xWdN9JGiC6mWUVimXXK1BFsbc,1450
|
6
6
|
nbsync/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
7
|
nbsync/sync.py,sha256=vISzn8D_Dae-jdJABRnvvD02aL35bYIWx52OinAORVo,3990
|
8
|
-
nbsync-0.3.
|
9
|
-
nbsync-0.3.
|
10
|
-
nbsync-0.3.
|
11
|
-
nbsync-0.3.
|
8
|
+
nbsync-0.3.6.dist-info/METADATA,sha256=5QDV8YWYNWpb3miXM_nU6jI5qFrV3ktYWIJBS6Dlt_k,6551
|
9
|
+
nbsync-0.3.6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
10
|
+
nbsync-0.3.6.dist-info/licenses/LICENSE,sha256=wy1pqn52upuo_qYwY-epWmspwE-3UWJso0xodciGXYc,1062
|
11
|
+
nbsync-0.3.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|