Skip to content

Commit

Permalink
fmt-caption-label update: #617
Browse files Browse the repository at this point in the history
  • Loading branch information
opoudjis committed Nov 26, 2024
1 parent 3601a8a commit 1256474
Show file tree
Hide file tree
Showing 21 changed files with 3,131 additions and 3,528 deletions.
4 changes: 3 additions & 1 deletion lib/isodoc/presentation_function/autonum.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def fmt_label(_label, _number, ids)

# Remove ".blank?" tests if we want empty delim placeholders for manipulation
def fmt_caption(label, elem, name, ids, delims)
label.blank? || %r{<span class=['"]fmt-caption-label['"]}.match?(label) or
label = "<span class='fmt-caption-label'>#{label}</span>"
c = if name && !name.children.empty?
label.blank? or
d = "<span class='fmt-caption-delim'>#{delims[:caption]}</span>"
Expand All @@ -57,7 +59,7 @@ def fmt_caption(label, elem, name, ids, delims)
else return end
!delims[:label].blank? and
f = "<span class='fmt-label-delim'>#{delims[:label]}</span>"
"<fmt-#{elem}><span class='fmt-caption-label'>#{c}</span>#{f}</fmt-#{elem}>"
"<fmt-#{elem}>#{c}#{f}</fmt-#{elem}>"
end
end
end
2 changes: 1 addition & 1 deletion lib/isodoc/xref/xref_sect_gen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def annex_name_lbl(clause, num)
title = Common::case_with_markup(@labels["annex"], "capital",
@script)
s = labelled_autonum(title, num)
"<strong>#{s}</strong><br/>#{obl}"
"<strong><span class='fmt-caption-label'>#{s}</span></strong><br/>#{obl}"
end

def annex_name_anchors(clause, num, level)
Expand Down
22 changes: 1 addition & 21 deletions spec/isodoc/blocks_notes_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
<foreword displayorder="2">
<title id="_">Foreword</title>
<fmt-title depth="1">
<span class="fmt-caption-label">
<semx element="title" source="_">Foreword</semx>
</span>
</fmt-title>
<note id="A" keep-with-next="true" keep-lines-together="true" autonum="1">
<fmt-name>
Expand Down Expand Up @@ -149,9 +147,7 @@
<foreword displayorder="2">
<title id="_">Foreword</title>
<fmt-title depth="1">
<span class="fmt-caption-label">
<semx element="title" source="_">Foreword</semx>
</span>
</fmt-title>
<note id="note1" autonum="1">
<fmt-name>
Expand Down Expand Up @@ -429,9 +425,7 @@
<foreword displayorder="2">
<title id="_">Foreword</title>
<fmt-title depth="1">
<span class="fmt-caption-label">
<semx element="title" source="_">Foreword</semx>
</span>
</fmt-title>
<note id='FB' coverpage='true' unnumbered='true'>
<fmt-name>
Expand Down Expand Up @@ -557,9 +551,7 @@
<foreword displayorder="2">
<title id="_">Foreword</title>
<fmt-title depth="1">
<span class="fmt-caption-label">
<semx element="title" source="_">Foreword</semx>
</span>
</fmt-title>
<figure id="F" autonum="1">
<fmt-name>
Expand Down Expand Up @@ -662,9 +654,7 @@
<foreword displayorder="2">
<title id="_">Foreword</title>
<fmt-title depth="1">
<span class="fmt-caption-label">
<semx element="title" source="_">Foreword</semx>
</span>
</fmt-title>
<admonition id="_" type="caution" keep-with-next="true" keep-lines-together="true">
<fmt-name>
Expand Down Expand Up @@ -724,9 +714,7 @@
<foreword displayorder="2">
<title id="_">Foreword</title>
<fmt-title depth="1">
<span class="fmt-caption-label">
<semx element="title" source="_">Foreword</semx>
</span>
</fmt-title>
<admonition id="_" type="caution">
<fmt-name>
Expand Down Expand Up @@ -769,25 +757,19 @@
<foreword displayorder="2">
<title id="_">Foreword</title>
<fmt-title depth="1">
<span class="fmt-caption-label">
<semx element="title" source="_">Foreword</semx>
</span>
</fmt-title>
<admonition id="_" type="caution">
<name id="_">Title</name>
<fmt-name>
<span class="fmt-caption-label">
<semx element="name" source="_">Title</semx>
</span>
</fmt-name>
<p id="_">Only use paddy or parboiled rice for the determination of husked rice yield.</p>
</admonition>
<admonition id="_" type="caution" notag="true">
<name id="_">Title</name>
<fmt-name>
<span class="fmt-caption-label">
<semx element="name" source="_">Title</semx>
</span>
</fmt-name>
<p id="_">Only use paddy or parboiled rice for the determination of husked rice yield.</p>
</admonition>
Expand Down Expand Up @@ -846,19 +828,17 @@
<foreword displayorder="2">
<title id="_">Foreword</title>
<fmt-title depth="1">
<span class="fmt-caption-label">
<semx element="title" source="_">Foreword</semx>
</span>
</fmt-title>
<admonition id="_" type="box" autonum="1">
<name id="_">Title</name>
<fmt-name>
<span class="fmt-caption-label">
<span class="fmt-element-name">Box</span>
<semx element="autonum" source="_">1</semx>
</span>
<span class="fmt-caption-delim"> — </span>
<semx element="name" source="_">Title</semx>
</span>
</fmt-name>
<fmt-xref-label>
<span class="fmt-element-name">Box</span>
Expand Down
Loading

0 comments on commit 1256474

Please sign in to comment.