pandorga 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 138bcb8f0c2e5c6eec6316000865742ac1ebb5c57703beb8db532bfdca64a270
4
- data.tar.gz: 9f7fc0e7385d8b542cd6507fe00c0e1110012d4ec7688e277978ecfb611d9034
3
+ metadata.gz: 221dacb578ada5bb29237157b9e2fcffc4789053fe0566eae9f626967334b291
4
+ data.tar.gz: eedd7e320f83cf654525e469eddf66f013f7229324304d13ed983ad38a0b58eb
5
5
  SHA512:
6
- metadata.gz: 46f7672a6254b39d874c34ba00555a287a94feabbba29d59582cdd2b8436fa874b6c7a3c0ff5070c9bebd83f5cd71144458ed19068c6d553001d8c6d5d9f6e5d
7
- data.tar.gz: 95017e5b2b5d9152a41d705fd652546273e812f9f4efa7048792f34b08cf0272478d06680e3e707360425ef22a5329cb758863bcf2250f2a67dfdc31f6f50dee
6
+ metadata.gz: 41b852a904d013dbc020d1d14fe33b56d9355a5cf201255fc14df14ae095c2457da292ba2f357cce007b45a886fd047b2c9312a4bc1d3eb9f2f69b995270845c
7
+ data.tar.gz: d48976bdd3f548a0480766c9e6449566ce3527c5e78bc603711681d32c0ab144d6a8c5c7c60c02fd65553a1160c02eb3f10a8791e284ec0e3c98cdd4019f7f19
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [2.0.3] — 2026-10-25
6
+
7
+ ### Fixed
8
+
9
+ - Entry titles on the Articles, Sources and Bibliography pages use the Rascunhos size at every width. The Articles rows and Sources cards were a step smaller and shrank again below 768px, and the Bibliography cards were a step smaller (PLT-AC-55).
10
+
5
11
  ## [2.0.2] — 2026-10-25
6
12
 
7
13
  ### Added
data/DESIGN.md CHANGED
@@ -762,7 +762,7 @@ those tokens — no one-off rem sizes for roles that already have a step.
762
762
  | Page H1 | Cinzel Decorative | 400 | `--type-page` / `-lg` |
763
763
  | Section | Cinzel Decorative | 400 | `--type-section` / `-lg` |
764
764
  | Detail title | Newsreader | 600 | `--type-title` / `-lg` |
765
- | Card / row title | Newsreader | 600 | `--type-card` / `-lg` |
765
+ | Card / row title | Newsreader | 600 | `--type-card` / `-lg`; listing entry titles always `-lg` (PLT-AC-55) |
766
766
  | Prose | Newsreader | 300 | `--type-prose` |
767
767
  | UI body | Newsreader | 300 | `--type-body` |
768
768
  | Detail standfirst | Newsreader | 300 | `--type-subtitle` (= body − 1pt) |
data/assets/css/base.css CHANGED
@@ -527,11 +527,11 @@ html[data-theme="dark"] {
527
527
  --color-link-hover: color-mix(in srgb, var(--color-tertiary) 72%, var(--color-on-surface));
528
528
  }
529
529
 
530
- /* Card / row / collection entry titles — content-title voice (Regular 400). */
530
+ /* Card / row / collection entry titles — content-title voice (Regular 400).
531
+ Listing rows and source cards also carry .card-title, so they get the voice
532
+ here and their size from the listing entry rule below. */
531
533
  .card-title,
