Coder Social home page Coder Social logo

bcpeinhardt / nakai Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nakaixo/nakai

0.0 0.0 0.0 121 KB

An HTML generation library for building web apps with Gleam ✨

Home Page: https://nakaixo.github.io

License: MIT License

Makefile 1.63% Gleam 98.37%

nakai's Introduction

Nakai

Documentation

Getting started

gleam add nakai
import nakai
import nakai/html.{type Node}
import nakai/attr.{type Attr}

const header_style = "
  color: #331f26;
  font-family: 'Neuton', serif;
  font-size: 128px;
  font-weight: 400;
"

pub fn header(attrs: List(Attr), text: String) -> Node {
  let attrs = [attr.style(header_style), ..attrs]
  html.h1_text(attrs, text)
}

pub fn app() -> String {
  html.div([],
    [
      html.Head([html.title("Hello!")]),
      header([], "Hello, from Nakai!")
    ]
  )
  |> nakai.to_string()
}

Development

While Nakai itself is pure Gleam, and has no dependencies, the benchmarks require having Elixir installed, and building it requires that you have Rebar3 installed.

nakai's People

Contributors

aslilac avatar anttti avatar mikeyjones avatar raffomania avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.