{"id":24807292,"url":"https://github.com/stackpress/ink","last_synced_at":"2025-04-11T14:09:38.325Z","repository":{"id":257806439,"uuid":"866276589","full_name":"stackpress/ink","owner":"stackpress","description":"A web component template engine.","archived":false,"fork":false,"pushed_at":"2025-03-11T14:00:13.000Z","size":30727,"stargazers_count":7,"open_issues_count":2,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T21:03:56.192Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ink","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackpress.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-02T00:33:50.000Z","updated_at":"2025-03-11T14:00:18.000Z","dependencies_parsed_at":"2024-10-02T02:58:21.520Z","dependency_job_id":"411258ad-695b-457a-9998-022d8690d2e8","html_url":"https://github.com/stackpress/ink","commit_stats":null,"previous_names":["stackpress/ink"],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpress%2Fink","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpress%2Fink/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpress%2Fink/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackpress%2Fink/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackpress","download_url":"https://codeload.github.com/stackpress/ink/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248413713,"owners_count":21099347,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-30T09:18:03.962Z","updated_at":"2025-04-11T14:09:38.307Z","avatar_url":"https://github.com/stackpress.png","language":"Ink","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://stackpress.github.io/ink/ink-icon.png\" width=\"100\" /\u003e\n  \u003ch1\u003eInk\u003c/h1\u003e\n  \u003cp\u003eThe reactive web component template engine.\u003c/p\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@stackpress/ink\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/%40stackpress%2Fink.svg?style=flat\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/stackpress/ink/blob/main/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/stackpress/ink/commits/main/\"\u003e\u003cimg src=\"https://img.shields.io/github/last-commit/stackpress/ink\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/stackpress/ink/actions\"\u003e\u003cimg src=\"https://img.shields.io/github/actions/workflow/status/stackpress/ink/test.yml\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://coveralls.io/github/stackpress/ink?branch=main\"\u003e\u003cimg src=\"https://coveralls.io/repos/github/stackpress/ink/badge.svg?branch=main\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/stackpress/ink/blob/main/README.md#contributing\"\u003e\u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" /\u003e\u003c/a\u003e\n  \u003cbr /\u003e\n  \u003cbr /\u003e\n  \u003ca href=\"https://stackpress.io/ink\"\u003eDocumentation\u003c/a\u003e\n  \u003cbr /\u003e\n  \u003chr /\u003e\n\u003c/div\u003e\n\n## Install\n\n```bash\n$ npm -i @stackpress/ink\n```\n\n## Compiler Usage\n\n```js\n//on server:\nimport ink from '@stackpress/ink/compiler';\n//make a ink compiler\nconst compiler = ink();\n//render HTML\nconst results = compiler.render('./page.ink');\n//show HTML\nconsole.log(results);\n```\n\n## Ink Markup\n\n**Basic Markup**\n\n```html\n\u003c!-- page.html --\u003e\n\u003cscript\u003e\n  const name = 'world';\n\u003c/script\u003e\n\u003ch1\u003eHello {name}!\u003c/h1\u003e\n```\n\n**Markup with Styles**\n\n```html\n\u003c!-- page.html --\u003e\n\u003cstyle\u003e\n  :host {\n    color: purple;\n  }\n  :host h1 {\n    font-family: 'Comic Sans MS', cursive;\n    font-size: 2em;\n  }\n\u003c/style\u003e\n\u003cscript\u003e\n  const name = 'world';\n\u003c/script\u003e\n\u003ch1\u003eHello {name}!\u003c/h1\u003e\n```\n\n**Markup with Props**\n\n```html\n\u003c!-- page.html --\u003e\n\u003cscript\u003e\n  import { props } from '@stackpress/ink';\n  const { name } = props();\n\u003c/script\u003e\n\u003ch1\u003eHello {name}\u003c/h1\u003e\n```\n\n**Markup with Reactivity**\n\n```html\n\u003c!-- page.html --\u003e\n\u003cscript\u003e\n  import { signal } from '@stackpress/ink';\n  const name = signal('world');\n  const add = () =\u003e name.value += '!';\n\u003c/script\u003e\n\u003ch1 click=add\u003eHello {name.value}\u003c/h1\u003e\n```\n\n**Markup with Imports**\n\n```html\n\u003c!-- page.html --\u003e\n\u003clink rel=\"import\" type=\"component\" href=\"./my-heading.ink\" /\u003e\n\u003cscript\u003e\n  const name = 'world';\n\u003c/script\u003e\n\u003cmy-heading {name}\u003eHello\u003c/my-heading\u003e\n```\n\n```html\n\u003c!-- my-heading.html --\u003e\n\u003cscript\u003e\n  import { props, children } from '@stackpress/ink';\n  const { name } = props();\n\n\u003c/script\u003e\n\u003ch1\u003e{children()} {name}\u003c/h1\u003e\n```\n\n**Markup with Conditional**\n\n```html\n\u003c!-- page.html --\u003e\n\u003cscript\u003e\n  const name = 'world';\n  const show = name === \"world\";\n\u003c/script\u003e\n\u003cif true={show}\u003e\n  \u003ch1\u003eHello {name}\u003c/h1\u003e\n\u003c/if\u003e\n```\n\n**Markup with Loops**\n\n```html\n\u003c!-- page.html --\u003e\n\u003cscript\u003e\n  const list = [ 'a', 'b', 'c' ];\n\u003c/script\u003e\n\u003cul\u003e\n  \u003ceach key=i value=item from=list\u003e\n    \u003cli\u003e{i}: {item}\u003c/li\u003e\n  \u003c/each\u003e\n\u003c/ul\u003e\n```\n\n**Document Markup**\n\n```html\n\u003c!-- page.html --\u003e\n\u003clink rel=\"import\" type=\"template\" href=\"./templates/html-head.ink\" /\u003e\n\u003clink rel=\"import\" type=\"component\" href=\"./components/to-do.ink\" /\u003e\n\u003cstyle\u003e\n  body { \n    background-color: #DA532C; \n    color: #EFEFEF; \n  }\n\u003c/style\u003e\n\u003chtml\u003e\n  \u003chtml-head /\u003e\n  \u003cbody\u003e\n    \u003ch1\u003e{title}\u003c/h1\u003e\n    \u003cto-do list=list start=start /\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## Why Ink?\n\nCurrent frontend solutions for the most part, come in the form of a \n\"frontend framework\" and are \"all encompassing\", requiring more import \ninto the frontend framework and give little export out to support server \nfirst solutions. Ink is a modern HTML markup language and a server \nfirst template engine with a built-in parser/compiler that generates \nweb components and support reactivity. \n\nInk works with most server frameworks including:\n\n - [Express](https://github.com/stackpress/ink/tree/main/examples/with-express)\n - [Fastify](https://github.com/stackpress/ink/tree/main/examples/with-fastify)\n - [Hapi](https://github.com/stackpress/ink/tree/main/examples/with-hapi)\n - [Koa](https://github.com/stackpress/ink/tree/main/examples/with-koa)\n - [NestJS](https://github.com/stackpress/ink/tree/main/examples/with-nest)\n - [Webpack](https://github.com/stackpress/ink/tree/main/examples/with-webpack)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackpress%2Fink","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackpress%2Fink","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackpress%2Fink/lists"}