Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Aral Balkan
@aral@mastodon.ar.al  ·  activity timestamp 6 days ago

If you’re using Kitten¹ in production, listen up (yes, both of you!)

I’ve had a Kitten release with a hugely improved Markdown parser and Kitten Markdown Pages support lying on my laptop for the past three months as I was working on Gaza Verified².

This week, I went over over everything and documented it and the release is ready.

This is a breaking change if you use Kitten Markdown Pages (.page.md files).

Specifically:

1. You can now include arbitrary JavaScript in your Markdown pages in a `script` block in your YAML front matter.

2. Because of #1, the `imports` front matter property has been removed (just use JavaScript imports to load in components, etc.)

3. You can now use JavaScript string interpolation and special Kitten syntax (e.g., conditional tags) within your Kitten Markdown Pages.

4. Because of #3, if you have JavaScript string interpolation or Kitten-specific tags in Markdown code fences, you must escape them. e.g., `${something}` becomes `\${something}` and `<if ${something}>this<else>that</if>` becomes `\<if \${something}>this\<else>that\</if>` .

That’s it.

So the simple Kitten Count example that increments a counter on page reload and displays the latest count would look like this as a Kitten Markdown Page now:

```markdown
---
script: |
let count = 1
---
# Kitten count

${'🐱️'.repeat(count++)}
```

This took so long to get right but I think it’s 100% solid right now (the only way I’ve been able to break it so far turned out to be a bug in the CommonMark spec itself).

I’ll update you once the new release is live.

💕

¹ https://kitten.small-web.org
² https://gaza-verified.org

#Kitten #SmallWeb #Markdown #KittenMarkdownPages

  • Copy link
  • Flag this post
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login