Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

* Add `no-cellborder` and `vertically-tight` tables to `CustomBody`
* Remove numbering from `Learning Objectives` in `bca`
* Change iframe link text

Expand Down
6 changes: 6 additions & 0 deletions lib/kitchen/directions/bake_numbered_table/bake_table_body.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,12 @@ def bake(table:, number:, cases: false, label_class: nil)
elsif table.narrow_table?
custom_table = CustomBody.new(table: table, klass: 'narrow-table')
custom_table.modify_body(has_fake_title: false)
elsif table.no_cellborder_table?
custom_table = CustomBody.new(table: table, klass: 'no-cellborder')
custom_table.modify_body(has_fake_title: false)
elsif table.vertically_tight_table?
custom_table = CustomBody.new(table: table, klass: 'vertically-tight')
custom_table.modify_body(has_fake_title: false)
end

return unless table.full_width_table?
Expand Down
1 change: 1 addition & 0 deletions lib/kitchen/directions/bake_unnumbered_tables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def self.v1(book:)
table.wrap(%(<div class="os-table">))
table.remove_attribute('summary')
table.parent.add_class('os-unstyled-container') if table.unstyled?
table.parent.add_class('os-no-cellborder-container') if table.no_cellborder_table?
table.parent.add_class('os-column-header-container') if table.column_header?
if table.top_titled?
table.parent.add_class('os-top-titled-container')
Expand Down
16 changes: 16 additions & 0 deletions lib/kitchen/table_element.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ def full_width_table?
has_class?('full-width')
end

# Returns true if the table is vertically tight
#
# @return [Boolean]
#
def vertically_tight_table?
has_class?('vertically-tight')
end

# Returns true if the table is no-cellborder
#
# @return [Boolean]
#
def no_cellborder_table?
has_class?('no-cellborder')
end

# Returns an element for the table caption, if present
#
# @return [Element, nil]
Expand Down
34 changes: 34 additions & 0 deletions spec/kitchen_spec/directions/bake_numbered_table/v1_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,28 @@
).tables.first
end

let(:vertically_tight_table) do
book_containing(html:
one_chapter_with_one_page_containing(
<<~HTML
<table class="vertically-tight" id="tId">
</table>
HTML
)
).tables.first
end

let(:no_cellborder_table) do
book_containing(html:
one_chapter_with_one_page_containing(
<<~HTML
<table class="no-cellborder" id="tId">
</table>
HTML
)
).tables.first
end

