{"id":16115231,"url":"https://github.com/pvande/milk","last_synced_at":"2025-04-12T19:42:53.305Z","repository":{"id":57297118,"uuid":"1166745","full_name":"pvande/Milk","owner":"pvande","description":"Milk is Mustache in CoffeeScript -- great with your browser or NodeJS!","archived":false,"fork":false,"pushed_at":"2024-11-19T19:05:42.000Z","size":124,"stargazers_count":188,"open_issues_count":4,"forks_count":19,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-04T00:45:03.065Z","etag":null,"topics":["coffeescript","javascript","mustache","template-language"],"latest_commit_sha":null,"homepage":"http://pvande.github.com/Milk","language":"CoffeeScript","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/pvande.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2010-12-14T01:42:01.000Z","updated_at":"2024-03-06T12:18:30.000Z","dependencies_parsed_at":"2024-12-18T08:00:48.313Z","dependency_job_id":"110ee446-63ea-48af-9542-7e6094f2bf5a","html_url":"https://github.com/pvande/Milk","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvande%2FMilk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvande%2FMilk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvande%2FMilk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvande%2FMilk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pvande","download_url":"https://codeload.github.com/pvande/Milk/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625446,"owners_count":21135512,"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":["coffeescript","javascript","mustache","template-language"],"created_at":"2024-10-09T20:18:08.329Z","updated_at":"2025-04-12T19:42:53.259Z","avatar_url":"https://github.com/pvande.png","language":"CoffeeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Milk\n====\n\n      Idly the man scrawled quill along page.  It was early yet, but his day\n    had scarcely begun.  Great sheaves of nearly identical work sat about his\n    desk as the clock clicked slowly to itself.  One by one, new pages joined\n    the ranks, permeated with the smell of roasted beans as the pen drew\n    coffee as often as ink.\n      Exhausted, he collapsed atop his work in a fitful doze.  Images began to\n    invade his unconscious mind, of flight and fancy, and jubilant impropriety.\n    Then just as suddenly as he had slept, he woke, the image of a small child\n    wearing a big smile and a heavy coat of Milk on his upper lip startling him\n    back to alertness.\n      He saw clearly, as he looked across his paper-strewn desk, that the task\n    could be changed – and for once, it looked like fun.\n\nMilk is a [spec-conforming](https://github.com/mustache/spec) (v1.1+λ)\nimplementation of the [Mustache](http://mustache.github.com) templating\nlanguage, written in [CoffeeScript](http://coffeescript.com).  Templates can be\nrendered server-side (through Node.js or any other CommonJS platform), or,\nsince CoffeeScript compiles to Javascript, on the client-side in the browser\nof your choice.\n\nTry Milk Now\n------------\n\nWondering what it can do?\n[Hit the playground!](http://pvande.github.com/Milk/playground.html)\n\nInstallation\n------------\n\n    npm install milk\n\nUsage\n-----\n\nMilk is built for use both in CommonJS environments and in the browser (where\nit will be exported as `window.Milk`).  The public API is deliberately simple:\n\n### render\n\n``` javascript\n  Milk.render(template, data);            // =\u003e 'A rendered template'\n  Milk.render(template, data, partials);  // =\u003e 'A rendered template'\n```\n\nThe `render` method is the core of Milk. In its simplest form, it takes a\nMustache template string and a data object, returning the rendered template.\nIt also takes an optional third parameter, which can be either a hash of named\npartial templates, or a function that takes a partial name and returns the\npartial.\n\n### partials\n\n``` javascript\n  Milk.partials = { ... };\n\n  // equivalent to Milk.render(template, data, Milk.partials)\n  Milk.render(template, data);\n```\n\nIf your application's needs for partials are relatively simple, it may make\nmore sense to handle partial resolution globally.  To support this, your calls\nto `render` will automatically fall back to using `Milk.partials` when you\ndon't supply explicit partial resolution.\n\n### helpers\n\n``` javascript\n  Milk.helpers = { ... };  // will also work with an array\n\n  // everything from Milk.helpers lives at the bottom of the context stack\n  Milk.render(template, data);\n```\n\nWhether for internationalization or syntax highlighting, sometimes you'll find\nyourself needing certain functions available everywhere in your templates.\nTo help enable this behavior, Milk.helpers acts as the baseline for your\ncontext stack, providing a quick way to all the global data and functions you\nneed.\n\n### escape\n\n``` javascript\n  Milk.escape('\u003ctag type=\"evil\"\u003e');  // =\u003e '\u0026lt;tag type=\u0026quot;evil\u0026quot;\u0026gt;'\n\n  Milk.escape = function(str) { return str.split(\"\").reverse().join(\"\") };\n\n  // Milk.escape is used to handle all escaped tags\n  var template = \"{{data}} is {{{data}}}\";\n  Milk.render(template, { \"data\": \"reversed\" });  // =\u003e \"desrever is reversed\"\n```\n\n`Milk.escape` is the function that Milk uses to handle escaped interpolation.\nAs such, you can use it (e.g. from lambdas) to perform the same escaping that\nMilk does, or you can override it to change the behavior of escaped tags.\n\n### VERSION\n\n``` javascript\n  Milk.VERSION  // =\u003e '1.2.0'\n```\n\nFor when you absolutely must know what version of the library you're running.\n\nDocumentation\n-------------\n\nMilk itself is documented more completely at http://pvande.github.com/Milk \n(public API documentation is\n[this bit](http://pvande.github.com/Milk#section-26)).\n\nThe Mustache templating language is documented at http://mustache.github.com.\n\nDevelopment\n-----------\n\nA few things to note:\n\n* This project uses submodules. To get them, run `git submodule init` and `git\nsubmodule update`.\n* To install the npm dependencies, run `npm install .`\n* There are a number of `cake` tasks, including ones that build the specs. To\nlist the tasks, simply run `cake` in the project directory. To build the\nspecs, run `cake spec:node` or `cake spec:html`.\n* To run the node.js tests, run `npm test`.\n\nCopyright\n---------\n\nCopyright (c) 2011 Pieter van de Bruggen.\n\n(The GIFT License, v2)\n\nPermission is hereby granted to use this software and/or its source code for\nwhatever purpose you should choose.  Seriously, go nuts. Use it to build your\nfamily CMS, your incredibly popular online text adventure, or to mass-produce\nConstitutions for North African countries.\n\nI don't care, it's yours.  Change the name on it if you want -- in fact, if\nyou start significantly changing what it does, I'd rather you did!  Make it\nyour own little work of art, complete with a stylish flowing signature in the\ncorner. All I really did was give you the canvas.  And my blessing.\n\n    Know always right from wrong, and let others see your good works.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvande%2Fmilk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpvande%2Fmilk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvande%2Fmilk/lists"}