Rework of html-java-dsl to work with newer Javas

Related tags

java-html-dsl2
Overview

java-html-dsl

Example DSL for writing html in Java. Rework of benjiman/java-html-dsl to work with newer versions of Java

This

String doc =
    html(
        head(
            title("Hello Html World"),
            meta($ -> $.charset = "utf-8"),
            link($->{ $.rel=stylesheet; $.type=css; $.href="/foo.css"; }),
            script($->{ $.type= javascript; $.src="/some.js"; })
        ),
        body(
            div($-> $.cssClass = "article",
                a($-> $.href="https://benjiweber.com/",
                    span($->$.cssClass="label", "Click Here"),
                    img($->{$.src="/myimg.jpg"; $.width=px(25); $.height=px(25); })
                ),
                p(span("some text"), div("block"))
            )
        )
    ).formatted()

Generates

<html>
  <head>
    <title>Hello Html World</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" type="css" href="/my.css" />
    <script type="text/javascript" src="/some.js" ></script>
  </head>
  <body>
    <div class="article">
      <a href="https://benjiweber.com/">
        <span class="label">Click Here</span>
        <img src="/myimg.jpg" width="25" height="25" />
      </a>
      <p>
        <span>some text</span>
        <div>block</div>
      </p>
    </div>
  </body>
</html>
Owner
Benji Weber
Benji Weber
You are looking for examples, code snippets, sample applications for Spring Integration? This is the place.

Spring Integration Samples Note This (master) branch requires Spring Integration 5.0 or above. For samples running against earlier versions of Spring

Spring 1.9k Mar 14, 2021
A sample Spring-based application

Spring PetClinic Sample Application Understanding the Spring Petclinic application with a few diagrams See the presentation here Running petclinic loc

Spring 4.7k Mar 15, 2021
Modern Java - A Guide to Java 8

Modern Java - A Guide to Java 8 This article was originally posted on my blog. You should also read my Java 11 Tutorial (including new language and AP

Benjamin Winterberg 14.5k Mar 15, 2021
The quickstarts demonstrate JBoss EAP, Jakarta EE 8 and a few additional technologies. They provide small, specific, working examples that can be used as a reference for your own project.

shared-doc/attributes.adoc WildFly Quickstarts The quickstarts demonstrate Jakarta EE 8 and a few additional technologies from the WildFly stack. They

JBoss Developer 755 Mar 15, 2021
Fast and stable sort algorithm that uses O(1) memory. Public domain.

WikiSort WikiSort is an implementation of "block merge sort", which is a stable merge sort based on the work described in "Ratio based stable in-place

Mike McFadden 1.2k Feb 21, 2021
Design patterns implemented in Java

Design patterns implemented in Java Read in different language : CN, KR, FR, TR, AR Introduction Design patterns are the best formalized practices a p

Ilkka Seppälä 64.7k Mar 15, 2021
Java EE 7 Samples

Java EE 7 Samples This workspace consists of Java EE 7 Samples and unit tests. They are categorized in different directories, one for each Technology/

JavaEE Samples 2.5k Mar 12, 2021
Amazing Ruby's "Enumerable" ported to Java

Overview How to use? .all .any .none .select .map .count .reject .find How to contribute? Contributors Overview enumerable4j is a Ruby's well known En

Yurii Dubinka 24 Mar 26, 2021
Algorithms and Data Structures implemented in Java

Java : Algorithms and Data Structure The algorithms and data structures are implemented in Java. This is a collection of algorithms and data structure

Justin Wetherell 3.7k Mar 14, 2021
Solutions for some common algorithm problems written in Java.

Algorithms This repository contains my solution for common algorithms. I've created this repository to learn about algorithms and improve solutions to

Pedro Vicente Gómez Sánchez 2.7k Mar 14, 2021
MCQs and coding questions solutions of Object-Oriented Programming java of coding ninjas

cn-java-sols (⌐■_■) Link to This repository Other similar repository of my friend Link ?? enjoy having full marks ?? ?? now answers avaible up to Stri

Sanyam Mahajan 11 Mar 25, 2021
Java 16 Features

Java 16 Features. Features are separated by package name.

Rahman Usta 10 Apr 7, 2021
Open-Source-Note是一个开源项目的学习笔记仓库,包含源码解析,实战指南和面试技巧,主要面向Java开发者

源码篇 实战篇 面试篇 架构篇 开源项目篇 1. 源码篇 ?? MyBatis MyBatis源码解析——Executor执行器 MyBatis源码解析——StatementHandler MyBatis源码解析——ResultSetHandler ?? Spring Spring MVC源码解析—

Miku 75 Apr 2, 2021
A toolchain for Minecraft: Java Edition that builds a workspace to interact with the game using the official mappings provided to the public by Mojang Studios.

VanillaGradle is a toolchain for Minecraft: Java Edition that provides a workspace to interact with the game using official mappings provided by Mojan

SpongePowered 15 Mar 18, 2021