July 23rd, 2024

Show HN: Slab – A programmable markup language for generating HTML

Slab is a programmable markup language simplifying HTML creation with concise syntax, programming features, code reuse, and JSON integration. Open-source under BSD license, maintained by Võ Minh Thu. Tutorials and documentation available.

Read original articleLink Icon
Show HN: Slab – A programmable markup language for generating HTML

Slab is a programmable markup language designed to simplify the creation of HTML content efficiently. It combines concise notation with standard programming constructs, enabling the generation of well-organized HTML with minimal effort. Slab offers advantages such as a concise syntax, built-in programming constructs for conditionals and loops, a fragment system for code reuse, and seamless integration with JSON data. It provides a smooth learning curve for those familiar with HTML and basic programming concepts. Resources for getting started with Slab include tutorials, comprehensive documentation, access to the source code on GitHub, and a Haskell package on Hackage. Slab is an open-source project released under the 2-Clause BSD license and is maintained by Võ Minh Thu.

Link Icon 4 comments
By @gxonatano - 3 months
You don't need to make your markup language programmable. Just write a library for a full-featured programming language which outputs the markup you want. Then you don't have to re-implement parameters, variables, loops, and such. See Lucid or Blaze in Haskell for good HTML DSLs. You can do more in one of those, combined with all the features of Haskell, than you can with Slab, Haml, Pug, or whatever else. And you don't need to write plugins for VSCode, Vim, Emacs, or whatever else just to edit it. See also Elm, which has an HTML DSL built in.
By @type0 - 3 months
similar project https://pugjs.org
By @lsh0 - 3 months
By @efilife - 3 months
Hideous in my opinion. Can't see where a tag starts and ends