532
- .ledger-card-title,
533
- .ledger-row-title,
534
- .source-card-title {
534
+ .ledger-card-title {
535
535
  font-family: var(--font-content-title);
536
536
  font-size: var(--type-card);
537
537
  font-weight: var(--weight-title);
@@ -554,6 +554,17 @@ html[data-theme="dark"] {
554
554
  }
555
555
  }
556
556
 
557
+ /* Listing entry titles (PLT-AC-55). The Articles and Rascunhos rows and the
558
+ Sources and Bibliography cards set their entry title at the Rascunhos step
559
+ at every width. This rule follows the small-screen step above on purpose,
560
+ so it holds below 768px too. */
561
+ .ledger-row-title,
562
+ .source-card-title,
563
+ .bib-card-title {
564
+ font-size: var(--type-card-lg);
565
+ line-height: 1.25;
566
+ }
567
+
557
568
  /* Label-face meta on CV identity lines, etc. */
558
569
  .card-meta {
559
570
  font-family: var(--font-label);
@@ -138,8 +138,6 @@
138
138
 
139
139
  .bib-card-title {
140
140
  margin: 0;
141
- font-size: var(--type-card);
142
- line-height: 1.25;
143
141
  color: var(--color-on-surface);
144
142
  overflow-wrap: anywhere;
145
143
  }
@@ -204,13 +204,6 @@
204
204
  text-transform: uppercase;
205
205
  }
206
206
 
207
- /* Entry titles — a step above the shared ledger-row scale so the notebook
208
- line reads as a title, not a caption. */
209
- .rascunhos-row .ledger-row-title {
210
- font-size: var(--type-card-lg);
211
- line-height: 1.25;
212
- }
213
-
214
207
  /* ══ Ledger entry ══
215
208
  Ruled paper, not a stack of cards: the shared row's card fill and padding
216
209
  come off, and what separates two entries is the hairline under each one.
@@ -24,7 +24,7 @@ module Pandorga
24
24
 
25
25
  gem "pandorga", "~> 2.0"
26
26
  # Local checkout: gem "pandorga", path: "../pandorga"
27
- # GitHub tag: gem "pandorga", github: "alexandrelheinen/pandorga", tag: "v2.0.2"
27
+ # GitHub tag: gem "pandorga", github: "alexandrelheinen/pandorga", tag: "v2.0.3"
28
28
  gem "csv"
29
29
  gem "base64"
30
30
  RUBY
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Pandorga
4
- VERSION = "2.0.2"
4
+ VERSION = "2.0.3"
5
5
  end
@@ -0,0 +1,107 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ # PLT-AC-55: listing entry titles on the Articles, Rascunhos, Sources and
5
+ # Bibliography pages share one size, the Rascunhos step, at every width.
6
+
7
+ require "pathname"
8
+
9
+ ROOT = Pathname.new(__dir__).join("..", "..").expand_path
10
+ CSS_ROOT = ROOT.join("assets/css")
11
+ TITLE_CLASSES = %w[.ledger-row-title .source-card-title .bib-card-title].freeze
12
+
13
+ def fail!(message)
14
+ warn "FAIL: #{message}"
15
+ exit 1
16
+ end
17
+
18
+ def strip_comments(source)
19
+ source.gsub(%r{/\*.*?\*/}m, "")
20
+ end
21
+
22
+ # Yields [selectors, declarations, offset] for every rule, descending into
23
+ # at-rule blocks such as media queries.
24
+ def each_rule(source, &block)
25
+ depth_start = 0
26
+ i = 0
27
+ while (open = source.index("{", i))
28
+ prelude = source[i...open].strip
29
+ depth = 1
30
+ j = open + 1
31
+ while depth.positive? && j < source.length
32
+ depth += 1 if source[j] == "{"
33
+ depth -= 1 if source[j] == "}"
34
+ j += 1
35
+ end
36
+ body = source[(open + 1)...(j - 1)]
37
+ if prelude.start_with?("@")
38
+ each_rule(body, &block) if body.include?("{")
39
+ else
40
+ selectors = prelude.split(",").map { |s| s.strip.gsub(/\s+/, " ") }
41
+ yield selectors, body, open + depth_start
42
+ end
43
+ i = j
44
+ end
45
+ end
46
+
47
+ def last_compound(selector)
48
+ selector.split(/\s*[ >+~]\s*/).last.to_s
49
+ end
50
+
51
+ def declares?(body, property)
52
+ body.match?(/(?:^|;|\s)#{Regexp.escape(property)}\s*:/)
53
+ end
54
+
55
+ puts "Testing listing entry titles (PLT-AC-55)..."
56
+
57
+ base = strip_comments(CSS_ROOT.join("base.css").read)
58
+ shared = []
59
+ each_rule(base) do |selectors, body, offset|
60
+ shared << [body, offset] if selectors.sort == TITLE_CLASSES.sort
61
+ end
62
+ fail!("base.css needs exactly one rule for #{TITLE_CLASSES.join(', ')}") unless shared.size == 1
63
+ body, shared_offset = shared.first
64
+ fail!("shared rule must set font-size: var(--type-card-lg)") unless body.match?(/font-size:\s*var\(--type-card-lg\)\s*;/)
65
+ fail!("shared rule must set line-height: 1.25") unless body.match?(/line-height:\s*1\.25\s*;/)
66
+
67
+ small_step = base.index("var(--type-card-sm)", base.index("--type-card-sm:") + 1)
68
+ fail!("small-screen .card-title step not found in base.css") unless small_step
69
+ fail!("shared rule must follow the small-screen .card-title step") unless shared_offset > small_step
70
+ puts " shared rule: OK"
71
+
72
+ offenders = []
73
+ Dir.glob(CSS_ROOT.join("**", "*.css")).sort.each do |path|
74
+ source = strip_comments(File.read(path))
75
+ each_rule(source) do |selectors, rule_body, _offset|
76
+ next if selectors.sort == TITLE_CLASSES.sort && path == CSS_ROOT.join("base.css").to_s
77
+
78
+ targeted = selectors.select do |sel|
79
+ compound = last_compound(sel)
80
+ TITLE_CLASSES.any? { |cls| compound.include?(cls) && !compound.match?(/#{Regexp.escape(cls)}[-\w]/) }
81
+ end
82
+ next if targeted.empty?
83
+
84
+ %w[font-size line-height].each do |prop|
85
+ next unless declares?(rule_body, prop)
86
+
87
+ offenders << "#{Pathname.new(path).relative_path_from(ROOT)}: #{targeted.join(', ')} sets #{prop}"
88
+ end
89
+ end
90
+ end
91
+ fail!("entry title overrides:\n #{offenders.join("\n ")}") unless offenders.empty?
92
+ puts " no overrides: OK"
93
+
94
+ markup = {
95
+ "_includes/content-runtime/43-blocks.html" => "ledger-row-title",
96
+ "_layouts/resources.html" => "source-card-title",
97
+ "_layouts/bibliography.html" => "bib-card-title"
98
+ }
99
+ markup.each do |file, cls|
100
+ fail!("#{file} no longer emits #{cls}") unless ROOT.join(file).read.include?(cls)
101
+ end
102
+ %w[_layouts/articles.html _layouts/blog.html].each do |file|
103
+ fail!("#{file} no longer renders rows with renderLedgerRow") unless ROOT.join(file).read.include?("renderLedgerRow(")
104
+ end
105
+ puts " markup: OK"
106
+
107
+ puts "All listing entry title checks passed."
data/scripts/validate.sh CHANGED
@@ -62,6 +62,7 @@ TESTS=(
62
62
  scripts/test/test-theme-contrast.rb
63
63
  scripts/test/test-hydrate-reserve.rb
64
64
  scripts/test/test-hero-summary.rb
65
+ scripts/test/test-listing-entry-titles.rb
65
66
  scripts/test/test-lighthouse-policy.rb
66
67
  scripts/test/test-home-lists.rb
67
68
  scripts/test/test-home-articles.rb
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pandorga
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - The Pandorga contributors
@@ -449,6 +449,7 @@ files:
449
449
  - scripts/test/test-language-export.rb
450
450
  - scripts/test/test-ledger-blocks.rb
451
451
  - scripts/test/test-lighthouse-policy.rb
452
+ - scripts/test/test-listing-entry-titles.rb
452
453
  - scripts/test/test-listing-filter-contract.rb
453
454
  - scripts/test/test-math-row-breaks.mjs
454
455
  - scripts/test/test-math-row-breaks.rb