Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Releases: edadma/squiggly

v0.2.3

08 May 02:23
@edadma edadma

Choose a tag to compare

Highlights

First proper release in three years. The parser is rewritten on top of Scala parser-combinators, the language has a real Scala 3.8.3 cross-build, and the renderer covers the any-data shape (Map / List / scalar) end-to-end. 316 / 316 tests green across JVM, Scala.js, and Scala Native.

What changed since v0.1.14

Parser

  • Tag parser rewritten on parser-combinators. Cleaner precedence, better error reporting, and the original recursive-descent quirks are gone. Long history of intermediate "rewrite tag parser" commits collapsed into a stable result.
  • Comment syntax: {{ // a comment }} (one-line, swallows to the closing }}).

Language features

  • {{ define name }} ... {{ end }} / {{ block name expr }} — define/use named blocks. Used by juicer's two-pass baseof / file / folder rendering.
  • {{ for x <- xs }} ... {{ end }} — list iteration; {{ for k, v <- m }} ... {{ end }} for maps.
  • {{ if cond }} ... {{ elif ... }} ... {{ else }} ... {{ end }} — full conditional.
  • {{ with expr }} ... {{ end }} — bind a sub-context.
  • {{ match expr }} {{ case a }} ... {{ case b }} ... {{ end }} — pattern match.
  • {{ x := expr }} — local variable assignment.
  • {{ partial 'name' . }} — pluggable partials via a TemplateLoader.
  • and, or, not — logical operators.
  • {{ x | filter ... }} — pipe syntax for any 1+ arity function.

Renderer

  • Recursive any-data render path. Lists nest, maps print as field-value pairs, scalars do the right thing. The earlier renderer flattened in places it shouldn't.
  • Per-page global context alongside data — partials and sub-contexts can read top-level page data without explicit threading.
  • Hardcoded HTML-escaping in a few places where it was wrong; configurable via the renderer's data callbacks where it makes sense.

Builtins

  • URL helpers: relURL, absURL, urlEscape. Cross-platform — no java.nio.file.Paths.
  • Markdown integration: markdownify renders a string through the markdown lib.
  • Emoji: emojify substitutes :smile: → 😄 via the emoji lib.
  • Strings: upper, lower, trim, replace, split, join, startsWith, endsWith, contains, indexOf, substring, reverse, length, isEmpty, nonEmpty.
  • Lists: head, tail, first, last, append, prepend, compact, distinct, reverse, sort, length, isEmpty, nonEmpty.
  • Maths: abs, plus the usual arithmetic via operators in expressions.
  • Date/time: built on java.time.
  • Regex: matchRE, findRE (with capture groups in 0.2.3), findAllRE, replaceRE, splitRE.
  • Files: fileExists.
  • Debug: context, type for inspecting the data shape inline.

Build / cross-platform

  • Scala 3.8.3 cross-build (was 2.13).
  • Cross-published on JVM, Scala.js, Scala Native. Test data migrated from YAML literals to JSON so the JS / Native builds don't pull in scala-yaml.
  • All compiler warnings eliminated (3.4 migration sweep).
  • Main.scala routes args through cross_platform.processArgs so the CLI works the same on every backend.
  • Dependency baseline: char_reader 0.1.27, cross_platform 0.1.6.

Bug fixes (since 0.2.x began)

  • 0.2.3 — findRE no longer drops capture groups; recursive any-data renderer no longer flattens nested structures.
  • 0.2.2 — version refs in Main.scala and the README synced.
  • Two bugs surfaced by an end-to-end coverage pass landed in 0.2.1.

Compatibility

  • Scala 3.8.3, sbt 1.12.x.
  • Cross-built on JVM, Scala.js, and Scala Native.
  • 316 / 316 tests green across all three platforms.

Used by

  • juicer (the static site generator powering juicer.run) — squiggly is its template engine.

Full changelog: v0.1.14...v0.2.3

Assets 2
Loading

scemplate 0.1.14

28 Oct 12:40
@edadma edadma

Choose a tag to compare

scemplate 0.1.14 Pre-release
Pre-release
  • fix tail recursion for token()
Loading

squiggly 0.1.13

14 Oct 23:55
@edadma edadma

Choose a tag to compare

squiggly 0.1.13 Pre-release
Pre-release
  • added support for looping over maps
  • added string and sequence concatenation operator
  • added several more built-in functions
Loading

squiggly 0.1.12

10 Oct 22:13
@edadma edadma

Choose a tag to compare

squiggly 0.1.12 Pre-release
Pre-release
  • add 'format' function for date formatting
  • minor fixes
Loading

squiggly 0.1.11

09 Oct 23:55
@edadma edadma

Choose a tag to compare

squiggly 0.1.11 Pre-release
Pre-release
  • added a few more functions
  • made a number of changes to support site generation
Loading

squiggly 0.1.10

07 Oct 13:39
@edadma edadma

Choose a tag to compare

squiggly 0.1.10 Pre-release
Pre-release
  • fixes empty YAML document edge case
Loading

squiggly 0.1.7

04 Oct 22:44
@edadma edadma

Choose a tag to compare

squiggly 0.1.7 Pre-release
Pre-release
  • fix timestamp handling on native platform
  • fix index and dot notation operations
Loading

squiggly 0.1.6

04 Oct 12:51
@edadma edadma

Choose a tag to compare

squiggly 0.1.6 Pre-release
Pre-release
  • use back-ticks instead for non-strict expressions
  • fix 'for' syntax to resemble Scala a bit more
Loading

squiggly 0.1.5

04 Oct 03:24
@edadma edadma

Choose a tag to compare

squiggly 0.1.5 Pre-release
Pre-release
  • added match/case
  • added define and block
Loading

squiggly 0.1.4

03 Oct 02:20
@edadma edadma

Choose a tag to compare

squiggly 0.1.4 Pre-release
Pre-release
  • corrected Parser/Renderer API's
Loading
Previous 1
Previous

AltStyle によって変換されたページ (->オリジナル) /