{"id":15561052,"url":"https://github.com/redding/deas-nm","last_synced_at":"2026-01-21T10:07:20.770Z","repository":{"id":23302289,"uuid":"26661713","full_name":"redding/deas-nm","owner":"redding","description":"Deas template engine for Nm templates","archived":false,"fork":false,"pushed_at":"2018-04-18T19:47:33.000Z","size":28,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-11-30T22:40:54.786Z","etag":null,"topics":["ruby","template-engine"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/redding.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":"2014-11-14T23:10:57.000Z","updated_at":"2018-10-20T00:43:09.000Z","dependencies_parsed_at":"2022-08-21T23:10:12.467Z","dependency_job_id":null,"html_url":"https://github.com/redding/deas-nm","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/redding/deas-nm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Fdeas-nm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Fdeas-nm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Fdeas-nm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Fdeas-nm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redding","download_url":"https://codeload.github.com/redding/deas-nm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redding%2Fdeas-nm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28631936,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T04:47:28.174Z","status":"ssl_error","status_checked_at":"2026-01-21T04:47:22.943Z","response_time":86,"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":["ruby","template-engine"],"created_at":"2024-10-02T16:05:03.681Z","updated_at":"2026-01-21T10:07:20.756Z","avatar_url":"https://github.com/redding.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Deas::Nm\n\n[Deas](https://github.com/redding/deas) template engine for rendering [Nm](https://github.com/redding/nm) templates\n\n## Usage\n\nRegister the engine:\n\n```ruby\nrequire 'deas'\nrequire 'deas-nm'\n\nDeas.configure do |c|\n\n  c.template_source \"/path/to/templates\" do |s|\n    s.engine 'nm', Deas::Nm::TemplateEngine\n  end\n\nend\n```\n\nAdd `.nm` to any template files in your template source path.  Deas will render their content using Nm when they are rendered.\n\n### Serialization\n\nNm doesn't serialize the objects it renders - it just returns them.  However, Deas expects serialized body content.  By default, the rendered objects are not serialized.\n\nTo serialize the rendered objects, specify a serializer when registering:\n\n```ruby\n# this uses Oj to serialize to JSON (for example)\nc.template_source \"/path/to/templates\" do |s|\n  s.engine('nm', Deas::Nm::TemplateEngine, {\n    'serializer' =\u003e proc{ |obj, template_name| Oj.dump(obj, :mode =\u003e :strict) }\n  })\nend\n```\n\nThe template name is passed to any serializer proc.  This can be helpful if choosing how to serialize is conditonal upon the template name.  For example:\n\n```ruby\nc.template_source \"/path/to/templates\" do |s|\n  s.engine('nm', Deas::Nm::TemplateEngine, {\n    'serializer' =\u003e proc do |obj, template_name|\n      if File.extname(template_name) == '.json'\n        Oj.dump(obj, :mode =\u003e :strict)\n      else\n        # serialize some other way?\n      end\n    end\n  })\nend\n```\n\n### Notes\n\nNm doesn't allow overriding the template scope but instead allows you to pass in data that binds to the template scope as local methods.  By default, the view handler will be bound to Nm's scope via the `view` method in templates.  If you want to change this, provide a `'handler_local'` option when registering:\n\n```ruby\nc.template_source \"/path/to/templates\" do |s|\n  s.engine 'nm', Deas::Nm::TemplateEngine, 'handler_local' =\u003e 'view_handler'\nend\n```\n\nNm doesn't cache templates by default.  To enable caching, pass a `'cache'` option when registering:\n\n```ruby\n  c.template_source \"/path/to/templates\" do |s|\n    s.engine 'nm', Deas::Nm::TemplateEngine, 'cache' =\u003e true\n  end\n```\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'deas-nm'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install deas-nm\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredding%2Fdeas-nm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredding%2Fdeas-nm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredding%2Fdeas-nm/lists"}