{"id":44774997,"url":"https://github.com/crackcomm/renderer","last_synced_at":"2026-02-16T06:35:42.429Z","repository":{"id":57600181,"uuid":"51754159","full_name":"crackcomm/renderer","owner":"crackcomm","description":"Golang HTML components renderer","archived":false,"fork":false,"pushed_at":"2016-08-24T07:46:57.000Z","size":161,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-20T12:05:28.743Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/crackcomm.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}},"created_at":"2016-02-15T12:31:19.000Z","updated_at":"2023-10-16T23:35:11.000Z","dependencies_parsed_at":"2022-09-16T18:51:29.233Z","dependency_job_id":null,"html_url":"https://github.com/crackcomm/renderer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/crackcomm/renderer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crackcomm%2Frenderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crackcomm%2Frenderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crackcomm%2Frenderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crackcomm%2Frenderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/crackcomm","download_url":"https://codeload.github.com/crackcomm/renderer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/crackcomm%2Frenderer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29501919,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T05:57:17.024Z","status":"ssl_error","status_checked_at":"2026-02-16T05:56:49.929Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-02-16T06:35:41.646Z","updated_at":"2026-02-16T06:35:42.424Z","avatar_url":"https://github.com/crackcomm.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Renderer\n\n[![GoDoc](https://godoc.org/tower.pro/renderer?status.svg)](https://godoc.org/tower.pro/renderer)\n\n### Installation\n\n```sh\n$ go get -u tower.pro/renderer\n```\n\n### API\n\nStart API server:\n\n```sh\n$ renderer server -watch -components ./examples/\n$ # With routes\n$ renderer server -watch -components ./examples/ -routes ./examples/routes.yaml\n```\n\nRender using API:\n\nAPI responds with `JSON` **only when** `Accept` header contains `application/json`,\nby default it writes HTML response.\n\n```sh\n# GET with component in URL\n# http://127.0.0.1:6660/?name=dashboard.components\u0026context={\"components\":[{\"name\":\"example number one\"}]}\n# Or with POST method and component in body\n$ curl -XPOST --data '{\n  \"name\": \"dashboard.components\",\n  \"context\": {\n    \"components\": [\n      {\n        \"name\": \"my.example.component\"\n      }\n    ]\n  }\n}' http://127.0.0.1:6660/\n```\n\n### Components\n\nSome example components can be found in `dashboard/components` directory.\n\nJSON representation of an `example.root` component:\n\n```json\n{\n  \"name\": \"example.root\",\n  \"main\": \"file://component.html\",\n  \"styles\": [\n    \"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css\",\n    \"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css\",\n    \"file://component.css\"\n  ],\n  \"scripts\": [\n    \"https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js\",\n    \"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js\",\n    \"file://application.js\"\n  ]\n}\n```\n\nExample of including components: `movies.movie` with `movies.video` component that can be rendered using `{{ video_component }}`:\n\nAdditionaly this component extends `movies.root` so after this component will be rendered, result will be included in `movies.root` under `{{ children }}` value.\n\n```json\n{\n  \"name\": \"movies.movie\",\n  \"main\": \"file://component.html\",\n  \"extends\": \"movies.root\",\n  \"require\": {\n    \"video_component\": {\n      \"name\": \"movies.video\",\n      \"with\": {\n        \"title\": \"{{ movie.title }} ({{ movie.year }})\"\n      }\n    }\n  }\n}\n```\n\n### Rendering\n\nRendering `admin.domains` component with a list of `domains` in `context`.\n\n```json\n{\n  \"name\": \"admin.domains\",\n  \"context\": {\n    \"domains\": [\n      {\"name\": \"test.pl\", \"links\": [\"test.pl\"]},\n      {\"name\": \"test2.pl\", \"links\": [\"test.pl\"]},\n      {\"name\": \"test3.pl\", \"links\": [\"test.pl\"]}\n    ]\n  }\n}\n```\n\n### Embedding\n\nAll data can be embed in `component.json`:\n\n  * `http://` and `https://` urls are allowed\n  * `file://` should be relative to `component.json`\n  * `text://` for plain text (non templates)\n  * `template://` will be executed as template\n\n```json\n{\n  \"name\": \"example.root\",\n  \"main\": \"template://\u003ch1\u003e{{title}}\u003c/h1\u003e\",\n  \"styles\": [\n    \"template://h1 { color: {{ color }}; }\",\n    \"text://some text here\"\n  ],\n  \"scripts\": [\n    \"template://console.log('{{ message }}');\",\n    \"text://console.log('test');\"\n  ]\n}\n```\n\n\n#### Some notes\n\nSo what a compiler is:\n\n* Has 3-rd party storage interface\n* Gets components from this storage\n* Compiles components for rendering\n* When asked for a component looks in storage\n* Compiles components on demand\n* Caches compiled results\n\nFile system storage and watching for changes\n\n* Components are very lightweight so full in-memory storage is fine along with file system replication\n* Compiler itself does not have to watch for changes in files when a file system storage may be in-memory cached and on-change caches can be cleared.\n\n## License\n\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrackcomm%2Frenderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcrackcomm%2Frenderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcrackcomm%2Frenderer/lists"}