Skip to content

Commit 5296d59

Browse files
committed
add autorun options
1 parent 90be19d commit 5296d59

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎docs/source/conf.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,22 @@
6363
autodoc_member_order = "groupwise"
6464
# bysource
6565

66+
# options for spinx_autorun, used for inline examples
67+
# choose UTF-8 encoding to allow for Unicode characters, eg. ansitable
68+
# Python session setup, turn off color printing for SE3, set NumPy precision
69+
autorun_languages = {}
70+
autorun_languages['pycon_output_encoding'] = 'UTF-8'
71+
autorun_languages['pycon_input_encoding'] = 'UTF-8'
72+
autorun_languages['pycon_runfirst'] = """
73+
from spatialmath import SE3
74+
SE3._color = False
75+
import numpy as np
76+
np.set_printoptions(precision=4, suppress=True)
77+
from ansitable import ANSITable
78+
ANSITable._color = False
79+
"""
80+
81+
6682
# Add any paths that contain templates here, relative to this directory.
6783
templates_path = ["_templates"]
6884

0 commit comments

Comments
 (0)