SECST

raw JSON →
0.0.3-a verified Fri May 01 auth: no javascript

SECST (Semantic, Extensible, Computational, Styleable Tagged markup) is a markup language and HTML transpiler for creating interactive documents. The current version is 0.0.3-alpha, with infrequent updates. It is designed for joyfully creating compelling documents backed by HTML, aiming to be more extensible and computational than Markdown. Key differentiators include a custom tag syntax, runtime interactivity, and styleability. The project is in early alpha, so expect instability and limited documentation.

error Cannot find module 'secst'
cause Package not installed or import path incorrect.
fix
Run npm install secst@0.0.3-a and ensure ESM import syntax.
error SyntaxError: Cannot use import statement outside a module
cause CommonJS environment does not support ESM imports.
fix
Add type: 'module' to package.json or use .mjs extension.
error TypeError: compile is not a function
cause Incorrect import or wrong symbol name.
fix
Use import { compile } from 'secst' rather than default import.
deprecated Package version 0.0.3-alpha is in alpha stage and may have breaking changes in future releases.
fix Pin to exact version or watch for updates.
gotcha SECST is ESM-only; CommonJS require will fail on Node.js without experimental modules flag.
fix Use import syntax or set type: 'module' in package.json.
gotcha Compiler may not handle all HTML entities or edge cases; beta quality.
fix Test thoroughly and report issues on GitHub.
gotcha Documentation at secst.org may be incomplete or outdated.
fix Refer to GitHub README or source code.
npm install secst
yarn add secst
pnpm add secst

Demonstrates basic compile usage with and without custom tags, showing SECST to HTML transformation.

import { compile } from 'secst';
import fs from 'fs';

const source = `<p>Hello, <strong>World</strong>!</p>`;
const html = compile(source);
console.log(html);
// Output: <p>Hello, <strong>World</strong>!</p>

// With custom tags:
const sourceWithTag = `<greeting>Hi, <name>Alice</name></greeting>`;
const htmlWithTag = compile(sourceWithTag, { tags: { greeting: (children) => `<div class='greeting'>${children}</div>`, name: (children) => `<span class='name'>${children}</span>` }});
console.log(htmlWithTag);
// Output: <div class='greeting'>Hi, <span class='name'>Alice</span></div>