<div class="chatlog__message-group"> <div id="chatlog__message-container-349839994275495936" class="chatlog__message-container" data-message-id="349839994275495936"> <div class="chatlog__message"> <div class="chatlog__message-aside"><img class="chatlog__avatar" src="https://cdn.discordapp.com/avatars/189711109966659584/95280765d1be73ce985dce15ea3585f6.png?size=512" alt="Avatar" loading="lazy"></div> <div class="chatlog__message-primary"> <div class="chatlog__header"><span class="chatlog__author" style="color:rgb(237,171,161)" title="omochimetaru" data-user-id="189711109966659584">omochimetaru</span> <a href="/channels/346503087256502274?category=開発以外&channel=zatsu&message_id=349840052668465152"><span class="chatlog__timestamp" title="Wednesday, August 23, 2017 8:59 AM"></span></a><a href="#chatlog__message-container-349839994275495936">8/23/2017 8:59 AM</a></div> <div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve"><code class="chatlog__markdown-pre chatlog__markdown-pre--multiline nohighlight"> A GYB template consists of the following elements: - Literal text which is inserted directly into the output - %% or $$ in literal text, which insert literal '%' and '$' symbols respectively. - Substitutions of the form ${<python-expression>}. The Python expression is converted to a string and the result is inserted into the output. - Python code delimited by %{...}%. Typically used to inject definitions (functions, classes, variable bindings) into the evaluation context of the template. Common indentation is stripped, so you can add as much indentation to the beginning of this code as you like - Lines beginning with optional whitespace followed by a single '%' and Python code. %-lines allow you to nest other constructs inside them. To close a level of nesting, use the "%end" construct. - Lines beginning with optional whitespace and followed by a single '%' and the token "end", which close open constructs in %-lines. Example template: - Hello - %{ x = 42 def succ(a): return a+1 }% I can assure you that ${x} < ${succ(x)} % if int(y) > 7: % for i in range(3): y is greater than seven! % end % else: y is less than or equal to seven % end - The End. - When run with "gyb -Dy=9", the output is - Hello - I can assure you that 42 < 43 y is greater than seven! y is greater than seven! y is greater than seven! - The End. - '''</code></span></div> </div> </div> </div> <div id="chatlog__message-container-349840052668465152" class="chatlog__message-container" data-message-id="349840052668465152"> <div class="chatlog__message"> <div class="chatlog__message-aside"> <div class="chatlog__short-timestamp" title="Wednesday, August 23, 2017 8:59 AM">8:59 AM</div> </div> <div class="chatlog__message-primary"> <div class="chatlog__content chatlog__markdown"><span class="chatlog__markdown-preserve">↑ヘルプ自体もソースの中に入ってるからソース読めば同じことやな <img loading="lazy" class="chatlog__emoji " alt="😋" title="yum" src="https://cdn.jsdelivr.net/gh/twitter/twemoji@latest/assets/svg/1f60b.svg"></span></div> </div> </div> </div> </div>