Skip to content

A simple website for generating HTML out of S-Expressions (Lisp style)

License

Notifications You must be signed in to change notification settings

Tryops/parens2html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

parens2html

A simple website for generating HTML out of S-Expressions (Lisp style) Try it out!

S-Expressions to HTML

This page uses a Scheme implementation in JavaScript (Biwa Scheme) and a simple list manipulation script, to convert S-Expressions to plain HTML.

S-Expressions as markup can be:

  • simpler to read
  • easier/faster to write (especially in an early phase of rapid development and prototyping)
  • less redundant (only one tag name)

How it works

It's pretty simple:

  • Write your markup in S-Expressions
  • Paste it into the first s-expression code-box
  • Press the EVALUATE button
  • Copy the output HTML and use it as markup

How to markup

Every HTML tag is written in parenthesis like this: (div "Content...")

  • The tag-name is written on the beginning after the opening paren, the contents follow after it seperated by spaces until the closing paren.

  • Text is written in double quotes (to differentiate them from tag-names): "..."

  • Tags can be in the contents of other tags (nested):
    (div (h2 "Title...) (p "1st paragraph...") (p "2nd paragraph..."))

  • Attributes are written directly after the tag-name in parens with a # in front of it:
    (div #(id= "first" class= "space center") "Text...")

    To better distinguish them from tags, you can also use brackets #[] for attributes:
    (div #[id= "first" class= "space center"] "Text...")

Also see the demo example as a reference on how to write HTML with it. Try it out and have fun!

About

A simple website for generating HTML out of S-Expressions (Lisp style)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published