sparsetech / Pine
Licence: apache-2.0
Functional HTML5 and XML library for the Scala platform
Stars: ✭ 108
Projects that are alternatives of or similar to Pine
Pi Temp
Web server using a Raspberry Pi and DHT22 sensor to graph the humidity and temperature in my apartment over time.
Stars: ✭ 114 (+5.56%)
Mutual labels: web-development, html5
Guiadesenvolvedoraweb
Guia de como se tornar uma desenvolvedora front end.
Stars: ✭ 247 (+128.7%)
Mutual labels: web-development, html5
Skia Wasm Port
Port of the Skia drawing library to wasm, for use in javascript (node & browser)
Stars: ✭ 131 (+21.3%)
Mutual labels: rendering, html5
Wechart
Create all the [ch]arts by cax or three.js - Cax 和 three.js 创造一切图[表]
Stars: ✭ 152 (+40.74%)
Mutual labels: rendering, html5
Loading Attribute Polyfill
Fast and lightweight dependency-free vanilla JavaScript polyfill for native lazy loading / the awesome loading='lazy'-attribute.
Stars: ✭ 335 (+210.19%)
Mutual labels: web-development, html5
Redom
Tiny (2 KB) turboboosted JavaScript library for creating user interfaces.
Stars: ✭ 3,123 (+2791.67%)
Mutual labels: web-development, html5
Head
A simple guide to HTML <head> elements
Stars: ✭ 28,892 (+26651.85%)
Mutual labels: web-development, html5
React 3d Viewer
A 3D model viewer component based on react.js 一个基于react.js的组件化3d模型查看工具
Stars: ✭ 100 (-7.41%)
Mutual labels: html5
Pdfviewpager
Android widget that can render PDF documents stored on SD card, linked as assets, or downloaded from a remote URL.
Stars: ✭ 1,508 (+1296.3%)
Mutual labels: rendering
Lipo
👄 Free image manipulation API service built on top of Sharp (an alternative to Jimp, Graphics Magic, Image Magick, and PhantomJS)
Stars: ✭ 101 (-6.48%)
Mutual labels: manipulation
D3 Component
A lightweight component abstraction for D3.js.
Stars: ✭ 105 (-2.78%)
Mutual labels: html5
Portfolio one Page Template
Free responsive one page portfolio template
Stars: ✭ 106 (-1.85%)
Mutual labels: html5
Renderer
A shader-based software renderer written from scratch in C89
Stars: ✭ 1,366 (+1164.81%)
Mutual labels: rendering
Streaming Room
Streaming room in Node.js, rtmp, hsl, html5 videojs player
Stars: ✭ 106 (-1.85%)
Mutual labels: html5
Yocto Gl
Yocto/GL: Tiny C++ Libraries for Data-Driven Physically-based Graphics
Stars: ✭ 1,391 (+1187.96%)
Mutual labels: rendering
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
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].