Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mustache Template 話 2024
Search
karupanerura
February 11, 2024
Programming
0
35
Mustache Template 話 2024
YAYAPC::Hiroshima 2024
Lightning Talk
karupanerura
February 11, 2024
Tweet
Share
More Decks by karupanerura
See All by karupanerura
Use Perl as Better Shell Script
karupanerura
0
780
GoでParserを書く
karupanerura
4
960
マイ隙間家具OSSたちのご紹介
karupanerura
2
270
1つの言語を原点に色々な言語を学ぶということ
karupanerura
4
2.9k
Javaの実装をPerlでテストする
karupanerura
0
1.2k
Go Generics Overview
karupanerura
0
1.3k
Japan.pm 2021 開催まで至る道
karupanerura
0
2.1k
Perl MongersのためのAWS_CDK入門
karupanerura
0
150
Webシステムのパフォーマンス・チューニング
karupanerura
2
850
Other Decks in Programming
See All in Programming
alien-signals と自作 OSS で実現する フレームワーク非依存な ロジック共通化の探求 / Exploring Framework-Agnostic Logic Sharing with alien-signals and Custom OSS
aoseyuu
2
660
pnpm に provenance のダウングレード を検出する PR を出してみた
ryo_manba
1
160
Developer Joy - The New Paradigm
hollycummins
1
370
CSC509 Lecture 07
javiergs
PRO
0
250
Claude CodeによるAI駆動開発の実践 〜そこから見えてきたこれからのプログラミング〜
iriikeita
0
340
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
200
NIKKEI Tech Talk#38
cipepser
0
250
Reactive Thinking with Signals and the Resource API
manfredsteyer
PRO
0
110
Vueのバリデーション、結局どれを選べばいい? ― 自作バリデーションの限界と、脱却までの道のり ― / Which Vue Validation Library Should We Really Use? The Limits of Self-Made Validation and How I Finally Moved On
neginasu
2
1.6k
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
920
Catch Up: Go Style Guide Update
andpad
0
250
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
290
Featured
See All Featured
Become a Pro
speakerdeck
PRO
29
5.6k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.2k
A Tale of Four Properties
chriscoyier
161
23k
Practical Orchestrator
shlominoach
190
11k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
31
2.7k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Building a Modern Day E-commerce SEO Strategy
aleyda
44
7.8k
Writing Fast Ruby
sferik
630
62k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
4 Signs Your Business is Dying
shpigford
185
22k
Mobile First: as difficult as doing things right
swwweet
225
10k
Transcript
Mustache Template 2024 YAYAPC::Hiroshima 2024 Lightning Talk @karupanerura
Mustache Template?
Hello {{name}}
YAPC::{{{country}}} {{#tiny}}::Tiny{{/tiny}} {{year}}
͜͏͍͏ͭ
ࢮ͵΄Ͳ͍ΖΜͳݴޠͰ࣮͞Ε͍ͯΔ
Logic-less templates Β͍͠
࣮spec͋Δ
Speci fi cation
Speci fi cation
Speci fi cation
ςετέʔεͱ༷ͯ͠Λهड़
comments.yaml
comments.yaml
͜͏͍͏ͷ͕ͨ͘͞Μ͋Δ
ϚχϡΞϧ͋Δ
ϚχϡΞϧ
͜͜ͰϚχϡΞϧΛνϥݟ͢Δ https://mustache.github.io/mustache.5.html
ຊ
࣮ϑϧεΫϥον࣮ͭ͘Γ·ͨ͠
ਲڰͰϑϧεϖοΫ࣮ࡁ
Speci fi cationͷςετέʔε ͯ͢PASS
Mustache Templateͷ༷ ͕͜͜Ϝζ͍
ίϯςΩετ
ίϯςΩετ • ʢPerlͷίϯςΩετͰͳ͍ʣ • ςϯϓϨʔτʹ͢ͷ͜ͱΛίϯςΩετͱݺͿ • ͨͱ͑ "Hello, {{name}}" ʹରͯ͠
{ name => "papix" } ͩͱͯ͠ • { name => "papix" } શମ͕ίϯςΩετ
ίϯςΩετͷ͍͠ϙΠϯτ • ܧঝ
ϗϫΠτεϖʔεͷѻ͍
֤specʹࡏ
֤specʹࡏ
ΠϯϥΠϯ͔ͦ͏͡Όͳ͍͔ͷ۠ผ
ΠϯϥΠϯ͔ͦ͏͡Όͳ͍͔ͷ۠ผ
ܧঝςϯϓϨʔτ
࠶ؼ͕Ͱ͖Δ
ͬͺΓείʔϓΛܧঝ͢Δ
ϥϜμ
ϥϜμ
ϥϜμ
ϥϜμ
ϠόΆ͍Μͱ • Lambdaͷѻ͍͕2छྨ͋Δ • ςϯϓϨʔτʹຒΊࠐΉͱͯ͠ͷLambda • ηΫγϣϯͷதͷςΩετΛςϯϓϨʔτʹ͢ΔLambda • ޙऀ͕͍ •
ੜͷςΩετʹ͠ͳ͍ͱ͍͚ͳ͍
ͭ·Γ͜͏
ͭΒ͍
ਲڰͰϑϧεϖοΫ࣮͢Δͷ Ίͱ͜