Crates.io | snowcap |
lib.rs | snowcap |
version | 0.1.3 |
source | src |
created_at | 2024-09-26 03:14:47.676904 |
updated_at | 2024-09-28 02:58:56.948307 |
description | A simple markup language for iced |
homepage | https://github.com/boondocklabs/snowcap |
repository | https://github.com/boondocklabs/snowcap |
max_upload_size | |
id | 1386923 |
size | 241,688 |
Early stage markup for iced using pest
There is a simple viewer in bin/snowcap-viewer.rs with hot reloading.
To run it, use cargo run samples/test.iced
from the root of the project.
Here's an example of how the test.iced
file renders.
The grammar is specified in snowcap.pest and an example layout is in test.iced.
Iced Element | Snowcap Syntax |
---|---|
Container | {<attr:val,...> ...} |
Row | -<attr:val,...>[ element, ...] |
Column | |<attr:val,...>[ element, ...] |
Stack | ^<attr:val,...>[ element, ...] |
Rule (horiz) | rule-horizontal<height:2>() |
Rule (vert) | rule-vertical<width:2>() |
Text | text<attr:val,...>("Content") |
Button | button<attr:val,...>(element) |
Toggler | toggler<attr:val,...>(element) |
QRCode | qrcode<cell-size:10>(qr!("https://iced.rs")) |
Markdown | markdown(file!("README.md")) |
Image | image(file!("samples/ferris.png")) |
Svg | svg(file!("samples/coder.svg")) |
For example, creating a container with a column would look like
{<width:"fill", align-x:"center">
|<align:"center">[
text<size:19>("Hello"),
text<size:24>("Snowcap")
]
}