let(:full_width_table) do
book_containing(html:
one_chapter_with_one_page_containing(
Expand Down Expand Up @@ -225,6 +247,18 @@
expect(narrow_table.document.search('.os-table').first).to match_snapshot_auto
end

it 'bakes a vertically-tight table' do
described_class.new.bake(table: vertically_tight_table, number: '2.3')

expect(vertically_tight_table.document.search('.os-table').first).to match_snapshot_auto
end

it 'bakes a no-cellborder table' do
described_class.new.bake(table: no_cellborder_table, number: '2.3')

expect(no_cellborder_table.document.search('.os-table').first).to match_snapshot_auto
end

it 'bakes a full width table' do
described_class.new.bake(table: full_width_table, number: '2.3')

Expand Down
23 changes: 23 additions & 0 deletions spec/kitchen_spec/directions/bake_unnumbered_tables_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@
)
end

let(:book_with_no_cellborder_table) do
book_containing(html:
one_chapter_with_one_page_containing(
<<~HTML
<table class="unnumbered no-cellborder" id="tId">
</table>
HTML
)
)
end

let(:book_with_top_titled_table) do
book_containing(html:
one_chapter_with_one_page_containing(
Expand Down Expand Up @@ -101,6 +112,18 @@
)
end

it 'bakes no cellborder table' do
described_class.v1(book: book_with_no_cellborder_table)
expect(book_with_no_cellborder_table.tables.first.parent).to match_normalized_html(
<<~HTML
<div class="os-table os-no-cellborder-container">
<table class="unnumbered no-cellborder" id="tId">
</table>
</div>
HTML
)
end

it 'bakes top-titled table' do
described_class.v1(book: book_with_top_titled_table)
expect(
Expand Down
20 changes: 10 additions & 10 deletions spec/recipes_spec/books/nursing-external/expected_output.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@
</table>
-->
<!-- REVISED 2-COLUMN DRUG EMPHASIS TABLE-->
<div class="os-table">
<div class="os-table os-vertically-tight-container">
<table id="auto_bacb1e36-e2dc-42ee-89df-597eb312fbbb_table_18_02_001" class="vertically-tight">
<thead>
<tr>
Expand Down Expand Up @@ -1122,7 +1122,7 @@
<span class="os-caption">Drug Emphasis Table: ACE Inhibitors</span>
</div>
</div>
<div class="os-table">
<div class="os-table os-vertically-tight-container">
<table id="auto_bacb1e36-e2dc-42ee-89df-597eb312fbbb_table_18_02_002" class="vertically-tight">
<tbody>
<tr>
Expand Down Expand Up @@ -1289,7 +1289,7 @@
</p>
<p id="auto_2291e1d0-9e94-4164-b990-746aff3d589a_para-00004"><a href="#auto_2291e1d0-9e94-4164-b990-746aff3d589a_table_18_03_001" class="autogenerated-content">Table 1.4</a> lists common ARBs and typical routes and dosing for adult and pediatric clients. <a href="#auto_2291e1d0-9e94-4164-b990-746aff3d589a_table_18_03_002" class="autogenerated-content">Table 1.5</a> is a drug prototype table for ARBs featuring valsartan. It lists drug class, mechanism of action, dosage, indications, therapeutic effects, drug and food interactions, adverse effects, and contraindications.
</p>
<div class="os-table">
<div class="os-table os-vertically-tight-container">
<table id="auto_2291e1d0-9e94-4164-b990-746aff3d589a_table_18_03_001" class="vertically-tight">
<thead>
<tr>
Expand Down Expand Up @@ -1347,7 +1347,7 @@
<span class="os-caption">Drug Emphasis Table: ARBs</span>
</div>
</div>
<div class="os-table">
<div class="os-table os-vertically-tight-container">
<table id="auto_2291e1d0-9e94-4164-b990-746aff3d589a_table_18_03_002" class="vertically-tight">
<tbody>
<tr>
Expand Down Expand Up @@ -1539,7 +1539,7 @@ Asthmatic clients and clients with chronic lung diseases should be monitored car
</div>
<p id="auto_fd146883-06fa-44c0-ae27-8932245c6a5a_para-00010"><a href="#auto_fd146883-06fa-44c0-ae27-8932245c6a5a_table_18_04_001" class="autogenerated-content">Table 1.6</a> lists common beta blockers and typical routes and dosing for adults and children. <a href="#auto_fd146883-06fa-44c0-ae27-8932245c6a5a_table_18_04_002" class="autogenerated-content">Table 1.7</a> is a drug prototype chart for beta-adrenergic blockers featuring metoprolol. It lists drug class, mechanism of action, dosage, indications, therapeutic effects, drug and food interactions, adverse effects, and contraindications.
</p>
<div class="os-table">
<div class="os-table os-vertically-tight-container">
<table id="auto_fd146883-06fa-44c0-ae27-8932245c6a5a_table_18_04_001" class="vertically-tight">
<thead class="blue-text">
<tr>
Expand Down Expand Up @@ -2068,7 +2068,7 @@ Asthmatic clients and clients with chronic lung diseases should be monitored car
<section data-depth="2" id="auto_93e6c58b-19d0-4edf-8279-0dc969140626_sect-00004">
<h4 data-type="title">Potassium-Sparing Diuretics</h4>
<p id="auto_93e6c58b-19d0-4edf-8279-0dc969140626_para-00005">Potassium-sparing diuretics antagonize aldosterone. These drugs reduce aldosterone-induced sodium and water retention in the late distal tubules of the kidneys. These types of diuretics spare potassium within the body; therefore, potassium does not need to be supplemented. Potassium-sparing diuretics are commonly used to treat hypertension in clients with impaired renal function.</p>
<div class="os-table">
<div class="os-table os-vertically-tight-container">
<table class="vertically-tight" id="auto_93e6c58b-19d0-4edf-8279-0dc969140626_table-00001">
<thead>
<tr>
Expand Down Expand Up @@ -5719,7 +5719,7 @@ Asthmatic clients and clients with chronic lung diseases should be monitored car
<section data-depth="2" id="auto_0ee054cf-3e8a-42bf-bbea-3b0976ca246a_sect-00006">
<h4 data-type="title">Malrotation and Volvulus</h4>
<p id="auto_0ee054cf-3e8a-42bf-bbea-3b0976ca246a_para-00016">Malrotation most often occurs in the small intestines as the digestive tract rotates into its final position as it develops. Volvulus is a severe complication of a malrotation in which the improper rotation blocks blood flow to the digestive tract, causing ischemia (Columbia University Irving Medical Center, n.d.). While malrotation can be the cause of a volvulus, a volvulus can also occur with the absence of malrotation (<a href="#auto_0ee054cf-3e8a-42bf-bbea-3b0976ca246a_table_04_04" class="autogenerated-content">Table 4.2</a>). There will be fractions in text, such as 2&#xBD; cups or even &#xBE; cup of this food provides 40% of the recommended daily allowance.</p>
<div class="os-table">
<div class="os-table os-vertically-tight-container">
<table id="auto_0ee054cf-3e8a-42bf-bbea-3b0976ca246a_table_04_04a" class="vertically-tight">
<thead>
<tr>
Expand Down Expand Up @@ -5808,7 +5808,7 @@ Asthmatic clients and clients with chronic lung diseases should be monitored car
<span class="os-divider"> </span>
</div>
</div>
<div class="os-table">
<div class="os-table os-vertically-tight-container">
<table id="auto_0ee054cf-3e8a-42bf-bbea-3b0976ca246a_table_04_04" class="vertically-tight">
<thead>
<tr>
Expand Down Expand Up @@ -6024,7 +6024,7 @@ Asthmatic clients and clients with chronic lung diseases should be monitored car
</ul>
</td>
<td>
<div class="os-table">
<div class="os-table os-no-cellborder-container">
<table class="unnumbered no-cellborder" id="auto_0ee054cf-3e8a-42bf-bbea-3b0976ca246a_table-00002">
<tbody>
<tr>
Expand Down Expand Up @@ -6494,7 +6494,7 @@ If the client has dentures, bridges, or other removable dental appliances, have
<section data-depth="2" id="auto_c7f47ff7-3464-483a-85f6-1c37bf773738_sect-00008">
<h4 data-type="title">Deviations</h4>
<p id="auto_c7f47ff7-3464-483a-85f6-1c37bf773738_para-00027">Deviations from these normal findings can indicate health problems within the lower gastrointestinal tract and accessory organs that can impact the body&#x2019;s ability to break down and absorb nutrition and eliminate wastes. On inspection many things can be found as a deviation from expected findings. Abdominal distention can indicate a very wide range of problems like small bowel obstruction, abdominal aortic aneurysm, masses, tumors, splenomegaly, hepatomegaly, hernia, cancer, and constipation (Mealie et al., 2022). Visible patches of ecchymosis on the abdomen can indicate several forms of hemorrhage in the abdomen. Grey Turner sign which is ecchymosis of the flank and groin is seen in pancreatic hemorrhages while Cullen&#x2019;s sign which is periumbilical ecchymosis is seen in retroperitoneal and intra-abdominal hemorrhages. Purple-pink striae in the absence of late pregnancy can indicate Cushing&#x2019;s syndrome; vein dilation seen as a visible vascular pattern can indicate portal hypertension or vena cava obstruction; and <span data-type="term" id="auto_c7f47ff7-3464-483a-85f6-1c37bf773738_term-00007" group-by="C">Caput Medusae</span>, abdominal distention, and jaundice can indicate cirrhosis and/or other liver failure. Any open skin in the form of a fistula or sinus can indicate a deeper infection. Very marked aortic pulsations, even in very lean clients, can be indicative of aortic aneurysm (Pearson Education, 2018). For newborns and young infants with umbilical cord stumps still in place, umbilical hernias may be seen as weakened appearing fascia below the umbilicus (Gantan &amp; Wiedrich, 2022). Other deviations in the umbilical stump appearance can include surrounding erythema, induration and tenderness (on palpation), all of which can indicate <span data-type="term" id="auto_c7f47ff7-3464-483a-85f6-1c37bf773738_term-00008" group-by="Symbols">]omphalitis</span> and should be reported immediately. All deviations from expected findings should be reported; however, signs of hemorrhage and severe distention should be reported immediately (see <a href="#auto_c7f47ff7-3464-483a-85f6-1c37bf773738_table_04_02_05" class="autogenerated-content">Table 4.5</a> for easy reference).</p>
<div class="os-table">
<div class="os-table os-no-cellborder-container">
<table id="auto_c7f47ff7-3464-483a-85f6-1c37bf773738_table_04_02_05" class="no-cellborder">
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="os-table os-no-cellborder-container"><table class="no-cellborder" id="tId">
</table><div class="os-caption-container">
<span class="os-title-label">Table </span>
<span class="os-number">2.3</span>
<span class="os-divider"> </span>
<span class="os-divider"> </span>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="os-table os-vertically-tight-container"><table class="vertically-tight" id="tId">
</table><div class="os-caption-container">
<span class="os-title-label">Table </span>
<span class="os-number">2.3</span>
<span class="os-divider"> </span>
<span class="os-divider"> </span>
</div>
</div>