PHPackages                             dev-lucid/html - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dev-lucid/html

ActiveLibrary

dev-lucid/html
==============

A library for building HTML.

2.0.0(9y ago)0401MITJavaScriptPHP ^7.0

Since Apr 25Pushed 9y ago1 watchersCompare

[ Source](https://github.com/dev-lucid/html)[ Packagist](https://packagist.org/packages/dev-lucid/html)[ RSS](/packages/dev-lucid-html/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (2)Versions (4)Used By (1)

dev-lucid/html
==============

[](#dev-lucidhtml)

A library for building HTML.

Basic Usage
-----------

[](#basic-usage)

```
# in Javascript!
var factory = new lucid.html.factory();
var myAnchor = factory.build('anchor', 'http://google.com', 'google');
console.log(myAnchor.render());
```

```
# in PHP!
# (this assumes you've configured an autoloader to find this class)
$factory = new \Lucid\Html\Factory();
$myAnchor = $factory->build('anchor', 'http://google.com', 'google');
echo($myAnchor->render());
```

Both of these code samples will log/echo this:

```
google
```

Building and Testing
--------------------

[](#building-and-testing)

### Building all tags and running tests

[](#building-all-tags-and-running-tests)

There's one main script that does pretty much everything you'll need to do to change the source, package it up, and test it:

```
bin/make
```

This does the following:

1. Builds all tags (See sections below)
2. Packages up all Javascript files (See sections below)
3. Loads the final javascript files in node just to do one final syntax check
4. Runs all unit tests

This library uses [phpunit](https://phpunit.de) to run unit tests, but additionally runs javascript tests through phpunit by calling [node.js](https://nodejs.org/en/) through shell\_exec. So in order to run unit tests, you must [install node](https://docs.npmjs.com/getting-started/installing-node). You will also have to use composer before running tests as the tests use composer's autoloader.

### Building Tags

[](#building-tags)

Every tag in the library is generated using a json file that describes the tag. To generate the javascript tag for the base anchor tag,

```
bin/makeTagJavascript.php ./src/Base/meta/anchor.json
 # This will generate ./src/Base/tags/anchor.js
```

To generate the PHP tag for the base anchor tag,

```
bin/makeTagPHP.php ./src/Base/meta/anchor.json
 # This will generate ./src/Base/tags/anchor.php
```

To build *all* tags in a meta folder:

```
bin/makeAllTags ./src/Base/meta
 # this builds everything!
```

### Packing up Javascript files for distribution

[](#packing-up-javascript-files-for-distribution)

```
bin/makeJsDist.php
```

This will generate four files:

1. ./dist/lucid.html.buildBaseTagsOnly.js
2. ./dist/lucid.html.buildBaseTagsOnly.min.js (this is the same as the previous file, but minified)
3. ./dist/lucid.html.buildBootstrap.js
4. ./dist/lucid.html.buildBootstrap.min.js (this is the same as the previous file, but minified)

In a project, only one of those 4 files needs to be included.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~37 days

Total

3

Last Release

3597d ago

Major Versions

1.1.0 → 2.0.02016-07-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/a44e2d448a7f0dd612ab8245c9e2fa3532cd8ea891aca38d0a254b54cf286939?d=identicon)[dev-lucid](/maintainers/dev-lucid)

---

Top Contributors

[![dev-lucid](https://avatars.githubusercontent.com/u/4974898?v=4)](https://github.com/dev-lucid "dev-lucid (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dev-lucid-html/health.svg)

```
[![Health](https://phpackages.com/badges/dev-lucid-html/health.svg)](https://phpackages.com/packages/dev-lucid-html)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
