Kit
Kit copied to clipboard
feature request: yielding
it would be nice to support yielding:
basic example
layout.kit
<!doctype html>
<html>
<head>
<title>yield ftw</title>
</head>
<body>
<!-- @yield -->
</body>
</html>
content.kit
<!-- @layout layout -->
<p>content row 1</p>
<p>content row 2</p>
<p>content row 3</p>
result
<!doctype html>
<html>
<head>
<title>yield ftw</title>
</head>
<body>
<p>content row 1</p>
<p>content row 2</p>
<p>content row 3</p>
</body>
</html>
a more flexible example
layout_extended.kit
<!doctype html>
<html>
<head>
<title>yield ftw</title>
</head>
<body>
<header>
<!-- @yield header -->
</header>
<div class="content">
<!-- @yield main -->
</div>
</body>
</html>
content_extended.kit
<!-- @layout layout_extended -->
<!-- @content header -->
<h1>title</h1>
<p>subtitle</p>
<!-- @content main -->
<!-- @include content -->
(optionally we can close content sections with an )
result
<!doctype html>
<html>
<head>
<title>yield ftw</title>
</head>
<body>
<header>
<h1>title</h1>
<p>subtitle</p>
</header>
<div class="content">
<p>content row 1</p>
<p>content row 2</p>
<p>content row 3</p>
</div>
</body>
</html>
or with resolved #3
<!doctype html>
<html>
<head>
<title>yield ftw</title>
</head>
<body>
<header>
<h1>title</h1>
<p>subtitle</p>
</header>
<div class="content">
<p>content row 1</p>
<p>content row 2</p>
<p>content row 3</p>
</div>
</body>
</html>
+1
good idea. +1
+1 came here looking for this, I'm glad someone already addressed.