Skip to content

Commit db47563

Browse files
committed
Fix up generated code blocks
1 parent 4371adf commit db47563

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

build.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,8 @@ def convert_file(dst_path, fn, editors):
277277
text = re.sub(r' <files/attachments/', r' <attachments/', text, flags=re.M)
278278
text = re.sub(r'.. parsed-literal::', r'.. parsed-literal::\n :class: ipy-out', text, flags=re.M)
279279
text = re.sub(r'`([^`<]*)\s+<(?!attachments/)([^:.>]*?)(?:.html)?>`__', r':doc:`\1 <\2>`', text, flags=re.M)
280-
text = re.sub(r'^(\s*)..\s*raw:: latex', '\\1.. math::\\1 :nowrap:', text, flags=re.M)
281-
text = re.sub(r'\.\. code:: (ipython3|ipython2|python3|python2)', r'.. code:: python', text, flags=re.M)
280+
text = re.sub(r'^(\s*)\.\.\s*raw:: latex', '\\1.. math::\\1 :nowrap:', text, flags=re.M)
281+
text = re.sub(r'^(\s*)\.\. code::\s*(ipython3|ipython2|python3|python2|python)?\s*$', r'\1.. code-block:: python\n', text, flags=re.M)
282282
with open(rst_fn, 'w') as f:
283283
f.write(text)
284284
if authors:

0 commit comments

Comments
 (0)