https://github.com/runabol/jiccup
Clojure Hiccup inspired HTML rendering experiment
https://github.com/runabol/jiccup
html java library
Last synced: 9 months ago
JSON representation
Clojure Hiccup inspired HTML rendering experiment
- Host: GitHub
- URL: https://github.com/runabol/jiccup
- Owner: runabol
- Created: 2017-12-30T03:53:28.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-30T19:55:37.000Z (about 8 years ago)
- Last Synced: 2025-04-14T22:14:39.282Z (9 months ago)
- Topics: html, java, library
- Language: Shell
- Size: 80.1 KB
- Stars: 31
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Jiccup
Jiccup is a [Hiccup](https://github.com/weavejester/hiccup)-inpsired library for representing HTML in Java.
Warning: This project is still in an experimental phase.
# Requirements
Java 1.8+
# Install
```
com.creactiviti
jiccup
0.0.1-SNAPSHOT
maven-snapshots
http://oss.sonatype.org/content/repositories/snapshots
default
false
true
```
# Syntax
## Hello World
Here is a basic example of Jiccup's syntax:
```
import static com.creactiviti.jiccup.Elements.*;
...
html (
body(
h1(content("Hello World"))
)
);
```
Which will render the following HTML:
```
Hello World
```
## Bootstrap Example
```
import static com.creactiviti.jiccup.Elements.*;
...
html (
head (
stylesheet("https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"),
stylesheet("/starter-template.css"),
title("Starter Template for Bootstrap")
),
body(
nav(
css("navbar","navbar-inverse","navbar-fixed-top"),
div(
css("container"),
div(
css("navbar-header"),
button(css("navbar-toggle","collapsed"),span(css("sr-only"),content("Toggle navigation")),attr("type", "button")),
a(href("/"),content("Project name"),css("navbar-brand"))
),
div(
id("navbar"),
css("collapse","navbar-collapse"),
ul(
css("nav","navbar-nav"),
li(a(href("/"),css("active"),content("Home"))),
li(a(href("#about"),content("About"))),
li(a(href("#contact"),content("Contact")))
)
)
)
)
div(
css("container"),
div(css("starter-template"),
h1(content("Bootstrap starter template")),
p(css("lead"),content("Use this document as a way to quickly start any new project.
All you get is this text and a mostly barebones HTML document."))
)
)
)
)
```
Which renders bootstrap's [starter](https://getbootstrap.com/docs/3.3/examples/starter-template/) template.
# Spring Integration
See [Spring Boot Starter Jiccup](https://github.com/creactiviti/spring-boot-starter-jiccup)
# License
Jiccup is released under version 2.0 of the Apache License.