https://codeberg.org/skinnyjames/hokusai This website requires JavaScript. # Explore About FAQ Help Donate Register Sign in skinnyjames/hokusai Watch 1 Star 3 Fork You've already forked hokusai 0 Code Issues Pull requests 1 Activity A backend agnostic ruby framework for building reactive desktop applications 20 commits 10 branches 0 tags 4.3 MiB C 53.4% Ruby 43.7% Lua 1.1% JavaScript 0.9% Rust 0.5% Other 0.3% main Find a file HTTPS [https://codeberg.org] Download ZIP Download TAR.GZ Download BUNDLE Open with VS Code Open with VSCodium Open with Intellij IDEA Cite this repository BibTeX [ ] Cancel 2025-05-09 # skinnyjames 5380728dd8 Update README.md 16:06:59 +00:00 feat(windows support): Adds windows 2025-03-25 ast support 10:19:20 -04:00 feat(windows support): Adds windows 2025-03-25 ext support 10:19:20 -04:00 2025-01-19 grammar Fixup build scripts 05:09:07 -05:00 feat(windows support): Adds windows 2025-03-25 ui support 10:19:20 -04:00 2024-11-21 vendor Initial Commit 12:40:30 -05:00 2025-03-10 .gitignore Adds documentation 21:26:18 -04:00 2024-11-21 .rspec Initial Commit 12:40:30 -05:00 2025-01-19 .woodpecker.yml Fixup build scripts 05:09:07 -05:00 2025-03-10 .yardopts Adds documentation 21:26:18 -04:00 Merge pull request 'Moves clamping and 2024-12-25 Dockerfile text logic to C' (#1) from clamping 15:39:36 into main -05:00 2025-03-10 docs.sh Adds documentation 21:26:18 -04:00 2025-03-10 Gemfile Adds documentation 21:26:18 -04:00 2025-03-10 Gemfile.lock Adds documentation 21:26:18 -04:00 feat(windows support): Adds windows 2025-03-25 hokusai.gemspec support 10:19:20 -04:00 2025-01-02 LICENSE Sets license to PPL 11:11:49 -05:00 2025-05-09 README.md Update README.md 16:06:59 +00:00 2025-01-19 xmake.lua Fixup build scripts 05:09:07 -05:00 README.md Hokusai A Ruby library for authoring GUI applications status-badge guides docs license Getting started In your Gemfile gem "hokusai-zero", "0.1.7" In order to run an application, you will need to install a backend Raylib * Install raylib >= 5.0 * Write your app * Run app with RAYLIB_PATH=/libpath/for/libraylib.(so|dylib) ruby .rb SDL2 * Install the following deps + libsdl + libscdl-gfx + libsdl-ttf + libsdl-image * Write your app * Run app with SDL_PATH=/libpath/for/libsdl.(so|dylib) ruby .rb Example counter application require "hokusai" require "hokusai/backends/raylib" class Counter < Hokusai::Block template <<-EOF [template] vblock hblock label { :content="count" size="130" :color="count_color" } hblock vblock label { content="Add" @click="increment" } vblock label { content="Subtract" @click="decrement" } EOF uses( vblock: Hokusai::Blocks::Vblock, hblock: Hokusai::Blocks::Hblock, label: Hokusai::Blocks::Label, ) attr_accessor :count def increment(event) self.count += 1 end def decrement(event) self.count -= 1 end def count_color self.count > 0 ? [0,0,255] : [255,0,0] end def initialize(**args) @count = 0 super(**args) end end Hokusai::Backends::RaylibBackend.run(Counter) do |config| config.width = 500 config.height = 500 config.title = "Counter application" end Development The build tooling of this project is xmake. You will need it to compile dependencies and run demos. Hokusai contains a tree-sitter grammar to parse templates, and uses md4c to parse markdown. When compiling the C portion of hokusai, tree-sitter will be statically linked. Requirements: * xmake to build dependencies * Ruby to run applications Steps: * Download project * Install dependencies + bundle install + xmake q hoku-tree-sitter + xmake q hoku-md4c + For Raylib o xmake q raylib + For SDL2 o xmake q libsdl o xmake q libsdl_gfx o xmake q lbsdl_ttf o xmake q libsdl_image * Build grammar and ast code + xmake b hokusai * Run specs + xmake b -g test * Run a demo + xmake demo counter License Hokusai is released under the Peer Production License Logo Codeberg * Documentation * Community Issues * Contributing * Report Abuse Association * Who are we? * Bylaws / Satzung * Donate * Join / Support * Contact Service * Codeberg Pages * Weblate Translations * Woodpecker CI * Forgejo API * Status Page Legal * Imprint / Impressum * Privacy Policy * Licenses * Terms of Use Blog | Mastodon | Matrix Space | Powered by Forgejo English Bahasa Indonesia Dansk Deutsch English Espanol Esperanto Filipino Francais Italiano Latviesu Magyar nyelv Nederlands Plattduutsch Polski Portugues de Portugal Portugues do Brasil Slovenscina Suomi Svenska Turkce Cestina Ellenika B'lgarski Russkii Ukrayins'ka frsy Ri Ben Yu Jian Ti Zhong Wen Fan Ti Zhong Wen (Tai Wan )Fan Ti Zhong Wen (Xiang Gang ) hangugeo