File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -47,6 +47,7 @@ def run(self):
47
47
classes = 'ui top attached tabular menu sphinx-menu'
48
48
tabs_node ['classes' ] = classes .split (' ' )
49
49
50
+ env .temp_data ['tab_ids' ] = []
50
51
env .temp_data ['tab_titles' ] = []
51
52
env .temp_data ['is_first_tab' ] = True
52
53
self .state .nested_parse (self .content , self .content_offset , node )
@@ -89,6 +90,11 @@ def run(self):
89
90
90
91
if 'tab_id' not in args :
91
92
args ['tab_id' ] = env .new_serialno ('tab_id' )
93
+ i = 1
94
+ while args ['tab_id' ] in env .temp_data ['tab_ids' ]:
95
+ args ['tab_id' ] = '%s-%d' % (args ['tab_id' ], i )
96
+ i += 1
97
+ env .temp_data ['tab_ids' ].append (args ['tab_id' ])
92
98
93
99
data_tab = "sphinx-data-tab-{}" .format (args ['tab_id' ])
94
100
Original file line number Diff line number Diff line change @@ -93,6 +93,34 @@ Code Tabs
93
93
PROGRAM main
94
94
END PROGRAM main
95
95
96
+ .. tabs ::
97
+
98
+ .. code-tab :: json 400
99
+
100
+ {
101
+ "message": "Possible issue 1"
102
+ }
103
+
104
+ .. code-tab :: json 400
105
+
106
+ {
107
+ "message": "Possible issue 2"
108
+ }
109
+
110
+ .. tabs ::
111
+
112
+ .. code-tab :: json 400
113
+
114
+ {
115
+ "message": "Possible issue 1"
116
+ }
117
+
118
+ .. code-tab :: json 400
119
+
120
+ {
121
+ "message": "Possible issue 2"
122
+ }
123
+
96
124
Group Tabs
97
125
========================================
98
126
You can’t perform that action at this time.
0 commit comments