powertom 0.2.2 → 0.2.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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +16 -5
  3. data/lib/powertom/version.rb +2 -2
  4. metadata +2 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: feb18b4055ad1229aba28ef398e78d829e0ef427df7b1fb3462dd01a23225058
4
- data.tar.gz: da8dfe60234ef32aa8f237d33d0539f14006d220e8f58c2c427d84a05e3e50af
3
+ metadata.gz: '063998b638b3d0707d89cbbc9cb0fdb9b67b03431abebdfd93c6833b6f2bfb04'
4
+ data.tar.gz: 3fa5ee560e6e2564423e799affdeeb667ca7ac71d65b0515ee9bceacd795b9c3
5
5
  SHA512:
6
- metadata.gz: aac6b281fe867b01794e63be088a67a07f34c26f1848313491258cdf41e12315f3740f78cbffb8a8ce2870ff9218b441fab08a51c1419725df7f4dd6940ff726
7
- data.tar.gz: 130010e8e837f4aeb6168b3ccd26378c6cce4611ec128910cd49ad9bf4084b13daa8f8161f81f1316625990f3ed0401ea689c443012171c6235e502a4f122104
6
+ metadata.gz: 625ad96a175992d6a675d8067fa316e87f2410c49e867792843a05cbbfdab662ceaa84742809be2603cb56e2880633f726d667c6388bbd6b8df6ec42bd7e983f
7
+ data.tar.gz: 2a0b74ce479359f0453ddb325cc33f880397ef5e4d3f6678b7255bd929baa040d85849826fef6542155c537755962953d2a4c44bfecf27c2d9752ed226e2b337
data/README.md CHANGED
@@ -1,8 +1,17 @@
1
1
  # PowerTom — PowerPoint template engine for Ruby
2
2
 
3
+ [![Gem Version](https://img.shields.io/gem/v/powertom)](https://rubygems.org/gems/powertom)
4
+
3
5
  > Designers keep the template in PowerPoint. Engineers pass a Ruby Hash (or a TOML file) and get a finished deck.
4
6
  > Layout, fonts, colours, masters and theme stay under the designer's control; the code only scans tags, binds data and clones slides.
5
7
 
8
+ ```ruby
9
+ require "powertom"
10
+
11
+ data = { title: "Final exams", classes: [{ name: "Grade 8 (3)", avg: 82.4 }] }
12
+ PowerTom.render("template.pptx", data: data).save("report.pptx")
13
+ ```
14
+
6
15
  <sub>Not affiliated with Microsoft or TomTom.</sub>
7
16
 
8
17
  ---
@@ -44,9 +53,6 @@ PowerTom fills the middle layer: a **template engine on top of [`ruby_pptx`](htt
44
53
  ```ruby
45
54
  # Gemfile
46
55
  gem "powertom"
47
-
48
- # Chemin local tant que le gem n'est pas publié sur RubyGems
49
- # gem "powertom", path: "/chemin/vers/PowerTom"
50
56
  ```
51
57
 
52
58
  Requires Ruby >= 3.3; depends on `ruby_pptx ~> 0.2.0` (read/write) and `tomlrb ~> 3.0` (data files).
@@ -102,6 +108,8 @@ result = PowerTom.render("templates/report.pptx", data: {
102
108
 
103
109
  ## Template syntax
104
110
 
111
+ > Full tag reference: [docs/usage.md](https://github.com/ixepet/powertom/blob/main/docs/usage.md) — data shape, every tag form, table blocks, formatters, images and errors.
112
+
105
113
  | Syntax | Where | Meaning |
106
114
  | --- | --- | --- |
107
115
  | `{{title}}` | body | Bind a field |
@@ -126,7 +134,8 @@ result = PowerTom.render("templates/report.pptx", data: {
126
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.
127
135
  - One directive per notes page, maximum.
128
136
  - TOML dates are written unquoted (`report_date = 2026-01-20`), normalised to Ruby `Date`, and can be formatted with `{{report_date:date.cn}}`.
129
- - Full guide for designers (Chinese): [docs/模板制作规范.md](docs/模板制作规范.md).
137
+ - Full guide for designers (Chinese): [docs/模板制作规范.md](https://github.com/ixepet/powertom/blob/main/docs/模板制作规范.md).
138
+ - Full usage reference (English): [docs/usage.md](https://github.com/ixepet/powertom/blob/main/docs/usage.md).
130
139
 
131
140
  Built-in formatters: `currency`, `percent`, `number`, `date` (with `.year_month` / `.cn` / `.short`).
132
141
  Register your own:
@@ -328,6 +337,8 @@ result = PowerTom.render("templates/report.pptx", data: {
328
337
 
329
338
  ## Syntaxe des modèles
330
339
 
340
+ > Référence complète : [docs/usage.md](https://github.com/ixepet/powertom/blob/main/docs/usage.md) — données, balises, blocs de tableaux, formateurs, images et erreurs.
341
+
331
342
  | Syntaxe | Emplacement | Signification |
332
343
  | --- | --- | --- |
333
344
  | `{{title}}` | corps | Lier un champ |
@@ -352,7 +363,7 @@ result = PowerTom.render("templates/report.pptx", data: {
352
363
  - **Images** : nommez la forme ou son texte de remplacement `powertom:image:cover` et fournissez un chemin de fichier dans les données. Le remplacement remplit toujours la forme et recadre depuis le centre.
353
364
  - Une seule directive par page de notes, au maximum.
354
365
  - Les dates TOML s'écrivent sans guillemets (`report_date = 2026-01-20`), sont normalisées en `Date` Ruby et peuvent être formatées avec `{{report_date:date.cn}}`.
355
- - Guide complet pour les designers (en chinois) : [docs/模板制作规范.md](docs/模板制作规范.md).
366
+ - Guide complet pour les designers (en chinois) : [docs/模板制作规范.md](https://github.com/ixepet/powertom/blob/main/docs/模板制作规范.md).
356
367
 
357
368
  Formateurs intégrés : `currency`, `percent`, `number`, `date` (avec `.year_month` / `.cn` / `.short`).
358
369
  Ajoutez les vôtres :
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PowerTom
4
- # 设计文档 §6:v0.2 系列首个正式发布
5
- VERSION = "0.2.2"
4
+ # 设计文档 §6:v0.2.3 文档与元数据更新
5
+ VERSION = "0.2.3"
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.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - PowerTom contributors
@@ -64,6 +64,7 @@ licenses:
64
64
  metadata:
65
65
  source_code_uri: https://github.com/ixepet/powertom
66
66
  bug_tracker_uri: https://github.com/ixepet/powertom/issues
67
+ documentation_uri: https://github.com/ixepet/powertom/blob/main/docs/usage.md
67
68
  rdoc_options: []
68
69
  require_paths:
69
70
  - lib