Skip to content

Commit 03d26f0

Browse files
committed
Removed code from RST
1 parent 4534f84 commit 03d26f0

File tree

2 files changed

+34
-25
lines changed

2 files changed

+34
-25
lines changed

‎doc/source/quickstart.rst

+14-20
Original file line numberDiff line numberDiff line change
@@ -175,35 +175,29 @@ Recurse through the Tree
175175
:start-after: # [15-test_cloned_repo_object]
176176
:end-before: # ![15-test_cloned_repo_object]
177177

178-
.. code-block:: python
178+
.. literalinclude:: ../../test/test_quick_doc.py
179+
:language: python
180+
:dedent: 8
181+
:start-after: # [16-test_cloned_repo_object]
182+
:end-before: # ![16-test_cloned_repo_object]
179183

180-
print_files_from_git(tree)
181184

182-
.. code-block:: python
183185

184-
# Output
185-
| Downloads, tree
186-
----| Downloads/file3.txt, blob
187-
| dir1, tree
188-
----| dir1/file1.txt, blob
189-
----| dir1/file2.txt, blob
190-
| file4.txt, blob
191186

187+
Printing text files
188+
####################
192189

193-
Print file version
194-
##################
190+
.. literalinclude:: ../../test/test_quick_doc.py
191+
:language: python
192+
:dedent: 8
193+
:start-after: # [17-test_cloned_repo_object]
194+
:end-before: # ![17-test_cloned_repo_object]
195195

196196
.. literalinclude:: ../../test/test_quick_doc.py
197197
:language: python
198198
:dedent: 8
199-
:start-after: # [16-test_cloned_repo_object]
200-
:end-before: # ![16-test_cloned_repo_object]
199+
:start-after: # [18-test_cloned_repo_object]
200+
:end-before: # ![18-test_cloned_repo_object]
201201

202-
.. code-block:: python
203202

204-
blob = tree[print_file]
205-
print(blob.data_stream.read().decode())
206203

207-
# Output
208-
# file 2 version 1
209-
# Update version 2

‎test/test_quick_doc.py

+20-5
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,34 @@ def print_files_from_git(tree, delim='-', i=0):
156156

157157
# ![15-test_cloned_repo_object]
158158

159-
# Printing text files
160159
# [16-test_cloned_repo_object]
161-
print_file = 'dir1/file2.txt'
162-
tree[print_file]
160+
print_files_from_git(tree)
163161

164-
# Output <git.Blob "3fab4a2e97ee374d0eccd854f298eee0b06a62fb">
165-
# ![16-test_cloned_repo_object]
162+
# Output
163+
# | Downloads, tree
164+
# ---- | Downloads / file3.txt, blob
165+
# | dir1, tree
166+
# ---- | dir1 / file1.txt, blob
167+
# ---- | dir1 / file2.txt, blob
168+
# | file4.txt, blob
169+
# # ![16-test_cloned_repo_object]
166170

171+
# Printing text files
167172
# [17-test_cloned_repo_object]
173+
print_file = 'dir1/file2.txt'
174+
tree[print_file]
168175

176+
# Output <git.Blob "3fab4a2e97ee374d0eccd854f298eee0b06a62fb">
169177
# ![17-test_cloned_repo_object]
170178

179+
# [18-test_cloned_repo_object]
180+
blob = tree[print_file]
181+
print(blob.data_stream.read().decode())
171182

183+
# Output
184+
# file 2 version 1
185+
# Update version 2
172186

187+
# ![18-test_cloned_repo_object]
173188

174189

0 commit comments

Comments
 (0)