pine


License

License

GroupId

GroupId

tech.sparse
ArtifactId

ArtifactId

pine_2.12
Last Version

Last Version

0.1.7
Release Date

Release Date

Type

Type

jar
Description

Description

pine
pine
Project URL

Project URL

https://github.com/sparsetech/pine
Project Organization

Project Organization

tech.sparse
Source Code Management

Source Code Management

https://github.com/sparsetech/pine

Download pine_2.12

How to add to project

<!-- https://jarcasting.com/artifacts/tech.sparse/pine_2.12/ -->
<dependency>
    <groupId>tech.sparse</groupId>
    <artifactId>pine_2.12</artifactId>
    <version>0.1.7</version>
</dependency>
// https://jarcasting.com/artifacts/tech.sparse/pine_2.12/
implementation 'tech.sparse:pine_2.12:0.1.7'
// https://jarcasting.com/artifacts/tech.sparse/pine_2.12/
implementation ("tech.sparse:pine_2.12:0.1.7")
'tech.sparse:pine_2.12:jar:0.1.7'
<dependency org="tech.sparse" name="pine_2.12" rev="0.1.7">
  <artifact name="pine_2.12" type="jar" />
</dependency>
@Grapes(
@Grab(group='tech.sparse', module='pine_2.12', version='0.1.7')
)
libraryDependencies += "tech.sparse" % "pine_2.12" % "0.1.7"
[tech.sparse/pine_2.12 "0.1.7"]

Dependencies

compile (1)

Group / Artifact Type Version
org.typelevel : scala-library jar 2.12.4-bin-typelevel-4

provided (2)

Group / Artifact Type Version
org.typelevel : scala-compiler jar 2.12.4-bin-typelevel-4
org.typelevel : scala-reflect jar 2.12.4-bin-typelevel-4

test (2)

Group / Artifact Type Version
org.scalatest : scalatest_2.12 jar 3.2.2
org.scalacheck : scalacheck_2.12 jar 1.14.3

Project Modules

There are no modules declared in this project.

Build Status Build Status Maven Central

Pine is a functional HTML5 and XML library for the Scala platform. It supports parsing, manipulating and rendering of HTML. Pine provides type-safe bindings for HTML5 generated from MDN. Tree nodes are immutable and can be constructed from compile-time or runtime HTML/XML content. The tree may be manipulated and rendered back as HTML or as a browser node.

Features

  • Immutable and typed trees
  • Type-safe bindings, generated from MDN
  • Support for custom elements and attributes
  • HTML5 and XML parser based on recursive descent
  • Macros for compile-time HTML string/file parsing
  • Tree manipulation
  • Rendering as HTML strings
  • DSL for common operations
  • Unit and property-based tests
  • Few dependencies

JavaScript back end

  • Rendering as DOM nodes
  • Updating nodes in DOM
  • DSL for attaching/detaching events

Compatibility

Platform Platform version Scala versions
JVM 2.11 (T), 2.12 (T), 2.13 (L)
Scala.js 1.0 2.12 (T), 2.13 (L)
Scala Native 0.4.0-M2 2.11 (T)
  • (T): Typelevel Scala
  • (L): Lightbend Scala

Examples

import pine._

val url  = "http://github.com/"
val root = html"<a href=$url>GitHub</a>"

println(root.toHtml)  // <a href="http://github.com/">GitHub</a>

JavaScript

import pine.dom._
println(root.toDom)  // [object HTMLAnchorElement]

sbt

Pine makes use of a language extension called literal types, see SIP-23. For Scala 2.11 and 2.12, only Typelevel Scala implements this feature. However, it is available in Lightbend Scala from 2.13 onwards.

2.13 onwards

scalaVersion := "2.<version>"
libraryDependencies += scalaOrganization.value % "scala-reflect" % scalaVersion.value

< 2.13

scalaVersion      := "2.12.4-bin-typelevel-4"  // or "2.11.11-bin-typelevel-4"
scalaOrganization := "org.typelevel"
scalacOptions     += "-Yliteral-types"

libraryDependencies += scalaOrganization.value % "scala-reflect" % scalaVersion.value

Scala.js settings

libraryDependencies := libraryDependencies.value.filterNot(_.name == "scalajs-compiler") 
addCompilerPlugin("org.scala-js" % "scalajs-compiler" % scalaJSVersion cross CrossVersion.patch)

Scala Native settings

libraryDependencies := libraryDependencies.value.filterNot(_.name == "nscplugin")
addCompilerPlugin("org.scala-native" % "nscplugin" % nativeVersion cross CrossVersion.patch)

Dependencies

libraryDependencies += "tech.sparse" %%  "pine" % "<version>"  // JVM
libraryDependencies += "tech.sparse" %%% "pine" % "<version>"  // JavaScript, Native

Links

Licence

Pine is licensed under the terms of the Apache v2.0 licence.

Contributors

  • Tim Nieradzik
  • Matt Hicks
  • Anatoliy Kmetyuk
  • Keven Wright
tech.sparse

sparse.tech

Versions

Version
0.1.7
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0