{"id":16215068,"url":"https://github.com/xarg/taller","last_synced_at":"2025-03-19T09:31:30.708Z","repository":{"id":66874420,"uuid":"2504990","full_name":"xarg/taller","owner":"xarg","description":"Template - aller - best golang templating system ever!","archived":false,"fork":false,"pushed_at":"2011-10-22T13:39:07.000Z","size":100,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-11T02:12:58.670Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xarg.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-10-03T14:19:22.000Z","updated_at":"2022-02-06T16:27:21.000Z","dependencies_parsed_at":"2023-02-20T13:30:27.348Z","dependency_job_id":null,"html_url":"https://github.com/xarg/taller","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/xarg%2Ftaller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarg%2Ftaller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarg%2Ftaller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xarg%2Ftaller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xarg","download_url":"https://codeload.github.com/xarg/taller/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982171,"owners_count":20378604,"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-10-10T11:13:47.738Z","updated_at":"2025-03-19T09:31:30.412Z","avatar_url":"https://github.com/xarg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"taller\n=========\n\nThis is a golang templating lib. Here are it's assertions:\n\n- I don't want to be limited by some idiotic ``people that write templates are stupid`` rule.\n- I don't want to learn yet another template language.\n- I want to use golang expressions if, for..\n- I want all the power of indexing, attribute resolution and performing operations that golang offers.\n- I want to type less stuff and do more.\n- I want to include/extend other templates in my template. (think jinja)\n\nName\n--------\n\n**taller** (pronounced /ta.le/) is composed of **t** (template) and **aller** (the verb \"go\" in French).\n\nUsage\n-------\n\nTo know where the templates are **taller** requires a **TALLER_PATH** \nenvironment variable which is just like a normal unix **PATH** separated by \":\". \n\n::\n\n        package main\n\n        import (\n                \"github.com/humanfromearth/taller\"\n                \"os\"\n        )\n\n        def main() {\n                os.Setenv(\"TALLER_PATH\", \"/path/to/my/templates:/templates/\")\n\n                template := taller.TemplateFile(\"template.html\")\n                context := \u0026taller.Context{\"foo\": \"bar\", \"baz\": 1}\n\n                content := taller.Render(template, context)\n                //taller is all bytes so we need to convert here to string\n                println(string(content))\n        }\n\nFor more examples of templates visit ``docs/examples/`` - TODO\n\nHow it works\n-------------\n\nGiven a context and a template file translate the template directly into golang \ncode executing it with the context and will returning the result.\n\nAgain ::\n\n        template source -\u003e golang code -\u003e binary -\u003e execute with context -\u003e get the result\n\nWhy not just use a normal parser + reflect?\n----------------------------------------------\n\nI don't know how to write a decent parser/compiler so I'll use the golang \ncompiler to do the job for me. Also it should be very fast. This of course \nmakes the template language somewhat inflexible, but I think I can live with it.\n\n[[Add benchmarks here]]\n\nParsing\n-----------------\n\nThe rules are simple:\n\n0. There are no spaces in the declaration of tags such as: [ if x == 1]. \n   Everything will begin with the actual tag: [if x[0] == 1]. \n   There are no 2 tags on the same line. These are the only style enforcing rules.\n\n1. Find all [import ..], [extend ..] [include ..] in this order and perform the \n   required operations on them.\n\n2. Find all blocks [block ...] and [endblock] and replace them in an order of \n   resolution the leafs have the highest priority.\n\n3. Find all [if ...][endif], [for ...][endfor] and just replace them as \n   golang code. [if foo][endif] translates to if context[\"foo\"] {} and so on.\n\n4. Replace all \\`expression\\` with fmt.Fprintf(output, expression)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxarg%2Ftaller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxarg%2Ftaller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxarg%2Ftaller/lists"}