docs: document string interpolation syntax and update code examples across docs and site
Add a new "Interpolation" section to the values documentation explaining the `%(expr)` syntax with examples of complex expressions and nested interpolation. Update all code samples in README.md, getting-started.markdown, and index.markdown to use the new interpolation syntax instead of string concatenation. Adjust syntax highlighting in style.scss by adding a new `.si` class for interpolation spans with distinct background color, and tweak existing color values for strings, numbers, and keywords to improve visual distinction. Add the `\%` escape sequence to the list of supported escape characters in values.markdown.
This commit is contained in:
@@ -56,7 +56,7 @@ it. Here's something to try:
|
||||
Or a little more exciting:
|
||||
|
||||
:::wren
|
||||
for (i in 1..10) System.print("Counting up " + i.toString)
|
||||
for (i in 1..10) System.print("Counting up %(i)")
|
||||
|
||||
You can exit the interpreter using good old Ctrl-C or Ctrl-D, or just throw
|
||||
your computer to the ground and storm off.
|
||||
|
||||
Reference in New Issue
Block a user