Reminds me of the “Shakespearean Templates“ [1] from the Yesod web framework [2].
[1]: https://www.oreilly.com/library/view/developing-web-applicat...
[2]: https://www.yesodweb.com/
Copied below to save you a click:
Hamlet (HTML)
$doctype 5
<html>
<head>
<title>#{pageTitle} - My Site
<link rel=stylesheet href=@{Stylesheet}>
<body>
<h1 .page-title>#{pageTitle}
<p>Here is a list of your friends:
$if null friends
<p>Sorry, I lied, you don't have any friends.
$else
<ul>
$forall Friend name age <- friends
<li>#{name} (#{age} years old)
<footer>^{copyright}
Cassius (CSS) #myid
color: #{red}
font-size: #{bodyFontSize}
foo bar baz
background-image: url(@{MyBackgroundR})
Lucius (CSS) section.blog {
padding: 1em;
border: 1px solid #000;
h1 {
color: #{headingColor};
}
}
Julius (JavaScript) $(function(){
$("section.#{sectionClass}").hide();
$("#mybutton").click(function(){document.location = "@{SomeRouteR}";});
^{addBling}
});
For those curious, the above is implemented in the metaprogramming framework of Template Haskell.