Skip to content

Commit 70f8374

Browse files
authored
DOP-1958: Reorder drivers tabs (#285)
1 parent d51ba51 commit 70f8374

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

snooty/rstspec.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,22 +1619,22 @@ platforms = [
16191619
drivers = [
16201620
{id = "shell", title = "Mongo Shell"},
16211621
{id = "compass", title = "Compass"},
1622-
{id = "python", title = "Python"},
1623-
{id = "java-sync", title = "Java (Sync)"},
1624-
{id = "nodejs", title = "Node.js"},
1625-
{id = "php", title = "PHP"},
1626-
{id = "motor", title = "Motor"},
1627-
{id = "java-async", title = "Java (Async)"},
16281622
{id = "c", title = "C"},
16291623
{id = "cpp", title = "C++11"},
16301624
{id = "csharp", title = "C#"},
1625+
{id = "go", title = "Go"},
1626+
{id = "java-async", title = "Java (Async)"},
1627+
{id = "java-sync", title = "Java (Sync)"},
1628+
{id = "motor", title = "Motor"},
1629+
{id = "nodejs", title = "Node.js"},
16311630
{id = "perl", title = "Perl"},
1631+
{id = "php", title = "PHP"},
1632+
{id = "python", title = "Python"},
16321633
{id = "ruby", title = "Ruby"},
16331634
{id = "rust", title = "Rust"},
16341635
{id = "scala", title = "Scala"},
1635-
{id = "go", title = "Go"},
1636-
{id = "swift-sync", title = "Swift (Sync)"},
16371636
{id = "swift-async", title = "Swift (Async)"},
1637+
{id = "swift-sync", title = "Swift (Sync)"},
16381638
]
16391639
auth = [
16401640
{id = "uidpwd", title = "Username and Password"},

snooty/test_parser.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,14 @@ def test_tabs() -> None:
123123
"""
124124
<root fileid="test_tabs.rst">
125125
<directive name="tabs" tabset="drivers">
126-
<directive name="tab" tabid="python">
127-
<text>Python</text>
128-
<paragraph><text>Python!</text></paragraph>
129-
</directive>
130126
<directive name="tab" tabid="php">
131127
<text>PHP</text>
132128
<paragraph><text>PHP!</text></paragraph>
133129
</directive>
130+
<directive name="tab" tabid="python">
131+
<text>Python</text>
132+
<paragraph><text>Python!</text></paragraph>
133+
</directive>
134134
</directive>
135135
</root>
136136
""",
@@ -197,12 +197,12 @@ def test_tabs_reorder() -> None:
197197
.. tabs-drivers::
198198
199199
.. tab::
200-
:tabid: nodejs
200+
:tabid: python
201201
202202
This tab should be second
203203
204204
.. tab::
205-
:tabid: python
205+
:tabid: nodejs
206206
207207
This tab should be first
208208
""",
@@ -214,10 +214,10 @@ def test_tabs_reorder() -> None:
214214
r"""
215215
<root fileid="test.rst">
216216
<directive name="tabs" tabset="drivers">
217-
<directive name="tab" tabid="python"><text>Python</text>
217+
<directive name="tab" tabid="nodejs"><text>Node.js</text>
218218
<paragraph><text>This tab should be first</text></paragraph>
219219
</directive>
220-
<directive name="tab" tabid="nodejs"><text>Node.js</text>
220+
<directive name="tab" tabid="python"><text>Python</text>
221221
<paragraph><text>This tab should be second</text></paragraph>
222222
</directive>
223223
</directive>

snooty/test_postprocess.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -389,15 +389,15 @@ def test_language_selector() -> None:
389389
check_ast_testing_string(
390390
page.ast,
391391
"""
392-
<root fileid="tabs-two.txt" selectors="{'drivers': {'nodejs': [{'type': 'text', 'position': {'start': {'line': 3}}, 'value': 'Node.js'}], 'c': [{'type': 'text', 'position': {'start': {'line': 3}}, 'value': 'C'}]}}">
392+
<root fileid="tabs-two.txt" selectors="{'drivers': {'c': [{'type': 'text', 'position': {'start': {'line': 3}}, 'value': 'C'}], 'nodejs': [{'type': 'text', 'position': {'start': {'line': 3}}, 'value': 'Node.js'}]}}">
393393
<directive name="tabs-selector"><text>drivers</text></directive>
394394
<directive name="tabs" hidden="True" tabset="drivers">
395-
<directive name="tab" tabid="nodejs"><text>Node.js</text>
396-
<paragraph><text>Node.js</text></paragraph>
397-
</directive>
398395
<directive name="tab" tabid="c"><text>C</text>
399396
<paragraph><text>C</text></paragraph>
400397
</directive>
398+
<directive name="tab" tabid="nodejs"><text>Node.js</text>
399+
<paragraph><text>Node.js</text></paragraph>
400+
</directive>
401401
</directive>
402402
<directive name="tabs" hidden="True" tabset="drivers">
403403
<directive name="tab" tabid="c"><text>C</text>
@@ -567,15 +567,15 @@ def test_language_selector() -> None:
567567
check_ast_testing_string(
568568
page.ast,
569569
"""
570-
<root fileid="tabs-six.txt" selectors="{'drivers': {'python': [{'type': 'text', 'position': {'start': {'line': 3}}, 'value': 'Python'}], 'java-sync': [{'type': 'text', 'position': {'start': {'line': 3}}, 'value': 'Java (Sync)'}]}}">
570+
<root fileid="tabs-six.txt" selectors="{'drivers': {'java-sync': [{'type': 'text', 'position': {'start': {'line': 3}}, 'value': 'Java (Sync)'}], 'python': [{'type': 'text', 'position': {'start': {'line': 3}}, 'value': 'Python'}]}}">
571571
<directive name="tabs-selector"><text>drivers</text></directive>
572572
<directive name="tabs" tabset="drivers">
573-
<directive name="tab" tabid="python"><text>Python</text>
574-
<paragraph><text>Python tab</text></paragraph>
575-
</directive>
576573
<directive name="tab" tabid="java-sync"><text>Java (Sync)</text>
577574
<paragraph><text>Java (sync)</text></paragraph>
578575
</directive>
576+
<directive name="tab" tabid="python"><text>Python</text>
577+
<paragraph><text>Python tab</text></paragraph>
578+
</directive>
579579
</directive>
580580
<directive name="tabs-selector"><text>drivers</text></directive>
581581
<directive name="tabs" tabset="drivers">

0 commit comments

Comments
 (0)