{"id":19055139,"url":"https://github.com/sangupta/snowmark","last_synced_at":"2025-11-11T23:05:23.719Z","repository":{"id":49315909,"uuid":"517258701","full_name":"sangupta/snowmark","owner":"sangupta","description":"HTML templates for go","archived":false,"fork":false,"pushed_at":"2023-02-25T01:22:26.000Z","size":32,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-02T11:12:28.467Z","etag":null,"topics":["custom-tags","go","golang","html-template-engine","template-engine"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sangupta.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":"2022-07-24T07:41:32.000Z","updated_at":"2022-07-24T07:46:05.000Z","dependencies_parsed_at":"2024-06-21T09:04:44.088Z","dependency_job_id":null,"html_url":"https://github.com/sangupta/snowmark","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sangupta%2Fsnowmark","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sangupta%2Fsnowmark/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sangupta%2Fsnowmark/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sangupta%2Fsnowmark/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sangupta","download_url":"https://codeload.github.com/sangupta/snowmark/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240110620,"owners_count":19749337,"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":["custom-tags","go","golang","html-template-engine","template-engine"],"created_at":"2024-11-08T23:42:13.861Z","updated_at":"2025-11-11T23:05:23.712Z","avatar_url":"https://github.com/sangupta.png","language":"Go","readme":"# snowmark - HTML templates for Go.\n\n[![Build Status](https://github.com/sangupta/snowmark/actions/workflows/unittest.yml/badge.svg?branch=main)](https://github.com/sangupta/snowmark/actions)\n[![Code Coverage](https://codecov.io/gh/sangupta/snowmark/branch/main/graphs/badge.svg?branch=main)](https://codecov.io/gh/sangupta/snowmark)\n[![go.mod version](https://img.shields.io/github/go-mod/go-version/sangupta/snowmark.svg)](https://github.com/sangupta/snowmark)\n![GitHub](https://img.shields.io/github/license/sangupta/snowmark)\n[![Go Report Card](https://goreportcard.com/badge/github.com/sangupta/snowmark)](https://goreportcard.com/report/github.com/sangupta/snowmark)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/sangupta/snowmark)](https://pkg.go.dev/github.com/sangupta/snowmark)\n\n`snowmark` is a library for HTML templates that uses HTML\ncustom tags and custom attributes instead of confusing markup\nintertwined within HTML. It is very similar to Java Server\nPages but uses `string` manipulation to merge templates. In\nsome ways `snowmark` is also similar to `Velocity` templates\nexcept using custom tags.\n\n# Table of contents\n\n- [Features](#features)\n- [API](#api)\n- [Usage Example](#usage-example)\n- [Hacking](#hacking)\n- [Changelog](#changelog)\n- [License](#license)\n\n# Features\n\n* Merge HTML templates with custom model\n* Bring your own custom tags\n* Attribute expressions\n* Standard tag library includes:\n  - Get variable\n  - Set variable (global or in block)\n  - If-then\n\n# API\n\n# Usage Example\n\nLet's use the following example HTML template that we want to\nmerge with our own data model:\n\n```html\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle\u003e\n            \u003ctest:get var=\"pageTitle\" /\u003e\n        \u003c/title\u003e\n    \u003c/head\u003e\n\u003c/html\u003e\n```\n\nThe data model to be used represented as JSON is:\n\n```json\n{\n    \"pageTitle\" : \"Hello World\"\n}\n```\n\nThe following code allows us to do the same:\n\n```go\n// parse HTML doc\ntemplate := \"\u003chtml\u003e\u003chead\u003e\u003ctitle\u003e\u003cget var='pageTitle' /\u003e\u003c/title\u003e\u003c/head\u003e\u003c/html\u003e\"\n\n// create the model\nmodel := snowmark.NewModel()\nmodel.Put(\"pageTitle\", \"Hello World\")\n\n// create a page processor\nprocessor := snowmark.NewHtmlPageProcessor()\n\n// add all your custom tags\n// you have the choice to name each tag differently\nprocessor.AddCustomTag(\"test:get\", snowmark.GetVariableTag)\n\n// call merge\nhtml, _ := processor.MergeHtml(template, model)\nfmt.Println(html)\n```\n\n# Hacking\n\n* To build the Go docs locally:\n  - `$ godoc -http=:6060`\n  - Open http://localhost:6060/pkg/github.com/sangupta/snowmark\n\n* To run all tests along with code coverage report\n  - `$ go test ./... -v -coverprofile coverage.out`\n  - `$ go tool cover -html=coverage.out`\n\n# Changelog\n\n* **Version 0.1.0**\n  - Initial release\n\n# License\n\nMIT License. Copyright (C) 2022, Sandeep Gupta. \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsangupta%2Fsnowmark","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsangupta%2Fsnowmark","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsangupta%2Fsnowmark/lists"}