Skip to content

Commit 55a2d20

Browse files
authored
Merge pull request #446 from linawolf/rst-class-alias
Introduce rst-class directive as alias for class directive
2 parents a9281e7 + d08ff56 commit 55a2d20

File tree

4 files changed

+40
-1
lines changed

4 files changed

+40
-1
lines changed

packages/guides-restructured-text/src/RestructuredText/Directives/ClassDirective.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,18 @@ public function getName(): string
2222
return 'class';
2323
}
2424

25+
/**
26+
* When the default domain contains a class directive, this directive will be shadowed. Therefore, Sphinx re-exports it as rst-class.
27+
*
28+
* See https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html#rstclass
29+
*
30+
* @return string[]
31+
*/
32+
public function getAliases(): array
33+
{
34+
return ['rst-class'];
35+
}
36+
2537
/** {@inheritDoc}
2638
*
2739
* @param Directive $directive
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title></title>
5+
6+
</head>
7+
<body>
8+
9+
10+
<ol class="bignums">
11+
<li><p>First Item</p><p>This is the body text</p></li>
12+
13+
<li><p>Second Item</p><p>More body text</p></li>
14+
15+
</ol>
16+
17+
18+
19+
<ol class="bignums-xxl">
20+
<li><p>And then with xxl big numbers</p><p>This is the body text</p></li>
21+
22+
<li><p>The second xxl item</p><p>More body text ....</p></li>
23+
24+
</ol>
25+
26+
</body>
27+
</html>

tests/Integration/tests/big-numbers/input/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@
1616

1717
2. The second xxl item
1818

19-
More body text ....
19+
More body text ....

tests/Integration/tests/big-numbers/input/skip

Whitespace-only changes.

0 commit comments

Comments
 (0)