Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for fragments on table rows #518

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/modules/project/pages/hacking.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Go to `test/doctest` folder and install `reveal.js`:

From the project's root directory:

$ bundle exec rake doctest::generate FORCE=yes
$ bundle exec rake doctest:generate FORCE=yes

=== Open rendered files

Expand Down
10 changes: 10 additions & 0 deletions examples/fragments.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,13 @@ This is step two:

$ echo 'hello world'
--

== Fragments on tables

[%rowSteps]
|===
|Fruit |Color

|Apple |red
|Banana |yellow
|===
2 changes: 1 addition & 1 deletion templates/table.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/ not sure about this one, done when converting to a compilable slim template
<t#{tblsec}>
- @rows[tblsec].each do |row|
tr
tr class=('fragment' if (tblsec != :head) && ((option? :rowSteps) || (has_role? 'rowSteps') || (attr? 'rowSteps')))
- row.each do |cell|
/ store reference of content in advance to resolve attribute assignments in cells
- if tblsec == :head
Expand Down
35 changes: 35 additions & 0 deletions test/doctest/fragments.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,41 @@ <h2>Fragments on paragraphs</h2>
</div>
</div>
</section>
<section id="_fragments_on_tables">
<h2>Fragments on tables</h2>
<div class="slide-content">
<table class="tableblock frame-all grid-all" style="width: 100%;">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">Fruit</th>
<th class="tableblock halign-left valign-top">Color</th>
</tr>
</thead>
<tbody>
<tr class="fragment">
<td class="tableblock halign-left valign-top">
<p class="tableblock">Apple</p>
</td>
<td class="tableblock halign-left valign-top">
<p class="tableblock">red</p>
</td>
</tr>
<tr class="fragment">
<td class="tableblock halign-left valign-top">
<p class="tableblock">Banana</p>
</td>
<td class="tableblock halign-left valign-top">
<p class="tableblock">yellow</p>
</td>
</tr>
</tbody>
</table>
</div>
</section>
</div>
<script src="reveal.js/dist/reveal.js"></script>
<script>
Expand Down