Hello World — Getting Started with Lua
Welcome to the blog! This post showcases all the features available when writing content in SilverBullet and publishing it here
Markdown Basics
You can write with all standard markdown features:
- Bold text and italic text
- Links to other pages
- Inline
codesnippets
Blockquotes work great for highlighting important information or quotes from other sources.
Code Blocks
Here’s a regular code block with syntax highlighting:
function greet(name) { return `Hello, ${name}!`;}
console.log(greet("World"));Tables
| Feature | Status | Notes |
|---|---|---|
| Markdown rendering | ✅ | Full CommonMark support |
| Syntax highlighting | ✅ | Via Expressive Code |
| Lua execution | ✅ | Powered by Fengari |
| Dark mode | ✅ | System + manual toggle |
Interactive Lua Code
The coolest feature — you can run Lua code right in the browser! Click the Run button below:
print("Hello from Lua! 🌙")print("This runs directly in your browser")print("2 + 2 = " .. tostring(2 + 2))Lua Functions
Define a function in one block and use it in the next. The Lua VM is shared across all blocks on the page:
-- Define a utility functionfunction fibonacci(n) if n <= 1 then return n end return fibonacci(n - 1) + fibonacci(n - 2)end
-- Print first 10 fibonacci numbersfor i = 0, 9 do print("fib(" .. i .. ") = " .. fibonacci(i))endMore Lua Examples
-- String manipulationlocal greeting = "Hello, Blog!"print(string.upper(greeting))print(string.rep("=", #greeting))print("Length: " .. #greeting .. " characters")
-- Tables (Lua's primary data structure)local colors = {"red", "green", "blue", "purple"}for i, color in ipairs(colors) do print(i .. ". " .. color)endImages
You can include images using standard markdown syntax. Images from your SilverBullet space will render if they’re in the content directory.
What’s Next?
- Write more posts in SilverBullet
- Add
published: trueto the frontmatter - Posts appear on the blog automatically
Happy writing! ✍️
Comments (0)
No comments yet.