Skip to content

Use @sphido/markdown in the examples - #1

Merged
OzzyCzech merged 1 commit into
mainfrom
feat/sphido-markdown
Aug 14, 2026
Merged

Use @sphido/markdown in the examples#1
OzzyCzech merged 1 commit into
mainfrom
feat/sphido-markdown

Conversation

@OzzyCzech

Copy link
Copy Markdown
Member

Companion to sphido/sphido#53, which adds @sphido/markdown.

Changes

example before after
basic marked(page.content) in the loop getPages(…, frontmatter, markdown())
extenders getContent() object extender calling marked markdown() extender, template reads this.content
json marked(page.content) in the loop markdown() in getPages()
rss marked(await readFile(page.path)) markdown() loads and renders
sitemap marked in dependencies, never imported dependency removed

The extenders example still shows all three kinds side by side: callback extenders (metadata, author, inline), an extender package (markdown()) and object extenders (getFooter, getTitle, getHtml, save).

Verified

All four rebuilt locally against the working copy of the monorepo package — HTML, JSON and rss.xml output checked by hand.

Blocked on

CI installs from npm without a lockfile, so it stays red until @sphido/markdown@1.0.0 is published. Merge and release sphido/sphido#53 first.

Unrelated finding

basic crashes with the unreleased @sphido/frontmatter from monorepo main: date?.toLocaleDateString is not a function. The js-yaml 4 → 5 bump changed the default schema, so a YAML date: 2018-10-01 now comes back as a string instead of a Date. Published 3.1.0 (js-yaml ^4.1.1) is fine, so CI is green today — but the next frontmatter release will break this example and any user doing date arithmetic. js-yaml 5 still exports timestampTag / YAML11_SCHEMA, so it is fixable in the extender. Reported here for the record; needs its own issue in sphido/sphido.

basic, extenders, json and rss rendered markdown by calling marked inside
the loop; they now pass markdown() to getPages() as the last extender and
read the HTML from page.content.

The extenders example drops its getContent() object extender — rendering
is what the package does now, and the example still demonstrates callback
extenders, an extender package and object extenders side by side.

sitemap listed marked without ever importing it, so the dependency goes.
@OzzyCzech
OzzyCzech merged commit 154689f into main Aug 14, 2026
4 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant