{"id":16895749,"url":"https://github.com/ytti/malline","last_synced_at":"2025-06-13T11:38:26.429Z","repository":{"id":14208579,"uuid":"16915289","full_name":"ytti/malline","owner":"ytti","description":"silly little template language","archived":false,"fork":false,"pushed_at":"2014-02-19T10:28:49.000Z","size":132,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-30T08:55:14.571Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/ytti.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}},"created_at":"2014-02-17T14:25:32.000Z","updated_at":"2014-02-19T10:28:50.000Z","dependencies_parsed_at":"2022-07-08T04:01:44.350Z","dependency_job_id":null,"html_url":"https://github.com/ytti/malline","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ytti/malline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fmalline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fmalline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fmalline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fmalline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ytti","download_url":"https://codeload.github.com/ytti/malline/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ytti%2Fmalline/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259638891,"owners_count":22888540,"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-13T17:25:52.488Z","updated_at":"2025-06-13T11:38:26.397Z","avatar_url":"https://github.com/ytti.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Malline\n\nMalline is template engine targeting IOS/JunOS or generally configurations (or\nmore accurately what ever text stuff I'm doing).\n\nIt surfaced from the need to do something like this in ERB:\n```\ninterfaces {\n  \u003c%= name %\u003e {\n    description \"\u003c%if description %\u003e\";\n  }\n}\n```\n\nwhere description \"description\"; is only output if the code evaluates true,\nkeeping the template clean in common use-case\n\n```\nConsider this code\nrequire_relative './lib/malline'\nrequire 'pry'\nclass Int\n  attr_accessor :name, :mtu, :description, :poop\n  def initialize\n    @name = 'xe-1/2/3.42'\n    @mtu = 1500\n    @description = 'K: S-123455 - poop customer'\n    @poop = true\n  end\n  def get_binding\n    binding\n  end\nend\n\ntemplate = \u003c\u003cEOF\ninterfaces {\n   \u003c% name %\u003e {\n     mtu \u003c%if mtu %\u003e;\n     description \"\u003c%if description %\u003e\";\n   }\n}\nEOF\n\nint = Int.new\ncfg = Malline.run template, int.get_binding\nbinding.pry\n```\n\nReal use might look something like this:\n```\n[1] pry(main)\u003e puts cfg\ninterfaces {\n   xe-1/2/3.42 {\n     mtu 1500;\n     description \"K: S-123455 - poop customer\";\n   }\n}\n=\u003e nil\n[2] pry(main)\u003e int.mtu = 900\n=\u003e 900\n[3] pry(main)\u003e int.description = nil\n=\u003e nil\n[4] pry(main)\u003e puts Malline.run template, int.get_binding\ninterfaces {\n   xe-1/2/3.42 {\n     mtu 900;\n   }\n}\n=\u003e nil\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytti%2Fmalline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fytti%2Fmalline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fytti%2Fmalline/lists"}