Skip to content

Commit 61a414c

Browse files
committed
[FEATURE] Introduce directives for bootstrap accordions
1 parent dfab472 commit 61a414c

File tree

3 files changed

+111
-0
lines changed

3 files changed

+111
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!-- content start -->
2+
<div class="section" id="document-title">
3+
<h1>Document Title</h1>
4+
<div class="tabs">
5+
<ul class="nav nav-tabs" id="tab-my-tab" role="tablist">
6+
<li class="nav-item" role="presentation">
7+
<button class="nav-link active"
8+
id="tab-1-tab-my-tab" data-bs-toggle="tab" data-bs-target="#tab-1-my-tab"
9+
type="button" role="tab" aria-controls="tab-1-my-tab"
10+
aria-selected="true">
11+
Tab 1
12+
</button>
13+
</li>
14+
<li class="nav-item" role="presentation">
15+
<button class="nav-link"
16+
id="tab-2-tab-my-tab" data-bs-toggle="tab" data-bs-target="#tab-2-my-tab"
17+
type="button" role="tab" aria-controls="tab-2-my-tab"
18+
aria-selected="false">
19+
Tab 2
20+
</button>
21+
</li>
22+
</ul>
23+
<div class="tab-content" id="tab-content-my-tab">
24+
<div class="tab-pane fade show active" id="tab-1-my-tab" role="tabpanel" aria-labelledby="tab-1-tab-my-tab">
25+
26+
<p>Lorem Ipsum Dolor 1</p>
27+
28+
</div>
29+
<div class="tab-pane fade" id="tab-2-my-tab" role="tabpanel" aria-labelledby="tab-2-tab-my-tab">
30+
31+
<p>Lorem Ipsum Dolor 2</p>
32+
33+
</div>
34+
</div>
35+
</div>
36+
<div class="tabs">
37+
<ul class="nav nav-tabs" id="tab-another-tab" role="tablist">
38+
<li class="nav-item" role="presentation">
39+
<button class="nav-link"
40+
id="tab-3-tab-another-tab" data-bs-toggle="tab" data-bs-target="#tab-3-another-tab"
41+
type="button" role="tab" aria-controls="tab-3-another-tab"
42+
aria-selected="false">
43+
Tab 3
44+
</button>
45+
</li>
46+
<li class="nav-item" role="presentation">
47+
<button class="nav-link active"
48+
id="lorem-tab-another-tab" data-bs-toggle="tab" data-bs-target="#lorem-another-tab"
49+
type="button" role="tab" aria-controls="lorem-another-tab"
50+
aria-selected="true">
51+
Tab 4
52+
</button>
53+
</li>
54+
</ul>
55+
<div class="tab-content" id="tab-content-another-tab">
56+
<div class="tab-pane fade" id="tab-3-another-tab" role="tabpanel" aria-labelledby="tab-3-tab-another-tab">
57+
58+
<p>Lorem Ipsum Dolor 3</p>
59+
60+
</div>
61+
<div class="tab-pane fade show active" id="lorem-another-tab" role="tabpanel" aria-labelledby="lorem-tab-another-tab">
62+
63+
<p>Lorem Ipsum Dolor 4</p>
64+
65+
</div>
66+
</div>
67+
</div>
68+
</div>
69+
<!-- content end -->
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<guides xmlns="https://www.phpdoc.org/guides"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="https://www.phpdoc.org/guides packages/guides-cli/resources/schema/guides.xsd"
5+
theme="bootstrap"
6+
>
7+
<extension class="phpDocumentor\Guides\Bootstrap"/>
8+
</guides>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
==============
2+
Document Title
3+
==============
4+
5+
.. accordion:: Accordion Item #1
6+
:name: headingOne
7+
:parent: accordionExample
8+
:header-level: 2
9+
10+
**This is the first item's accordion body.** It is shown by default, until the collapse plugin adds the
11+
appropriate classes that we use to style each element. These classes control the overall appearance,
12+
as well as the showing and hiding via CSS transitions.
13+
14+
You can modify any of this with custom CSS
15+
or overriding our default variables. It's also worth noting that just about any HTML can go within
16+
the `.accordion-body`, though the transition does limit overflow.
17+
18+
.. accordion:: Accordion Item #2
19+
:name: headingTwo
20+
:parent: accordionExample
21+
:header-level: 2
22+
23+
Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class.
24+
This is the second item's accordion body. Let's imagine this being filled with some actual content.
25+
26+
.. accordion:: Accordion Item #3
27+
:name: headingThree
28+
:parent: accordionExample
29+
:header-level: 2
30+
31+
Placeholder content for this accordion, which is intended to demonstrate the .accordion-flush class.
32+
This is the third item's accordion body. Nothing more exciting happening here in terms of content, but
33+
just filling up the space to make it look,
34+
at least at first glance, a bit more representative of how this would look in a real-world application.

0 commit comments

Comments
 (0)