Repository navigation
Build the blog example, with relative includes and code-safe Markdown - #7
Merged
Merged
Conversation
…nique, %contains. - %include and %embed look for files relative to the including file first, then in the include directories. - Macro calls inside Markdown code blocks and spans are shown as written, not expanded (otherwise a post quoting seam runs it). - %unique and %contains, for collecting and filtering tags. - %timestamp accepts a date without a time (as midnight). - "false" counts as false, as YAML and TOML booleans arrive as strings. - %intercalate keeps the separator's whitespace, not the items'.
Markdown posts with frontmatter, a shared layout, an index sorted by date, a tags page and an RSS feed, all generated by build.sex with %write and the formatter macros. Drafts are left out.
- `seam run file.sex` expands a file only for its side effects, echoing each `%write`, `%exec` and `%log` on STDOUT. - %path/cwd, this-file, this-directory, join, split, stem, with-extension, normalise, canonical, absolute, relative, exists, is-file, is-directory. - The blog builds with `seam run` from any directory, using write/html.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 6a04caa. Configure here.
- XML and CSS write literate (Raw) text as it is, instead of failing. - Markdown content is rendered without frontmatter parsing once its frontmatter is split off, so a body starting with --- is kept. - %exec writes :stdin from another thread, so large input and output cannot deadlock on full pipes. - Typed lazy parameters (~n:number) are checked once expanded, each time they are used, instead of in their unexpanded form. - %embed sites its text in the embedded file, and %markdown names its literate source after that file, so %include, %embed and %path/this and %path/here within markdown work relative to the markdown file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Stacked on #6.
Builds out the blog concept in
samples/blog-conceptas a working blog insamples/blog, and adds the features it needed. The concept itself is left as it was.The blog
title,date,tags,description,draft).site.sexdefines%posts: every post's frontmatter, read with%markdown :only frontmatter, without drafts, newest first. It also defines the%pagelayout, with the head, header and footer as in the concept.build.sexrenders each page with%formatter/html :document trueand saves it with%write. Each post page gets its details through%with.index.sex,tags.sex,feed.sexandstyle.sexcan also each be rendered alone.Features it needed
%includeand%embedlook relative to the including file first, then in the include directories. The concept'sEntry 1.sex, which includes./includes/head.sex, now renders.build.sex's loop ran that loop and recursed until the stack overflowed.%uniqueand%contains, for tags.%timestampaccepts a date without a time."false"counts as false, since YAML and TOML booleans arrive as strings.%intercalate: it keeps only the separator's whitespace, someta, seamno longer has a double space.Testing: 43 tests pass and clippy is clean. I built the site and checked the HTML, feed and CSS output. I didn't view it in a browser.
Note
Medium Risk
Touches core expansion (includes, markdown, lazy typing), filesystem writes, and subprocess I/O; behavior changes could affect existing templates and build scripts.
Overview
Adds
seam run, which expands a.sexfile only for side effects (%write,%exec,%log) and prints each action on STDOUT (likemake), without emitting a formatted document or requiring--html/--xml.Includes and paths:
%include/%embedresolve paths relative to the calling file first, then-I/ the working directory. A large%path/...surface (cwd,this,here,join,split,normalise,canonical,absolute,relative, existence checks, etc.) supports portable build scripts.samples/blogis a full static blog driven byseam run build.sex.Markdown / literate: Macro calls inside code blocks and spans are left literal (escaped during literate expansion). After frontmatter is stripped, the body is rendered without treating a leading
---as more frontmatter. Embedded file text is sited in its source file so%markdownand nested includes resolve paths correctly. XML/CSS output now passesRawnodes through for literate hand-written text.Macros and semantics: New
%uniqueand%contains;%timestampaccepts date-only strings;"false"is falsy for%if;%intercalatewhitespace is tidied; lazy typed macro arguments are type-checked when expanded;%execavoids pipe deadlocks by writing stdin on a background thread.Reviewed by Cursor Bugbot for commit b6d9d84. Bugbot is set up for automated code reviews on this repo. Configure here.