All Projects → JuliaPluto → HypertextLiteral.jl

JuliaPluto / HypertextLiteral.jl

Licence: ISC license
Julia library for the string interpolation of HTML and SVG

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to HypertextLiteral.jl

Peroxide
Rust numeric library with R, MATLAB & Python syntax
Stars: ✭ 191 (+344.19%)
Mutual labels:  interpolation
stroke-dasharray-interpolation-talk
Slides from 2015 D3.js talk
Stars: ✭ 17 (-60.47%)
Mutual labels:  interpolation
natural-neighbor-interpolation
Fast, discrete natural neighbor interpolation in 3D on the CPU.
Stars: ✭ 63 (+46.51%)
Mutual labels:  interpolation
Hypertextliteral
Generate HTML, XML, and other web content using Swift string literal interpolation
Stars: ✭ 219 (+409.3%)
Mutual labels:  interpolation
equadratures
equadratures.org/
Stars: ✭ 92 (+113.95%)
Mutual labels:  interpolation
SGpp
SG⁺⁺ – the numerical library for Sparse Grids in all their variants.
Stars: ✭ 59 (+37.21%)
Mutual labels:  interpolation
Mathtoolbox
Mathematical tools (interpolation, dimensionality reduction, optimization, etc.) written in C++11 with Eigen
Stars: ✭ 172 (+300%)
Mutual labels:  interpolation
aemtools
AEM Tools is Intellij IDEA plugin containing Adobe Experience Manager related features
Stars: ✭ 49 (+13.95%)
Mutual labels:  htl
GalerkinSparseGrids.jl
Sparse Grid Discretization with the Discontinuous Galerkin Method for solving PDEs
Stars: ✭ 39 (-9.3%)
Mutual labels:  interpolation
comment-mark
Interpolate strings with HTML comment markers!
Stars: ✭ 21 (-51.16%)
Mutual labels:  interpolation
Mathnet Numerics
Math.NET Numerics
Stars: ✭ 2,688 (+6151.16%)
Mutual labels:  interpolation
Pupa
Simple micro templating
Stars: ✭ 231 (+437.21%)
Mutual labels:  interpolation
gpx-interpolate
Python function to interpolate GPX data using piecewise cubic Hermite splines
Stars: ✭ 35 (-18.6%)
Mutual labels:  interpolation
Xesmf
Universal Regridder for Geospatial Data
Stars: ✭ 197 (+358.14%)
Mutual labels:  interpolation
go-interpol
interpol is a Go package for doing format-string like string interpolation using named parameters.
Stars: ✭ 34 (-20.93%)
Mutual labels:  interpolation
3d Bat
3D Bounding Box Annotation Tool (3D-BAT) Point cloud and Image Labeling
Stars: ✭ 179 (+316.28%)
Mutual labels:  interpolation
polatory
Fast, memory-efficient 3D spline interpolation and global kriging, via RBF (radial basis function) interpolation.
Stars: ✭ 82 (+90.7%)
Mutual labels:  interpolation
Black-hole-simulation-using-python
Non-spinning black hole simulation based on geodesics equation
Stars: ✭ 60 (+39.53%)
Mutual labels:  interpolation
2dimagefilter
A collection of image filters, some especially suited to scale-up low res computer graphics.
Stars: ✭ 32 (-25.58%)
Mutual labels:  interpolation
cmna-pkg
Computational Methods for Numerical Analysis
Stars: ✭ 13 (-69.77%)
Mutual labels:  interpolation

HypertextLiteral.jl

HypertextLiteral is a Julia package for generating HTML, SVG, and other SGML tagged content. It works similar to Julia string interpolation, only that it tracks hypertext escaping needs and provides handy conversions dependent upon context.

Stable Docs Dev Docs Release Build Code Coverage Zulip Chat ISC License

This project is inspired by Hypertext Literal by Mike Bostock (@mbostock) available at here. This work is based upon a port to Julia written by Michiel Dral with significant architectural feedback by Kirill Simonov (@xitology).

This package provides the macro @htl which returns an object that can be rendered to MIME"text/html" displays. This macro provides contextual interpolation sensible to the needs of HTML construction.

    using HypertextLiteral

    books = [
     (name="Who Gets What & Why", year=2012, authors=["Alvin Roth"]),
     (name="Switch", year=2010, authors=["Chip Heath", "Dan Heath"]),
     (name="Governing The Commons", year=1990, authors=["Elinor Ostrom"])]

    render_row(book) = @htl("""
      <tr><td>$(book.name) ($(book.year))<td>$(join(book.authors, " & "))
    """)

    render_table(list) = @htl("""
      <table><caption><h3>Selected Books</h3></caption>
      <thead><tr><th>Book<th>Authors<tbody>
      $((render_row(b) for b in list))</tbody></table>""")

    render_table(books)
    #=>
    <table><caption><h3>Selected Books</h3></caption>
    <thead><tr><th>Book<th>Authors<tbody>
      <tr><td>Who Gets What &amp; Why (2012)<td>Alvin Roth
      <tr><td>Switch (2010)<td>Chip Heath &amp; Dan Heath
      <tr><td>Governing The Commons (1990)<td>Elinor Ostrom
    </tbody></table>
    =#

This library implements many features for working with HTML and JavaScript data within the Julia language, including:

  • Performant escaping of interpolated values
  • Handles boolean valued attributes, such as disabled, checked
  • Serialization of Pair and Tuple objects as attribute pairs
  • Conversion of snake_case => kebab-case for attribute names
  • Support for CSS style formatting via Pair, Tuple and Dict
  • Translation of Julia values to Javascript within script tag
  • Direct inclusion of objects (like HTML) showable by MIME"text/html"
  • Extension API for customizing object display in various contexts

For more detail, please see the documentation and join us on Julia's Zulip.

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].