2.2.0 • Published 2 years ago

art-html-factory v2.2.0

Weekly downloads
4
License
ISC
Repository
github
Last release
2 years ago

ArtHtmlFactory

Generate HTML with an easy, declarative syntax.

Examples

import &ArtHtmlFactory

# Example: tag properties
tree = Div
  class: :foo
  id:    :123

tree.toString()
# > "<DIV class='foo' id='123'></DIV>"

Examples

import &ArtHtmlFactory

# Example: 4 text and 2 non-text children
Span
  ""      This is some really
  B  ""   bold
  ""      text.
  ""      Also, here is some
  Em ""   emphasized
  ""      text.

# Example: internalHtml adds a string
# without interpretation.
Span
  internalHtml: ""
    Or you can do <b>this</b>
    and <em>this</em>.

# With CaffeineScript literals,
# setting CSS styles is easy.
Div
  style:
    bottom:          0
    height:          50px
    left:            100px
    right:           100px
    position:        :fixed
    backgroundColor: :white
    textAlign:       :center
  "" Custom Styles are easy, too.


# Example: Reusable styles without stylesheets:
myTextStyle =
  style:
    fontSize:   16pt
    color:      #444
    fontFamily: :Times

myLayoutStyle
  style:
    padding:    10pt

Div
  myTextStyle
  myLayoutStyle
  ""
    All plain object children are merged into
    the element's props.
2.2.0

2 years ago

2.1.11

3 years ago

2.1.10

3 years ago

2.1.9

3 years ago

2.1.8

4 years ago

2.1.7

4 years ago

2.1.6

4 years ago

2.1.5

4 years ago

2.1.2

4 years ago

2.1.3

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.0.2

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.3.3

4 years ago