kogui
Version, currently master branch1 version
- master branchlatestApr 10, 2020
github.com/anton-yordanov/kogui
Generate HTML using Crystal.
0 stars
0 dependents
License: MIT
Installation
# Add this to your shard.yml
dependencies:
kogui:
github: anton-yordanov/kogui
branch: mastermaster is a branch, not a release, so this tracks it rather than pinning a version.
Then run:
shards installshard.yml
- Crystal
0.34.0- License
- MIT
- Author
- krthr
Dependencies
This version declares no dependencies.
README
Kogui
Generate HTML using Crystal.
Heavily inspired in Clearwater.cr Component system.
Installation
-
Add the dependency to your
shard.yml:dependencies: kogui: github: krthr/kogui -
Run
shards install
Usage
require "kogui"
class App
include Kogui::Component
def render
html lang: "en" do
[
head do
title { "Title" }
end,
body style: "width: 100vw" do
[
h1 id: "__title", class: "bold__text" do
h1 style: {"font-size": "2rem"} do
Array.new(5) do
h1 { Time.utc.to_s }
end
end
end,
]
end,
]
end
end
end
app = App.new
html = app.to_s # <html><head><titl...
Result (prettified):
<html lang="en">
<head>
<title>Title</title>
</head>
<body style="width: 100vw">
<h1 id="__title" class="bold__text">
<h1 style="font-size:2rem">
<h1>2020-04-10 18:18:21 UTC</h1>
<h1>2020-04-10 18:18:21 UTC</h1>
<h1>2020-04-10 18:18:21 UTC</h1>
<h1>2020-04-10 18:18:21 UTC</h1>
<h1>2020-04-10 18:18:21 UTC</h1>
</h1>
</h1>
</body>
</html>
Development
TODO:
- Router system
Contributing
- Fork it (https://github.com/krthr/kogui/fork)
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create a new Pull Request
Contributors
- krthr - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This branch
- Branch
master- Seen
- Apr 10, 2020
- Crystal
0.34.0- Indexed
- yes
Dependents
No indexed shard depends on this one yet.
Repository
github.com/anton-yordanov/kogui
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 15, 2026
- Synced
- Aug 15, 2026
- Versions
- 1