{"id":19905197,"url":"https://github.com/ossphilippines/temple","last_synced_at":"2025-04-15T16:43:08.504Z","repository":{"id":240877016,"uuid":"803094827","full_name":"OSSPhilippines/temple","owner":"OSSPhilippines","description":"Reactive template engine","archived":false,"fork":false,"pushed_at":"2024-09-27T05:08:26.000Z","size":5842,"stargazers_count":14,"open_issues_count":2,"forks_count":11,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T01:46:39.288Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/OSSPhilippines.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-05-20T04:00:27.000Z","updated_at":"2025-02-05T07:43:05.000Z","dependencies_parsed_at":"2024-05-21T08:05:38.559Z","dependency_job_id":"7475a5f6-7c0f-4144-9bb2-a31dffa4c52c","html_url":"https://github.com/OSSPhilippines/temple","commit_stats":{"total_commits":208,"total_committers":1,"mean_commits":208.0,"dds":0.0,"last_synced_commit":"7230699d35e2783cf326daca63ca515ac5b5de2e"},"previous_names":["cblanquera/temple","ossphilippines/temple"],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSSPhilippines%2Ftemple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSSPhilippines%2Ftemple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSSPhilippines%2Ftemple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OSSPhilippines%2Ftemple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OSSPhilippines","download_url":"https://codeload.github.com/OSSPhilippines/temple/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249110630,"owners_count":21214367,"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":"2024-11-12T20:32:00.935Z","updated_at":"2025-04-15T16:43:08.484Z","avatar_url":"https://github.com/OSSPhilippines.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://ossphilippines.github.io/temple/temple-icon.png\" width=\"100\" /\u003e\n  \u003ch1\u003eTemple\u003c/h1\u003e\n  \u003cp\u003eThe reactive web component template engine.\u003c/p\u003e\n  \u003ca href=\"https://www.npmjs.com/package/@ossph/temple\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/%40ossph%2Ftemple.svg?style=flat\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/OSSPhilippines/temple/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/OSSPhilippines/temple/commits/main/\"\u003e\u003cimg src=\"https://img.shields.io/github/last-commit/OSSPhilippines/temple\" /\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/OSSPhilippines/temple/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://ossphilippines.github.io/temple\"\u003eDocumentation\u003c/a\u003e\n  \u003cbr /\u003e\n  \u003chr /\u003e\n\u003c/div\u003e\n\n## Install\n\n```bash\n$ npm -i @ossph/temple\n```\n\n## Compiler Usage\n\n```js\n//on server:\nimport temple from '@ossph/temple/compiler';\n//make a temple compiler\nconst compiler = temple();\n//render HTML\nconst results = compiler.render('./page.dtml');\n//show HTML\nconsole.log(results);\n```\n\n## Temple 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 '@ossph/temple';\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 '@ossph/temple';\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.tml\" /\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 '@ossph/temple';\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.tml\" /\u003e\n\u003clink rel=\"import\" type=\"component\" href=\"./components/to-do.tml\" /\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 Temple?\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. Temple 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\nTemple works with most server frameworks including:\n\n - [Express](https://github.com/OSSPhilippines/temple/tree/main/examples/with-express)\n - [Fastify](https://github.com/OSSPhilippines/temple/tree/main/examples/with-fastify)\n - [Hapi](https://github.com/OSSPhilippines/temple/tree/main/examples/with-hapi)\n - [Koa](https://github.com/OSSPhilippines/temple/tree/main/examples/with-koa)\n - [NestJS](https://github.com/OSSPhilippines/temple/tree/main/examples/with-nest)\n - [Webpack](https://github.com/OSSPhilippines/temple/tree/main/examples/with-webpack)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fossphilippines%2Ftemple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fossphilippines%2Ftemple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fossphilippines%2Ftemple/lists"}