GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - bunopnu/e2h: HTML generator for Erlang

BranchesTags
Open more actions menu

Latest commit

 

History

36 Commits
36 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
.vscode
.vscode
 
 
include
include
 
 
src
src
 
 
test
test
 
 
.gitignore
.gitignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
rebar.config
rebar.config
 
 
rebar.config.script
rebar.config.script
 
 
rebar.lock
rebar.lock
 
 

Repository files navigation

e2h

e2h (Erlang to HTML) is an Erlang module designed to generate HTML content within the Erlang. It provides functions for encoding HTML elements and attributes, as well as escaping dangerous characters within HTML content.

This module is suitable for developers who need to programmatically generate HTML documents or elements in their Erlang applications.

Test Status Coverage Status Hex Version

Installation

Package can be installed by adding e2h to your list of dependencies:

{deps, [{e2h, "0.4.2"}]}.

Usage Example

Here's a simple example of how to use e2h to generate an HTML document in Erlang:

UserStatus = <<"busy">>,
UserProfileImage = <<"https://example.com/image.jpeg">>,
UserName = <<"bob">>,
UserJob = <<"data scientist">>,

Document = [
  {<<"div">>, [{<<"class">>, <<"user">>}, {<<"status">>, UserStatus}], [
    {<<"img">>, [{<<"href">>, UserProfileImage}]},
    {<<"div">>, [], [
      {<<"h1">>, [], [UserName]},
      {<<"p">>, [], [UserJob]}
    ]}
  ]}
],

e2h:render_fragment(Document).
% (output is manually formatted for readme)
%
% <div class="user" status="busy">
%   <img href="https://example.com/image.jpeg" />
%   <div>
%     <h1>bob</h1>
%     <p>data scientist</p>
%   </div>
% </div>

Documentation

For documentation, please refer to the official HexDocs page.

License

e2h is licensed under the MIT license.

About

HTML generator for Erlang

hex.pm/packages/e2h

Topics

erlanghtmlhtml-generatorhtml5rebar3

Resources

Readme
MIT license
Activity

Stars

3 stars

Watchers

1 watching

Forks

1 fork
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.