powertom 0.2.3 → 0.2.5

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: '063998b638b3d0707d89cbbc9cb0fdb9b67b03431abebdfd93c6833b6f2bfb04'
4
- data.tar.gz: 3fa5ee560e6e2564423e799affdeeb667ca7ac71d65b0515ee9bceacd795b9c3
3
+ metadata.gz: 78b836be78ce3eb57f1ee656d4a73ffdd307c60bf12bfa11e332800dcda43ece
4
+ data.tar.gz: 5c0ea72ff17fa162c17c265d6a850b0c4b7ff5d16665a1ea418cc9467f5a8a9d
5
5
  SHA512:
6
- metadata.gz: 625ad96a175992d6a675d8067fa316e87f2410c49e867792843a05cbbfdab662ceaa84742809be2603cb56e2880633f726d667c6388bbd6b8df6ec42bd7e983f
7
- data.tar.gz: 2a0b74ce479359f0453ddb325cc33f880397ef5e4d3f6678b7255bd929baa040d85849826fef6542155c537755962953d2a4c44bfecf27c2d9752ed226e2b337
6
+ metadata.gz: 827c7c32494ffe34e928e33be2eeec447cae486d67cd7fe718e61ead3bd590730ab30824e4ed4a073016ebe7577591f86c0e32ec73b6587a6658a2ea7bb9c99d
7
+ data.tar.gz: e79d9d9bca6fc0b15367cf8d28d4e5ff789374a4b807648e14897281f268b433c653f7165349677009a214685e8501e2d4ce8d970bfd031ccacd472798c4a5b0
data/README.md CHANGED
@@ -70,7 +70,7 @@ Notes: {{#each scenarios}}
70
70
  **2. The engineer prepares the data** — TOML is the default data format:
71
71
 
72
72
  ```toml
73
- # TOML — format de données par défaut
73
+ # TOML — default data format
74
74
  product_name = "Student workspace"
75
75
  show_compare = true
76
76
 
@@ -88,17 +88,16 @@ detail = "Ready automatically every Sunday"
88
88
  ```ruby
89
89
  require "powertom"
90
90
 
91
- # Lecture du modèle, liaison des balises, duplication/suppression de pages,
92
- # remplacement des images
91
+ # Read the template, bind tags, clone/remove pages, replace images
93
92
  result = PowerTom.render("templates/report.pptx", data: "data/report.toml")
94
93
  result.save("out/report.pptx")
95
- result.warnings.each { |w| warn w } # champs inutilisés, valeurs de repli…
94
+ result.warnings.each { |w| warn w } # unused fields, fallback values…
96
95
  ```
97
96
 
98
97
  Or pass a Hash directly when the data comes from a database or an API:
99
98
 
100
99
  ```ruby
101
- # Même appel avec des données en mémoire
100
+ # Same call with in-memory data
102
101
  result = PowerTom.render("templates/report.pptx", data: {
103
102
  product_name: "Student workspace",
104
103
  kpis: [{ name: "Adoption rate", value: "29.7%" }],
@@ -121,6 +120,7 @@ result = PowerTom.render("templates/report.pptx", data: {
121
120
  | `{{#rows groups}} ... {{/rows}}` | table rows | Paired row block: clones all rows between the markers per item (up to 3 levels) |
122
121
  | `{{#cols subjects}} ... {{/cols}}` | table row | Column band: one or more template columns; may be declared in the header or inside a row block |
123
122
  | `{{#if groups[].flag}} ... {{/if}}` | table rows | Conditional row block inside a `#rows` block |
123
+ | `{{#if subjects[].show}} ... {{/if}}` | table header | Conditional columns inside a `#cols` band |
124
124
  | `{{price:currency}}` | body | Formatter: ¥1,234.56 |
125
125
  | `{{ratio:percent.1}}` | body | Formatter: 29.7% |
126
126
  | `{{day:date.year_month}}` | body | Formatter: 2026年11月 |
@@ -130,7 +130,7 @@ result = PowerTom.render("templates/report.pptx", data: {
130
130
  - **Split runs are handled**: if PowerPoint stores `{{title}}` as several runs, the engine merges the paragraph and replaces correctly; the result inherits the first run's style.
131
131
  - **Nested table rows**: `{{#rows groups}}` occupies a whole row (first cell only), and the next row is the parent content row; `{{#rows groups[].items}}` followed by its own content row adds one nesting level. Two levels maximum; parent and child tags use full paths (`{{groups[].name}}`, `{{groups[].items[].name}}`).
132
132
  - **Dynamic columns**: put `{{#grid rows: distribution cols: bands value: counts}}` in the header row's first cell. The header row's second cell is the column template (`{{col.label}}`), and the next row is the row template (`{{row.name}}` in the first cell, `{{cell}}` in the data columns). Exactly two columns; `value:` is optional (defaults to `row[col.key]`).
133
- - **Row blocks (v0.2.x)**: `{{#rows groups}} ... {{/rows}}` each occupy a whole row; everything between them is one record template and is cloned per item. Up to 3 nested levels; `{{row.name}}` refers to the current record. A `{{#cols ...}}` band may be declared in the header or directly inside a row block, and may span several template columns; `value: scores,rates` maps one field to each template column (a single field is shared by all). A `{{#if ...}} ... {{/if}}` block inside a row block removes all its rows for items where the condition is falsy.
133
+ - **Row blocks (v0.2.x)**: `{{#rows groups}} ... {{/rows}}` each occupy a whole row; everything between them is one record template and is cloned per item. Up to 3 nested levels; `{{row.name}}` refers to the current record. A `{{#cols ...}}` band may be declared in the header or directly inside a row block, and may span several template columns; `value: scores,rates` maps one field to each template column (a single field is shared by all). A `{{#if ...}} ... {{/if}}` block inside a row block removes its rows when the condition is falsy; inside a `#cols` band it removes the wrapped columns per column item.
134
134
  - **Pictures**: name the shape or its alt text `powertom:image:cover` and pass a file path in the data. Replacement always fills the shape and crops from the centre.
135
135
  - One directive per notes page, maximum.
136
136
  - TOML dates are written unquoted (`report_date = 2026-01-20`), normalised to Ruby `Date`, and can be formatted with `{{report_date:date.cn}}`.
@@ -279,9 +279,6 @@ PowerTom occupe la couche intermédiaire : un **moteur de modèles au-dessus de
279
279
  ```ruby
280
280
  # Gemfile
281
281
  gem "powertom"
282
-
283
- # Chemin local tant que le gem n'est pas publié sur RubyGems
284
- # gem "powertom", path: "/chemin/vers/PowerTom"
285
282
  ```
286
283
 
287
284
  Nécessite Ruby >= 3.3 ; dépend de `ruby_pptx ~> 0.2.0` (lecture/écriture) et de `tomlrb ~> 3.0` (fichiers de données).
@@ -200,11 +200,11 @@ module PowerTom
200
200
  true
201
201
  end
202
202
 
203
- # 列带标记({{#cols}} / {{/cols}})在列克隆前移除,避免被复制到每一列
203
+ # 列带标记({{#cols}} / {{/cols}} / 列条件)在列克隆前移除,避免被复制到每一列
204
204
  def strip_column_markers(table_element, row_index, first_col, last_col)
205
205
  cells = table_element.tr_list[row_index].tc_list
206
206
  (first_col..last_col).each do |c|
207
- strip_tags_in_cell(cells[c], /\{\{\s*(?:#cols\b[^{}]*|\/cols)\s*\}\}/)
207
+ strip_tags_in_cell(cells[c], /\{\{\s*(?:#cols\b[^{}]*|\/cols|#if\b[^{}]*|\/if)\s*\}\}/)
208
208
  end
209
209
  true
210
210
  end
@@ -274,6 +274,23 @@ module PowerTom
274
274
  template_cells.each { |cell| tr.remove(cell) }
275
275
  end
276
276
  sync_table_height(table_element, frame_element)
277
+ sync_table_width(table_element, frame_element)
278
+ true
279
+ end
280
+
281
+ # 按原始列索引删除若干列(从右到左),用于列级条件
282
+ def remove_table_columns(table_element, frame_element, indices)
283
+ return true if indices.empty?
284
+
285
+ grid = table_element.xpath("./a:tblGrid").first
286
+ grid_cols = grid.gridCol_list
287
+ indices.uniq.sort.reverse_each do |index|
288
+ grid.remove(grid_cols[index])
289
+ table_element.tr_list.each do |tr|
290
+ tr.remove(tr.tc_list[index])
291
+ end
292
+ end
293
+ sync_table_width(table_element, frame_element)
277
294
  true
278
295
  end
279
296
 
@@ -384,6 +401,13 @@ module PowerTom
384
401
  ext&.set("cy", total.to_s)
385
402
  end
386
403
 
404
+ # 表格实际宽度 = 各 gridCol 的 w 之和;写回 graphicFrame 的 a:ext/@cx
405
+ def sync_table_width(table_element, frame_element)
406
+ total = table_element.xpath("./a:tblGrid/a:gridCol").sum { |col| col.get("w").to_i }
407
+ ext = frame_element.xpath("./p:xfrm/a:ext").first
408
+ ext&.set("cx", total.to_s)
409
+ end
410
+
387
411
  def collect_container_texts(entries, container, kind)
388
412
  label = begin
389
413
  name = container.part.name
@@ -29,6 +29,16 @@ module PowerTom
29
29
  value_paths.size == 1 ? value_paths.first : value_paths[template_index]
30
30
  end
31
31
 
32
+ # 列条件取值:优先当前列项,缺失时回退整页数据(支持 subjects[].show 完整路径)
33
+ def column_condition_value(path, col, band_path, data)
34
+ relative = path.start_with?("#{band_path}[].") ? path.delete_prefix("#{band_path}[].") : path
35
+ begin
36
+ PathResolver.resolve(col, relative)
37
+ rescue MissingDataError
38
+ PathResolver.resolve(data, relative)
39
+ end
40
+ end
41
+
32
42
  def cell_value(row, col, value_path)
33
43
  key = column_key(col)
34
44
  container = value_path ? PathResolver.resolve(row, value_path) : row
@@ -275,13 +275,17 @@ module PowerTom
275
275
  ctx = { slide_no: table[:slide_no], shape: table[:shape] }
276
276
  band = plan[:cols]
277
277
  cols = []
278
+ column_plan = []
278
279
  if band
279
280
  cols = fetch_loop_array(binder, band[:path], table, ctx)
280
281
  check_grid_columns!(cols, table, ctx)
282
+ visibility = column_visibility(band, cols)
283
+ column_plan = build_column_plan(band, cols, visibility)
281
284
  # 先剥离标记,再复制列:否则标记会被复制到每一列
282
285
  adapter.strip_column_markers(table[:element], band[:row], band[:first_col], band[:last_col])
283
286
  adapter.expand_column_band(table[:element], table[:frame],
284
287
  band[:first_col], band[:last_col], cols.size)
288
+ remove_hidden_columns(adapter, table, band, visibility)
285
289
  end
286
290
 
287
291
  # 行索引在列克隆后不变,先捕获顶层区块的开闭行元素
@@ -307,7 +311,59 @@ module PowerTom
307
311
  end
308
312
  adapter.refresh_table_height(table[:element], table[:frame])
309
313
 
310
- { kind: :blocks, records: records, cols: cols, band: band }
314
+ { kind: :blocks, records: records, cols: cols, band: band,
315
+ column_plan: column_plan }
316
+ end
317
+
318
+ # 列条件:按列项求值,返回 [item][template_column] 的可见矩阵
319
+ def column_visibility(band, cols)
320
+ width = band[:width]
321
+ return cols.map { Array.new(width, true) } if band[:ifs].nil? || band[:ifs].empty?
322
+
323
+ cols.map do |col|
324
+ values = band[:ifs].to_h do |node|
325
+ [node, column_condition_truthy?(node[:path], col, band)]
326
+ end
327
+ Array.new(width) do |template_index|
328
+ target = band[:first_col] + template_index
329
+ node = band[:ifs].find { |n| target.between?(n[:open_col], n[:close_col]) }
330
+ node.nil? || values[node]
331
+ end
332
+ end
333
+ end
334
+
335
+ def column_condition_truthy?(path, col, band)
336
+ value = GridValue.column_condition_value(path, col, band[:path], @data)
337
+ !(value.nil? || value == false)
338
+ rescue MissingDataError => e
339
+ raise MissingDataError, "{{#if #{path}}} 无法求值:#{e.message}"
340
+ end
341
+
342
+ # 展开后的列计划:每个输出列对应哪个列项、哪个模板列
343
+ def build_column_plan(band, cols, visibility)
344
+ plan = []
345
+ cols.each_with_index do |col, item_index|
346
+ band[:width].times do |template_index|
347
+ next unless visibility[item_index][template_index]
348
+
349
+ plan << { col: col, template_index: template_index }
350
+ end
351
+ end
352
+ plan
353
+ end
354
+
355
+ def remove_hidden_columns(adapter, table, band, visibility)
356
+ hidden = []
357
+ visibility.each_with_index do |item, item_index|
358
+ item.each_with_index do |visible, template_index|
359
+ next if visible
360
+
361
+ hidden << band[:first_col] + item_index * band[:width] + template_index
362
+ end
363
+ end
364
+ return if hidden.empty?
365
+
366
+ adapter.remove_table_columns(table[:element], table[:frame], hidden)
311
367
  end
312
368
 
313
369
  # 子区块的数组依赖父项:按每个父项解析一次,供行计划与展开复用
@@ -510,11 +566,13 @@ module PowerTom
510
566
 
511
567
  col_index = ctx[:col_index].to_i
512
568
  start = band[:first_col]
513
- width = band[:last_col] - start + 1
514
- return nil if col_index < start || col_index >= start + width * scope[:cols].size
569
+ return nil if col_index < start
570
+
571
+ entry = scope[:column_plan][col_index - start]
572
+ return nil unless entry
515
573
 
516
- col = scope[:cols][(col_index - start) / width]
517
- template_index = (col_index - start) % width
574
+ col = entry[:col]
575
+ template_index = entry[:template_index]
518
576
  value_path = GridValue.band_value_path(band[:value_paths], template_index)
519
577
  record = scope[:records][ctx[:row_index]]
520
578
  row = record && record[:row_item]
@@ -411,9 +411,11 @@ module PowerTom
411
411
  end
412
412
 
413
413
  def blocks_plan(rows, merged_rows)
414
- row_tags, col_tags = collect_block_tags(rows)
415
- blocks = parse_block_tree(rows, row_tags)
414
+ row_tags, col_tags, if_tags = collect_block_tags(rows)
416
415
  band = parse_column_band(rows, row_tags, col_tags)
416
+ col_ifs, row_ifs = split_ifs(if_tags, band)
417
+ band[:ifs] = parse_column_ifs(rows, col_ifs, band) if band
418
+ blocks = parse_block_tree(rows, (row_tags + row_ifs).sort_by { |t| t[:row] })
417
419
  if band && band_in_if?(blocks, band[:row])
418
420
  raise TemplateSyntaxError, "表格第 #{band[:row] + 1} 行:列带不能写在条件区块内"
419
421
  end
@@ -427,15 +429,18 @@ module PowerTom
427
429
  def collect_block_tags(rows)
428
430
  row_tags = []
429
431
  col_tags = []
432
+ if_tags = []
430
433
  rows.each_with_index do |cells, r|
431
434
  cells.each_with_index do |text, c|
432
435
  directive_tags(text).each do |tag|
433
436
  raw = raw_of(tag)
434
437
  item = { row: r, col: c, raw: raw, tag: tag }
435
- if raw.start_with?("#rows", "/rows", "#if", "/if")
438
+ if raw.start_with?("#rows", "/rows")
436
439
  row_tags << item
437
440
  elsif raw.start_with?("#cols", "/cols")
438
441
  col_tags << item
442
+ elsif raw.start_with?("#if", "/if")
443
+ if_tags << item
439
444
  else
440
445
  raise TemplateSyntaxError,
441
446
  "表格第 #{r + 1} 行:区块模式不支持 #{tag}(只支持 #rows / #cols / #if 区块)"
@@ -443,7 +448,99 @@ module PowerTom
443
448
  end
444
449
  end
445
450
  end
446
- [row_tags, col_tags]
451
+ [row_tags, col_tags, if_tags]
452
+ end
453
+
454
+ # 列带表头行内、位于列带范围内的 #if 是列级条件;其余是行级条件
455
+ def split_ifs(tags, band)
456
+ return [[], tags] unless band
457
+
458
+ col_ifs = []
459
+ row_ifs = []
460
+ tags.each do |tag|
461
+ if tag[:row] == band[:row] && tag[:col].between?(band[:first_col], band[:last_col])
462
+ col_ifs << tag
463
+ else
464
+ row_ifs << tag
465
+ end
466
+ end
467
+ [col_ifs, row_ifs]
468
+ end
469
+
470
+ def parse_column_ifs(rows, tags, band)
471
+ return [] if tags.empty?
472
+
473
+ stack = []
474
+ result = []
475
+ tags.each do |item|
476
+ if item[:raw].start_with?("#if")
477
+ node = open_column_if(rows, item, band, stack)
478
+ stack.push(node)
479
+ else
480
+ close_column_if(rows, item, band, stack, result)
481
+ end
482
+ end
483
+ unless stack.empty?
484
+ node = stack.last
485
+ raise TemplateSyntaxError,
486
+ "表格第 #{band[:row] + 1} 行:列条件 {{#if #{node[:path]}}} 缺少 {{/if}}"
487
+ end
488
+
489
+ result.sort_by { |node| node[:open_col] }.each_cons(2) do |left, right|
490
+ next if right[:open_col] > left[:close_col]
491
+
492
+ raise TemplateSyntaxError,
493
+ "表格第 #{band[:row] + 1} 行:列条件范围重叠" \
494
+ "(第 #{left[:open_col] + 1}–#{left[:close_col] + 1} 列与 " \
495
+ "#{right[:open_col] + 1}–#{right[:close_col] + 1} 列)"
496
+ end
497
+ result
498
+ end
499
+
500
+ def open_column_if(rows, item, band, stack)
501
+ validate_column_if_marker!(rows, item, band)
502
+ path = item[:tag][IF_OPEN_RE, 1]
503
+ unless path
504
+ raise TemplateSyntaxError,
505
+ "表格第 #{band[:row] + 1} 行:#{item[:tag]} 列条件标记不合法,应为 {{#if 路径}}"
506
+ end
507
+ if path.include?("[]") && !path.start_with?("#{band[:path]}[]")
508
+ raise TemplateSyntaxError,
509
+ "表格第 #{band[:row] + 1} 行:{{#if #{path}}} 只能引用当前列数组 " \
510
+ "#{band[:path]}[] 或整页字段"
511
+ end
512
+ if stack.any?
513
+ raise TemplateSyntaxError, "表格第 #{band[:row] + 1} 行:列条件不能嵌套"
514
+ end
515
+
516
+ { path: path, open_col: item[:col], close_col: nil }
517
+ end
518
+
519
+ def close_column_if(rows, item, band, stack, result)
520
+ validate_column_if_marker!(rows, item, band)
521
+ if stack.empty?
522
+ raise TemplateSyntaxError,
523
+ "表格第 #{band[:row] + 1} 行:{{/if}} 没有对应的列条件 {{#if}}"
524
+ end
525
+
526
+ node = stack.pop
527
+ if item[:col] < node[:open_col]
528
+ raise TemplateSyntaxError,
529
+ "表格第 #{band[:row] + 1} 行:{{/if}} 必须在列条件 {{#if}} 右侧"
530
+ end
531
+ node[:close_col] = item[:col]
532
+ result << node
533
+ end
534
+
535
+ def validate_column_if_marker!(rows, item, band)
536
+ line = "表格第 #{band[:row] + 1} 行"
537
+ unless item[:row] == band[:row] &&
538
+ item[:col].between?(band[:first_col], band[:last_col])
539
+ raise TemplateSyntaxError, "#{line}:列条件必须写在列带表头范围内"
540
+ end
541
+ return if rows[item[:row]][item[:col]].to_s.include?(item[:tag])
542
+
543
+ raise TemplateSyntaxError, "#{line}:#{item[:tag]} 列条件标记定位失败"
447
544
  end
448
545
 
449
546
  def parse_block_tree(rows, tags)
@@ -162,6 +162,7 @@ module PowerTom
162
162
  ctx = l[:context]
163
163
  next if ctx[:table_shape] && failed_tables.include?([ctx[:slide_no], ctx[:table_shape]])
164
164
  next if block_row_stacks.dig([ctx[:slide_no], ctx[:table_shape]], ctx[:row_index])
165
+ next if block_band_cell?(table_plans, ctx)
165
166
 
166
167
  grid = grid_plan_for(table_plans, ctx)
167
168
  if grid && grid_variable_path?(l[:path])
@@ -182,6 +183,7 @@ module PowerTom
182
183
  next if l[:path].include?("[]")
183
184
  next if block_row_stacks.dig([l[:context][:slide_no], l[:context][:table_shape]],
184
185
  l[:context][:row_index])
186
+ next if block_band_cell?(table_plans, l[:context])
185
187
  next if grid_plan_for(table_plans, l[:context]) && grid_variable_path?(l[:path])
186
188
 
187
189
  overflow_check(l, directives[l[:context][:slide_no]], data, entries)
@@ -199,6 +201,10 @@ module PowerTom
199
201
  used_roots << root_of(l[:path]) unless grid_variable_path?(l[:path])
200
202
  next
201
203
  end
204
+ if block_band_cell?(table_plans, l[:context])
205
+ used_roots << root_of(l[:path]) unless grid_variable_path?(l[:path])
206
+ next
207
+ end
202
208
  next if grid_plan_for(table_plans, l[:context]) && grid_variable_path?(l[:path])
203
209
 
204
210
  used_roots << root_of(l[:path])
@@ -447,6 +453,17 @@ module PowerTom
447
453
  path == "col" || path.start_with?("col.")
448
454
  end
449
455
 
456
+ # 该单元格是否位于区块表格的列带范围内(含不在行区块内的表头行)
457
+ def block_band_cell?(plans, context)
458
+ return false unless context[:table_shape]
459
+
460
+ plan = plans[[context[:slide_no], context[:table_shape]]]
461
+ return false unless plan && plan[:kind] == :blocks && plan[:cols]
462
+
463
+ band = plan[:cols]
464
+ context[:col_index].to_i.between?(band[:first_col], band[:last_col])
465
+ end
466
+
450
467
  # ---- v0.2.0:行区块 + 列带对账 ----
451
468
 
452
469
  def reconcile_block_tables(plans, labels_by_row, data, entries)
@@ -455,10 +472,39 @@ module PowerTom
455
472
 
456
473
  ctx = { slide_no: slide_no, shape: shape }
457
474
  cols = plan[:cols] ? (resolve_grid_array(plan[:cols][:path], ctx, data, entries) || []) : []
475
+ reconcile_column_ifs(plan[:cols], cols, ctx, data, entries)
476
+ reconcile_static_band_header(plan, cols, labels_by_row, ctx, data, entries)
458
477
  reconcile_blocks(plan[:blocks], {}, nil, cols, plan[:cols], labels_by_row, ctx, data, entries)
459
478
  end
460
479
  end
461
480
 
481
+ # 列带表头若不在行区块内,其 {{col.*}} 也要单独对账
482
+ def reconcile_static_band_header(plan, cols, labels_by_row, ctx, data, entries)
483
+ band = plan[:cols]
484
+ return unless band
485
+
486
+ stacks = TableLoop.build_row_stacks(plan[:blocks])
487
+ return unless stacks[band[:row]].nil?
488
+
489
+ labels_by_row[[ctx[:slide_no], ctx[:shape], band[:row]]].each do |label|
490
+ reconcile_block_label(label, {}, nil, cols, band, "列带", data, entries)
491
+ end
492
+ end
493
+
494
+ # 列条件:每个列项都要能取到条件字段
495
+ def reconcile_column_ifs(band, cols, ctx, data, entries)
496
+ return unless band && band[:ifs]&.any?
497
+
498
+ band[:ifs].each do |node|
499
+ cols.each_with_index do |col, index|
500
+ GridValue.column_condition_value(node[:path], col, band[:path], data)
501
+ rescue MissingDataError => e
502
+ entries << error_entry(ctx[:slide_no], ctx[:shape], node[:path],
503
+ "列条件第 #{index + 1} 项:#{e.message}")
504
+ end
505
+ end
506
+ end
507
+
462
508
  # 与渲染同一套行计划:按区块逐项展开,再对每一行模板里的标签对账
463
509
  def reconcile_blocks(blocks, parent_scope, parent_item, cols, band,
464
510
  labels_by_row, ctx, data, entries)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PowerTom
4
- # 设计文档 §6:v0.2.3 文档与元数据更新
5
- VERSION = "0.2.3"
4
+ # 设计文档 §6:v0.2.5 文档结构与元数据打磨
5
+ VERSION = "0.2.5"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: powertom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - PowerTom contributors
@@ -37,10 +37,17 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '3.0'
40
- description: 设计师在 PowerPoint 里维护模板,工程师传一个 Ruby Hash,产出成品 deck。排版、字体、母版、主题完全由设计工具掌控,代码只负责扫描标签、绑定数据、克隆页面。
40
+ description: |-
41
+ PowerTom is a PowerPoint template engine for Ruby. Designers keep the template in PowerPoint; engineers pass a Ruby Hash or a TOML file and get a finished deck. Layout, fonts, colours, masters and theme stay under the designer's control.
42
+
43
+ PowerTom est un moteur de modèles PowerPoint pour Ruby. Les designers conservent le modèle dans PowerPoint ; les ingénieurs passent un Hash Ruby ou un fichier TOML et obtiennent un deck finalisé. La mise en page, les polices, les couleurs, les masques et le thème restent sous le contrôle du designer.
44
+
45
+ 设计师在 PowerPoint 里维护模板,工程师传一个 Ruby Hash 或 TOML 文件,产出成品 deck。排版、字体、配色、母版和主题完全由设计工具掌控。
41
46
  executables: []
42
47
  extensions: []
43
- extra_rdoc_files: []
48
+ extra_rdoc_files:
49
+ - LICENSE
50
+ - README.md
44
51
  files:
45
52
  - LICENSE
46
53
  - README.md
@@ -62,6 +69,7 @@ homepage: https://github.com/ixepet/powertom
62
69
  licenses:
63
70
  - MIT
64
71
  metadata:
72
+ homepage_uri: https://github.com/ixepet/powertom
65
73
  source_code_uri: https://github.com/ixepet/powertom
66
74
  bug_tracker_uri: https://github.com/ixepet/powertom/issues
67
75
  documentation_uri: https://github.com/ixepet/powertom/blob/main/docs/usage.md